diff --git a/.gitattributes b/.gitattributes index 90a9845d..73a347e4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,4 @@ # Code generated from the blueprint by the codegen. -src/Seam/Api/** linguist-generated -src/Seam/Model/** linguist-generated - -# Static, schema-independent sources kept alongside the generated code. - -src/Seam/Model/AsbtractModelSchema.cs -linguist-generated -src/Seam/Model/SafeStringEnumConverter.cs -linguist-generated +src/Seam/Routes/** linguist-generated +src/Seam/Models/** linguist-generated diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f813730e..5a3b7e7d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,6 +14,10 @@ updates: - dependency-name: '*' update-types: - 'version-update:semver-major' + # Pinned exact for the duration of the v2 beta so the daily bump does + # not regenerate the SDK against a moving API spec. Restore the caret + # range and drop this ignore at GA. + - dependency-name: '@seamapi/types' groups: seam: patterns: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 505a1425..d17580db 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -30,6 +30,8 @@ jobs: uses: actions/checkout@v7 - name: Setup uses: ./.github/actions/setup + - name: Setup Node.js + uses: ./.github/actions/setup-node - name: Test run: just test ${{ matrix.framework }} lint: @@ -114,9 +116,9 @@ jobs: write-mode: overwrite path: smoke/Program.cs contents: | - using Seam.Client; + using Seam; - var seam = new SeamClient(apiToken: "seam_apikey1_token"); + var seam = new SeamClient(apiKey: "seam_apikey1_token"); Console.WriteLine($"Constructed {seam.GetType().FullName}"); - name: Install run: dotnet add smoke package Seam --version "$VERSION" diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 6f326361..b2e3aab9 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -35,13 +35,13 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 needs: semantic - if: ${{ needs.semantic.outputs.new_release_published == 'true' }} + if: needs.semantic.outputs.new_release_published == 'true' && needs.semantic.outputs.new_release_version != '1.0.0' steps: - name: Checkout uses: actions/checkout@v7 with: fetch-depth: 1 - - name: Release version ${{ steps.release.outputs.new_release_version }} on ${{ github.ref_name }} + - name: Release version ${{ needs.semantic.outputs.new_release_version }} on ${{ github.ref_name }} run: gh workflow run version.yml --raw-field version=$VERSION --ref $BRANCH env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 3d9a72f8..f463d055 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -33,3 +33,15 @@ jobs: uses: ./.github/actions/setup-node - name: Cut ${{ github.event.inputs.version }} version run: npm version --sign-git-tag=true ${{ github.event.inputs.version }} + - name: Record prerelease channel + env: + VERSION: ${{ github.event.inputs.version }} + run: | + case "$VERSION" in + *-*) channel="${VERSION#*-}"; channel="${channel%%.*}" ;; + *) echo "Stable release, no channel note required."; exit 0 ;; + esac + git notes --ref "semantic-release-v$VERSION" add --force \ + --message "{\"channels\":[\"$channel\"]}" "v$VERSION^{commit}" + git push origin "refs/notes/semantic-release-v$VERSION" + echo "Recorded v$VERSION on the '$channel' channel." diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 00000000..cfdd0a9f --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,230 @@ +# Migration Guide + +## v1 to v2 + +Version 2 rebuilds the SDK on the architecture shared by the Seam SDKs for +other languages. The runtime dependencies (RestSharp, Newtonsoft.Json, +JsonSubTypes, Polly) are gone, the public surface is aligned with the other +SDKs, and the strict typing is stronger throughout. + +| Change | Affects you if... | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | +| [`SeamClient` construction changed](#seamclient-construction-changed) | You construct a client anywhere. | +| [Endpoint methods are async-only and take a request object](#endpoint-methods-are-async-only-and-take-a-request-object) | You call any endpoint. | +| [Route namespaces are nested](#route-namespaces-are-nested) | You call a nested route, e.g. `seam.UsersAcs`. | +| [Action attempts are waited for by default](#action-attempts-are-waited-for-by-default) | You call an endpoint returning an action attempt. | +| [Errors raise a typed exception hierarchy](#errors-raise-a-typed-exception-hierarchy) | You catch `SeamException`. | +| [Requests are retried, and time out per attempt](#requests-are-retried-and-time-out-per-attempt) | You rely on requests never retrying, or on global timeout config. | +| [Required parameters fail at compile time](#required-parameters-fail-at-compile-time) | You omit required parameters. | +| [Nullable parameters use `Optional`](#nullable-parameters-use-optionalt) | You pass `Null.Value` or unset values. | +| [Global configuration is removed](#global-configuration-is-removed) | You use `GlobalSeamRequestConfiguration` or `RetryConfiguration`. | +| [Generated code moved and unknown values are preserved](#generated-code-moved-and-unknown-values-are-preserved) | You reference `Seam.Api` or `Seam.Model` types directly. | + +v2 also adds features that require no migration; see +[New in v2](#new-in-v2) at the end. + +### `SeamClient` construction changed + +The v1 constructors took a positional `basePath` and an `apiToken`, and the +obsolete `Seam.Client.Seam` alias is removed. The client now lives in the +`Seam` namespace (not `Seam.Client`) and is constructed with an options +object or static factories: + +```csharp +// v1 +using Seam.Client; +var seam = new SeamClient(basePath: "https://connect.getseam.com", apiToken: "YOUR_API_KEY"); + +// v2 +using Seam; +var seam = new SeamClient(apiKey: "YOUR_API_KEY"); +// or +var seam = new SeamClient(new SeamClientOptions +{ + ApiKey = "YOUR_API_KEY", + Endpoint = "https://connect.getseam.com", +}); +``` + +The timeout is a `TimeSpan` option rather than an `int?` of milliseconds. + +### Endpoint methods are async-only and take a request object + +The four overloads per endpoint (sync and async, request-object and expanded +parameters) are replaced by one async method taking a request object and a +`CancellationToken`. Method names carry the `Async` suffix. + +```csharp +// v1 +var device = seam.Devices.Get(deviceId: "abc"); +var device = await seam.Devices.GetAsync(deviceId: "abc"); + +// v2 +var device = await seam.Devices.GetAsync(new() { DeviceId = "abc" }); +``` + +Positional arguments are no longer possible: request objects are constructed +with named properties, so adding or reordering API parameters is never a +source-breaking change. Callers that must block can use +`.GetAwaiter().GetResult()`, at the usual risk of sync-over-async. + +### Route namespaces are nested + +Route classes were named by reversing the API path, producing flat names like +`seam.UsersAcs` and `seam.SimulateEncodersAcs`. They now nest the way the API +paths (and the other SDKs) do: + +| v1 | v2 | +| ---------------------------------- | ----------------------------------- | +| `seam.UsersAcs` | `seam.Acs.Users` | +| `seam.SystemsAcs` | `seam.Acs.Systems` | +| `seam.SimulateEncodersAcs` | `seam.Acs.Encoders.Simulate` | +| `seam.UnmanagedDevices` | `seam.Devices.Unmanaged` | +| `seam.SchedulesThermostats` | `seam.Thermostats.Schedules` | +| `seam.NoiseThresholdsNoiseSensors` | `seam.NoiseSensors.NoiseThresholds` | + +### Action attempts are waited for by default + +Endpoints returning an action attempt no longer hand back a pending attempt: +the SDK polls until the attempt succeeds (10 second timeout, 1 second polling +interval), raising `SeamActionAttemptFailedException` when it fails and +`SeamActionAttemptTimeoutException` when the timeout elapses. `ActionAttempt` +now exposes `Status`, `Error`, and `ActionAttemptId` on the base class, so no +downcasting is needed to check the outcome. + +```csharp +// v2: returns the finished attempt, or throws. +var actionAttempt = await seam.Locks.UnlockDoorAsync(new() { DeviceId = deviceId }); + +// v1 behavior (return the pending attempt immediately): +var seam = new SeamClient(new SeamClientOptions { ApiKey = "...", WaitForActionAttempt = false }); +// or per call: +await seam.Locks.UnlockDoorAsync(new() { DeviceId = deviceId }, waitForActionAttempt: false); +``` + +### Errors raise a typed exception hierarchy + +The single `SeamException` carrying a raw response body is replaced by a +hierarchy rooted at an abstract `SeamException`: + +- `SeamHttpApiException` — any Seam API error, with `Code` (the Seam error + type), `StatusCode`, `RequestId` (the `seam-request-id` header), and `Data`. + - `SeamHttpUnauthorizedException` — 401. + - `SeamHttpInvalidInputException` — adds `GetValidationErrorMessages(paramName)`. +- `SeamActionAttemptFailedException` / `SeamActionAttemptTimeoutException` — + carry the `ActionAttempt`. +- `SeamInvalidOptionsException` / `SeamInvalidTokenException` — invalid client + construction. + +A response that is not a Seam error envelope (e.g. HTML from a gateway) now +raises the standard `HttpRequestException` instead of a fabricated Seam error. + +### Requests are retried, and time out per attempt + +v1 never retried by default. v2 retries idempotent requests (GET, HEAD, +OPTIONS, PUT, DELETE) twice on transport errors, timeouts, 429, and 5xx, with +exponential backoff and jitter, honoring `Retry-After`. POST and PATCH are +never retried. Since reads are sent as GET, they are now retryable. The +30 second timeout applies to each attempt and raises `TimeoutException`; +cancelling your own `CancellationToken` raises `OperationCanceledException`. +Configure with `MaxRetries` and `Timeout` on `SeamClientOptions`. + +### Required parameters fail at compile time + +In v1, every request parameter defaulted to `null`, so a missing required +parameter failed on the server. In v2, required parameters are C# `required` +members, so omitting one is a compile error. Endpoints that require at least +one of several parameters (e.g. `/devices/get`) throw `ArgumentException` +locally before any request is sent. + +### Nullable parameters use `Optional` + +Where the Seam API documents a parameter as nullable, the request property is +an `Optional` distinguishing unset (omitted), an explicit `Null.Value` +(sent as JSON null, unsetting the stored value), and a value. Plain optional +parameters remain nullable C# types where `null` means omitted. `Null.Value` +still works inside dictionaries such as `CustomMetadata`. + +### Global configuration is removed + +`GlobalSeamRequestConfiguration`, `RetryConfiguration`, and the other +openapi-generator-era types (`ApiResponse`, `Multimap`, `ClientUtils`, +`RequestOptions`, `ISynchronousSeam`, `IAsynchronousSeam`) are gone. All +configuration is per client via `SeamClientOptions`, and the configured +`HttpClient` is exposed as `seam.Client`. + +### Generated code moved and unknown values are preserved + +Generated types moved from `Seam.Api`/`Seam.Model` to +`Seam.Routes`/`Seam.Models` and are records with init-only properties. +Enums keep the `Unrecognized` fallback member for unknown API values. Unknown +union variants (`ActionAttemptUnrecognized`, `EventUnrecognized`, ...) now +preserve the complete raw payload in their `RawJson` property instead of +discarding it. + +### Checklist + +1. Update `using Seam.Client;` to `using Seam;` and construct `SeamClient` + with `apiKey:` or `SeamClientOptions`. +2. Replace sync calls with `await`ed `...Async` calls, and expanded-parameter + calls with request objects: `GetAsync(new() { DeviceId = ... })`. +3. Update nested route names, e.g. `seam.UsersAcs` to `seam.Acs.Users`. +4. Decide how each action-attempt call should wait; pass + `waitForActionAttempt: false` to keep v1 behavior. +5. Update `catch (SeamException)` blocks to the new exception types, and + catch `HttpRequestException` for non-Seam transport errors. +6. Replace `GlobalSeamRequestConfiguration`/`RetryConfiguration` usage with + `SeamClientOptions`. +7. Update references to `Seam.Model` types to `Seam.Models`. +8. Recompile: the compiler will point out every remaining call site. + +### New in v2 + +Nothing here requires migration, but v2 also adds: + +- **Personal access token authentication.** Authenticate as a Seam Console + user scoped to a workspace, and use `SeamWithoutWorkspaceClient` to list and + create workspaces before having one in scope: + + ```csharp + var seam = SeamClient.FromPersonalAccessToken("YOUR_PAT", "YOUR_WORKSPACE_ID"); + + var console = new SeamWithoutWorkspaceClient(personalAccessToken: "YOUR_PAT"); + var workspaces = await console.Workspaces.ListAsync(); + ``` + +- **Environment-based configuration.** With no options, the client reads + `SEAM_API_KEY` or `SEAM_PERSONAL_ACCESS_TOKEN` plus `SEAM_WORKSPACE_ID`, and + the endpoint from `SEAM_ENDPOINT`: `var seam = new SeamClient();` + +- **Token format validation.** Passing the wrong kind of token (a client + session token as an API key, an API key as a personal access token, ...) + raises a specific `SeamInvalidTokenException` at construction instead of an + opaque 401 from the server. + +- **Pagination.** Paginated endpoints offer a `ListPager` returning a + `SeamPaginator` with `FirstPageAsync`/`NextPageAsync`, `FlattenToListAsync`, + and lazy `IAsyncEnumerable` iteration: + + ```csharp + await foreach (var device in seam.Devices.ListPager(new() { Limit = 20 }).Flatten()) + Console.WriteLine(device.DeviceId); + ``` + +- **Cancellation.** Every endpoint method takes a `CancellationToken`, + threaded through retries, timeouts, and action attempt polling. + +- **Automatic retries.** Idempotent requests retry transient failures with + exponential backoff (see + [the retry section](#requests-are-retried-and-time-out-per-attempt)). + +- **Webhook verification.** `SeamWebhook` verifies an incoming webhook + signature and parses the payload into the typed `Event` union: + + ```csharp + var seamEvent = new SeamWebhook(secret).Verify(requestBody, requestHeaders); + ``` + +- **SDK identification headers.** Every request carries `seam-sdk-name` and + `seam-sdk-version`, so Seam support can identify the SDK from the + `seam-request-id` of a failing request. diff --git a/README.md b/README.md index f1c18324..3cf7162f 100644 --- a/README.md +++ b/README.md @@ -4,217 +4,257 @@ SDK for the Seam API written in C#. +Upgrading from v1? See [MIGRATION.md](./MIGRATION.md). + ## Installation Use [NuGet](https://www.nuget.org/packages/Seam) to install. +``` +dotnet add package Seam +``` + ## Usage ```csharp -using Seam.Client; +using Seam; -var seam = new SeamClient(apiToken: "YOUR_API_KEY"); +var seam = new SeamClient(apiKey: "YOUR_API_KEY"); -var myDevices = seam.Devices.List(); +var devices = await seam.Devices.ListAsync(); -Console.WriteLine("First Device Name: " + myDevices[0].Properties.Name); +Console.WriteLine($"First device: {devices[0].DisplayName}"); -var accessCode = seam.AccessCodes.Create(deviceId: myDevices[0].DeviceId, code: "1234"); +var device = await seam.Locks.GetAsync(new() { DeviceId = devices[0].DeviceId }); ``` -### Setting a value to null +Endpoint methods are async, take a single request object, and accept a +`CancellationToken`. Required parameters are `required` members of the request +object, so a missing one is a compile error rather than a server round trip. +Request objects are always constructed with named properties (typically via a +target-typed `new()`), so adding or reordering API parameters never breaks +your code. -The Seam API distinguishes three states for an updatable parameter: -omitted (leave the stored value unchanged), null (unset the stored value), -and a value (set it). +### Authentication -C#'s `null` means omitted. -The SDK removes `null` parameters from the request entirely, -so passing `null` never unsets a value. -To unset a value, pass the `Null.Value` sentinel, -which the SDK sends as JSON `null` in request bodies -and as an empty value in query strings: +Authenticate with an API key, which is scoped to a single workspace: ```csharp -// Omits custom_metadata, leaving the stored metadata unchanged. -seam.Devices.Update(deviceId: deviceId, customMetadata: null); - -// Unsets the sync key of the stored metadata. -seam.Devices.Update( - deviceId: deviceId, - customMetadata: new Dictionary { ["sync"] = Null.Value } -); +var seam = new SeamClient(apiKey: "YOUR_API_KEY"); +// or +var seam = SeamClient.FromApiKey("YOUR_API_KEY"); ``` -Only pass `Null.Value` where the Seam API documents a value as nullable. -A parameter typed as a specific C# type, e.g. `string?`, does not accept the -sentinel: pass it wherever a parameter is typed `object`, and to the URL search -params serializer below. - -## Advanced Usage - -### Setting the request timeout - -Requests time out after 30 seconds by default. -Pass the `timeout` option, in milliseconds, to override this: +Or with a personal access token and the workspace it acts on: ```csharp -var seam = new SeamClient(apiToken: "YOUR_API_KEY", timeout: 60000); +var seam = SeamClient.FromPersonalAccessToken("YOUR_PAT", "YOUR_WORKSPACE_ID"); ``` -The default may also be changed for every client at once: +When no credential is passed, the client reads `SEAM_API_KEY` or +`SEAM_PERSONAL_ACCESS_TOKEN` plus `SEAM_WORKSPACE_ID` from the environment, +and the endpoint falls back to `SEAM_ENDPOINT`: ```csharp -GlobalSeamRequestConfiguration.Instance.Timeout = 60000; +var seam = new SeamClient(); ``` -### Serializing URL search params - -The Seam API parses URL search params as complex types. -The SDK serializes the params of every endpoint -the Seam API prefers to receive as a GET or DELETE this way. -If you call the API with your own HTTP client, -`StrictUrlSearchParamsSerializer` is exported for that purpose. -The `_strict=true` parameter is added to any non-empty query -so the Seam API uses strict, schema-aware parsing. -A query with no serializable parameters remains empty. +To list and create workspaces before having one in scope, use the +workspace-less client: ```csharp -using Seam.Client; +var seam = new SeamWithoutWorkspaceClient(personalAccessToken: "YOUR_PAT"); +var workspaces = await seam.Workspaces.ListAsync(); +``` -var query = StrictUrlSearchParamsSerializer.Serialize( - new Dictionary { ["device_ids"] = new[] { "device1", "device2" } } -); +### Action attempts -using var client = new HttpClient(); -client.DefaultRequestHeaders.Add("Authorization", "Bearer your-api-key"); +Some endpoints, e.g. unlocking a door, return an action attempt tracking the +requested action. By default, the SDK polls the action attempt until it +succeeds and returns the finished attempt, raising +`SeamActionAttemptFailedException` when it fails and +`SeamActionAttemptTimeoutException` when it is still pending after 10 seconds: -var devices = await client.GetStringAsync($"https://connect.getseam.com/devices/list?{query}"); +```csharp +var actionAttempt = await seam.Locks.UnlockDoorAsync(new() { DeviceId = deviceId }); ``` -The serialization defines the name and value of each search param, -where every value is a string. -`UrlSearchParams` holds those pairs and renders the query string, -as [URLSearchParams] does for the [reference implementation]: +Configure or disable waiting per client or per call with `ActionAttemptWait`: ```csharp -using Seam.Client; - -var searchParams = new UrlSearchParams(); - -StrictUrlSearchParamsSerializer.Update( - searchParams, - new Dictionary { ["device_ids"] = new[] { "device1", "device2" } } +// Do not wait: get the pending action attempt back immediately. +var seam = new SeamClient(new SeamClientOptions +{ + ApiKey = "YOUR_API_KEY", + WaitForActionAttempt = false, +}); + +// Wait longer for this one call. +var actionAttempt = await seam.Locks.UnlockDoorAsync( + new() { DeviceId = deviceId }, + waitForActionAttempt: new ActionAttemptWait + { + Timeout = TimeSpan.FromSeconds(30), + PollingInterval = TimeSpan.FromSeconds(2), + } ); +``` + +### Pagination -searchParams.Select(pair => (pair.Key, pair.Value)).ToList(); -// => [("device_ids", "device1"), ("device_ids", "device2"), ("_strict", "true")] +Every paginated list endpoint offers a `ListPager` returning a +`SeamPaginator`: -searchParams.ToString(); -// => "device_ids=device1&device_ids=device2&_strict=true" +```csharp +var pages = seam.Devices.ListPager(new() { Limit = 20 }); + +// Iterate every item lazily. +await foreach (var device in pages.Flatten()) +{ + Console.WriteLine(device.DeviceId); +} + +// Or fetch pages by hand. +var (devices, pagination) = await pages.FirstPageAsync(); +if (pagination.HasNextPage) +{ + var (moreDevices, _) = await pages.NextPageAsync(pagination.NextPageCursor!); +} + +// Or collect everything into one list. +var allDevices = await pages.FlattenToListAsync(); ``` -Pass either the query string or the pairs to your HTTP client. -A client may percent-encode a few characters differently -than `URLSearchParams` does, -which the Seam API reads as the same params either way. +To resume pagination later, store `pagination.NextPageCursor` and pass it to +`NextPageAsync` on a new pager with the same request parameters. -A parameter set to `null` is omitted, -while a parameter set to `Null.Value` is serialized to an empty value, -which the Seam API reads as null, -as described in [Setting a value to null](#setting-a-value-to-null). -A parameter that cannot be represented throws an `UnserializableParamError`. +### Errors -The Seam API parses these params with the corresponding [parser]. +Seam API errors raise a typed exception carrying the Seam error code, HTTP +status code, and the `seam-request-id` to include in support requests: -[URLSearchParams]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams -[reference implementation]: https://github.com/seamapi/url-search-params-serializer -[parser]: https://github.com/seamapi/url-search-params-parser +```csharp +try +{ + await seam.Devices.GetAsync(new() { DeviceId = deviceId }); +} +catch (SeamHttpInvalidInputException exception) +{ + foreach (var message in exception.GetValidationErrorMessages("device_id")) + Console.WriteLine(message); +} +catch (SeamHttpUnauthorizedException) +{ + // Invalid or expired credentials. +} +catch (SeamHttpApiException exception) +{ + Console.WriteLine($"{exception.Code} ({exception.RequestId})"); +} +``` -## Development and Testing +Every SDK exception derives from `SeamException`. A response that is not a +Seam error, e.g. from a gateway, surfaces as the standard +`HttpRequestException`. -### Quickstart +### Retries and timeouts -Install the [.NET SDK](https://dotnet.microsoft.com/download) 10.0 or later, -[just](https://just.systems/) and [Node.js](https://nodejs.org/), then run +Idempotent requests are retried twice on transport errors, timeouts, 429, and +5xx responses with exponential backoff, honoring `Retry-After`. POST and PATCH +requests are never retried, so a retry can never duplicate a write. Each +attempt times out after 30 seconds. Both are configurable: +```csharp +var seam = new SeamClient(new SeamClientOptions +{ + ApiKey = "YOUR_API_KEY", + MaxRetries = 0, + Timeout = TimeSpan.FromSeconds(60), +}); ``` -$ git clone git@github.com:seamapi/csharp.git -$ cd csharp -$ npm install -$ dotnet tool restore -``` -Primary development tasks are defined in the `justfile` -and available via `just`. -View them with +### Setting a value to null + +The Seam API distinguishes three states for an updatable parameter: omitted +(leave the stored value unchanged), null (unset the stored value), and a value +(set it). C#'s `null` means omitted; the SDK removes `null` parameters from +the request entirely. Where the Seam API documents a parameter as nullable, +the request property is an `Optional` that also accepts the explicit +`Null.Value` sentinel: -``` -$ just --list +```csharp +// Omits every optional parameter, leaving stored values unchanged. +await seam.Thermostats.UpdateAsync(new() { DeviceId = deviceId }); + +// Unsets the sync key of the stored custom metadata. +await seam.Devices.UpdateAsync(new() +{ + DeviceId = deviceId, + CustomMetadata = new Dictionary { ["sync"] = Null.Value }, +}); ``` -| Task | Command | -| ----------------- | ------------------ | -| Run the tests | `just test` | -| Lint | `just lint` | -| Format | `just format` | -| Build the package | `just build` | -| Generate the SDK | `npm run generate` | +### Webhooks -The npm scripts only drive the codegen layer: `npm run generate` -regenerates the SDK, and `npm run lint` and `npm run format` cover the -TypeScript, JSON, YAML and Markdown sources with ESLint and -[Prettier](https://prettier.io/). -C# sources are formatted by [CSharpier](https://csharpier.com/), -pinned as a local dotnet tool in `.config/dotnet-tools.json`. +Verify and parse incoming Seam webhook events with `SeamWebhook`: -Run the full suite with +```csharp +var webhook = new SeamWebhook(Environment.GetEnvironmentVariable("SEAM_WEBHOOK_SECRET")!); -``` -$ just test +var seamEvent = webhook.Verify(requestBody, requestHeaders); + +if (seamEvent is Seam.Models.EventDeviceConnected connected) + Console.WriteLine(connected.DeviceId); ``` -To run the tests for a single target framework, pass it as an argument +## Advanced usage -``` -$ just test net8.0 -``` +### Calling the API directly -### Requirements +The `HttpClient` the SDK sends requests with is exposed as `seam.Client`, +fully configured with the endpoint, authorization, retries, and timeouts: -The package targets .NET 8.0 and .NET 10.0, the supported LTS releases. -Continuous integration exercises both target frameworks. +```csharp +var response = await seam.Client.GetAsync("/devices/list"); +``` -### Publishing +To supply your own fully configured client instead, use +`SeamClient.FromHttpClient`, or pass an `HttpMessageHandler` to replace only +the innermost transport while keeping the SDK's pipeline: -#### Automatic +```csharp +var seam = new SeamClient(new SeamClientOptions +{ + ApiKey = "YOUR_API_KEY", + HttpMessageHandler = myHandler, +}); +``` -New versions are released automatically from `main` by the -[Semantic Release](.github/workflows/semantic-release.yml) workflow, -which reads [Conventional Commits](https://www.conventionalcommits.org/) -and dispatches the [Version](.github/workflows/version.yml) workflow. +### Serializing URL search params -#### Manual +The Seam API parses URL search params as complex types. The SDK serializes +the params of every endpoint the Seam API prefers to receive as a GET or +DELETE this way. If you call the API with your own HTTP client, +`StrictUrlSearchParamsSerializer` is exported for that purpose. The +`_strict=true` parameter is added to any non-empty query so the Seam API uses +strict, schema-aware parsing. -Run the [Version](.github/workflows/version.yml) workflow with the -version to cut. -It runs `npm version`, which bumps the `version` field in `package.json`, -injects that version into `Seam.csproj`, creates a signed `v*` git tag -and pushes it. -Pushing the tag triggers the [Publish](.github/workflows/publish.yml) -workflow, which packs the library with `dotnet pack` and pushes the -package to [NuGet](https://www.nuget.org/packages/Seam) and GitHub -Packages. +```csharp +var query = StrictUrlSearchParamsSerializer.Serialize( + new Dictionary { ["device_ids"] = new[] { "a", "b" } } +); +``` + +## Development and testing -> The version lives in `package.json`, the development manifest that -> drives the codegen. -> `version.ts`, wired to the `version` lifecycle script, injects it -> into the `` element of `Seam.csproj`, which npm runs after the -> bump but before the commit, so the updated project file is part of the -> tagged commit and MSBuild surfaces the version at runtime through -> `AssemblyInformationalVersionAttribute`. -> Never edit the version in `Seam.csproj` by hand. +Quickly run all tests with -## License +``` +just test +``` -This C# SDK is licensed under the [MIT license](LICENSE.txt). +The tests run against [@seamapi/fake-seam-connect](https://github.com/seamapi/fake-seam-connect); +run `npm install` first. Generated code under `src/Seam/Routes` and +`src/Seam/Models` is produced by `npm run generate` from +[@seamapi/types](https://github.com/seamapi/types) and must not be edited by +hand. diff --git a/codegen/layouts/api.hbs b/codegen/layouts/api.hbs deleted file mode 100644 index 3d6b46a5..00000000 --- a/codegen/layouts/api.hbs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ -public class {{className}} -{ -private ISeamClient _seam; - -public {{className}}(ISeamClient seam) -{ -_seam = seam; -} -{{#each routes}} - -{{> model-class request}} -{{#each requestSiblings}} - -{{> model-class this}} -{{/each}} -{{#if response}} - -{{> model-class response}} -{{/if}} -{{#each responseSiblings}} - -{{> model-class this}} -{{/each}} - -{{> route-methods this}} -{{/each}} -} -} - -namespace Seam.Client -{ -public partial class SeamClient -{ -public Api.{{className}} {{className}} => new(this); -} - -public partial interface ISeamClient -{ -public Api.{{className}} {{className}} { get; } -} -} diff --git a/codegen/layouts/client-routes.hbs b/codegen/layouts/client-routes.hbs new file mode 100644 index 00000000..35e6e7ac --- /dev/null +++ b/codegen/layouts/client-routes.hbs @@ -0,0 +1,16 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +namespace Seam +{ +public sealed partial class SeamClient +{ +{{#each roots}} +private Routes.{{className}}? _{{fieldName}}; + +/// The {{propertyName}} route client. +public Routes.{{className}} {{propertyName}} => _{{fieldName}} ??= new(Transport, WaitForActionAttemptDefault); +{{/each}} +} +} diff --git a/codegen/layouts/model.hbs b/codegen/layouts/model.hbs index d4b507d2..a90e6539 100644 --- a/codegen/layouts/model.hbs +++ b/codegen/layouts/model.hbs @@ -1,12 +1,13 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; +using System.Text.Json; +using System.Text.Json.Serialization; -namespace Seam.Model +namespace Seam.Models { {{#each decls}} {{#if (eq kind "union")}} diff --git a/codegen/layouts/partials/data-member.hbs b/codegen/layouts/partials/data-member.hbs index 1399462d..c6f41d40 100644 --- a/codegen/layouts/partials/data-member.hbs +++ b/codegen/layouts/partials/data-member.hbs @@ -1,3 +1,3 @@ {{> documentation}} -[DataMember(Name = "{{snakeName}}", IsRequired = {{isRequired}}, EmitDefaultValue = false)] -public {{#if isOverride}}override {{/if}}{{type}} {{pascalName}} {{#if getOnly}}{ get; }{{else}}{ get; set; }{{/if}}{{#if initializer}} = {{initializer}};{{/if}} +[JsonPropertyName("{{snakeName}}")] +public {{#if isOverride}}override {{/if}}{{#if isRequired}}required {{/if}}{{type}} {{pascalName}} {{#if getOnly}}{ get; }{{else}}{ get; init; }{{/if}}{{#if initializer}} = {{initializer}};{{/if}} diff --git a/codegen/layouts/partials/enum-def.hbs b/codegen/layouts/partials/enum-def.hbs index 65f98405..37152941 100644 --- a/codegen/layouts/partials/enum-def.hbs +++ b/codegen/layouts/partials/enum-def.hbs @@ -1,6 +1,6 @@ {{> documentation}} {{#if isString}} -[JsonConverter(typeof(SafeStringEnumConverter))] +[JsonConverter(typeof(SeamStringEnumConverter))] {{/if}} public enum {{name}} { diff --git a/codegen/layouts/partials/model-class.hbs b/codegen/layouts/partials/model-class.hbs index c94a209b..acdded98 100644 --- a/codegen/layouts/partials/model-class.hbs +++ b/codegen/layouts/partials/model-class.hbs @@ -1,30 +1,36 @@ {{> documentation}} -[DataContract(Name = "{{dataContractName}}")] -public class {{className}}{{#if baseClass}} : {{baseClass}}{{/if}} +public sealed record {{className}}{{#if baseClass}} : {{baseClass}}{{#if isUnrecognizedFallback}}, ISeamUnrecognizedVariant{{/if}}{{/if}} { -[JsonConstructorAttribute] -{{#if properties.length}}protected{{else}}public{{/if}} {{className}}() { } -{{#if properties.length}} - -public {{className}}({{csParams properties}}) -{ -{{#each properties}} -{{pascalName}} = {{camelName}}; -{{/each}} -} -{{/if}} {{#each nested}} - {{#if enum}} {{> enum-def enum}} {{else}} {{> oneof-union union}} {{/if}} + {{/each}} {{#each properties}} - {{> data-member this}} +{{#unless @last}} + +{{/unless}} {{/each}} +{{#if isUnrecognizedFallback}} + +/// The complete raw JSON of the unrecognized payload. +[JsonIgnore] +public JsonElement RawJson { get; set; } +{{/if}} +{{#if requireAnyOf}} -{{> tostring}} +internal void Validate() +{ +if ({{#each requireAnyOf.conditions}}{{this}}{{#unless @last}} && {{/unless}}{{/each}}) +{ +throw new ArgumentException( +"At least one parameter is required for {{requireAnyOf.path}}" +); +} +} +{{/if}} } diff --git a/codegen/layouts/partials/oneof-union.hbs b/codegen/layouts/partials/oneof-union.hbs index 0ca5ee0c..07c0ba98 100644 --- a/codegen/layouts/partials/oneof-union.hbs +++ b/codegen/layouts/partials/oneof-union.hbs @@ -1,15 +1,17 @@ -[JsonConverter(typeof(JsonSubtypes), "{{discriminatorSnake}}")] -[JsonSubtypes.FallBackSubType(typeof({{unrecognizedTypeName}}))] +[JsonConverter(typeof(SeamUnionConverter))] +[SeamUnion("{{discriminatorSnake}}")] {{#each knownSubTypes}} -[JsonSubtypes.KnownSubType(typeof({{typeName}}), "{{value}}")] +[SeamUnionVariant("{{value}}", typeof({{typeName}}))] {{/each}} -public abstract class {{className}} +[SeamUnionFallback(typeof({{unrecognizedTypeName}}))] +public abstract record {{className}} { -{{#each abstractProps}} -public abstract {{type}} {{pascalName}} {{#if getOnly}}{ get; }{{else}}{ get; set; }{{/if}} +/// The value of the {{discriminatorSnake}} discriminator. +public abstract string {{discriminatorPascal}} { get; } +{{#each baseProps}} +{{> data-member this}} {{/each}} -public abstract override string ToString(); } {{#each subclasses}} diff --git a/codegen/layouts/partials/route-methods.hbs b/codegen/layouts/partials/route-methods.hbs index 068de21d..a56cb52b 100644 --- a/codegen/layouts/partials/route-methods.hbs +++ b/codegen/layouts/partials/route-methods.hbs @@ -1,43 +1,50 @@ {{> documentation}} -public {{#if isVoid}}void{{else}}{{returnType}}{{/if}} {{methodName}}({{methodName}}Request request) -{ -var requestOptions = new RequestOptions(); -requestOptions.Data = request; -{{#if isVoid}} -_seam.{{httpMethod}}("{{path}}", requestOptions); -{{else}} -return _seam.{{httpMethod}}<{{responseTypeArg}}>("{{path}}", requestOptions).EnsureData("{{path}}").{{returnProp}}; +public async {{#if isVoid}}Task{{else}}Task<{{returnType}}>{{/if}} {{methodName}}Async( +{{request.className}}{{#if requestOptional}}? request = null{{else}} request{{/if}}, +{{#if usesActionAttempt}} +ActionAttemptWait? waitForActionAttempt = null, {{/if}} -} - -{{> documentation}} -public {{#if isVoid}}void{{else}}{{returnType}}{{/if}} {{methodName}}({{csParams params}}) +CancellationToken cancellationToken = default +) { +{{#if request.requireAnyOf}} +request.Validate(); +{{/if}} {{#if isVoid}} -{{methodName}}(new {{methodName}}Request({{csNamedArgs params}})); +await _transport.SendAsync(HttpMethod.{{httpMethod}}, "{{path}}", request, cancellationToken).ConfigureAwait(false); {{else}} -return {{methodName}}(new {{methodName}}Request({{csNamedArgs params}})); +var response = await _transport.SendAsync<{{responseTypeArg}}>(HttpMethod.{{httpMethod}}, "{{path}}", request, cancellationToken).ConfigureAwait(false); +{{#if usesActionAttempt}} +var actionAttempt = response.{{returnProp}} ?? throw new HttpRequestException("Seam returned no {{returnKey}} for {{path}}"); +return await ActionAttemptResolver.ResolveAsync(actionAttempt, _transport, waitForActionAttempt ?? _waitForActionAttemptDefault, cancellationToken).ConfigureAwait(false); +{{else}} +return response.{{returnProp}} ?? throw new HttpRequestException("Seam returned no {{returnKey}} for {{path}}"); +{{/if}} {{/if}} } +{{#if usesPagination}} -{{> documentation}} -public async {{#if isVoid}}Task{{else}}Task<{{returnType}}>{{/if}} {{methodName}}Async({{methodName}}Request request) +/// Fetches one page of {{path}} with its pagination metadata. +public async Task> {{methodName}}PageAsync( +{{request.className}}{{#if requestOptional}}? request = null{{else}} request{{/if}}, +CancellationToken cancellationToken = default +) { -var requestOptions = new RequestOptions(); -requestOptions.Data = request; -{{#if isVoid}} -await _seam.{{httpMethod}}Async("{{path}}", requestOptions); -{{else}} -return (await _seam.{{httpMethod}}Async<{{responseTypeArg}}>("{{path}}", requestOptions)).EnsureData("{{path}}").{{returnProp}}; -{{/if}} +var response = await _transport.SendAsync<{{responseTypeArg}}>(HttpMethod.{{httpMethod}}, "{{path}}", request, cancellationToken).ConfigureAwait(false); +var items = response.{{returnProp}} ?? throw new HttpRequestException("Seam returned no {{returnKey}} for {{path}}"); +var pagination = response.Pagination ?? throw new HttpRequestException("Seam returned no pagination for {{path}}"); +return new SeamPage<{{pageItemType}}>(items, pagination); } -{{> documentation}} -public async {{#if isVoid}}Task{{else}}Task<{{returnType}}>{{/if}} {{methodName}}Async({{csParams params}}) +/// Creates a paginator over {{path}}. +public SeamPaginator<{{pageItemType}}> {{methodName}}Pager({{request.className}}{{#if requestOptional}}? request = null{{else}} request{{/if}}) { -{{#if isVoid}} -await {{methodName}}Async(new {{methodName}}Request({{csNamedArgs params}})); -{{else}} -return (await {{methodName}}Async(new {{methodName}}Request({{csNamedArgs params}}))); -{{/if}} +return new SeamPaginator<{{pageItemType}}>( +(pageCursor, cancellationToken) => +{{methodName}}PageAsync( +pageCursor == null ? request : {{#if requestOptional}}(request ?? new {{request.className}}()){{else}}request{{/if}} with { PageCursor = pageCursor }, +cancellationToken +) +); } +{{/if}} diff --git a/codegen/layouts/partials/tostring.hbs b/codegen/layouts/partials/tostring.hbs deleted file mode 100644 index 245b1d0b..00000000 --- a/codegen/layouts/partials/tostring.hbs +++ /dev/null @@ -1,18 +0,0 @@ -public override string ToString() -{ -JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - -StringWriter stringWriter = new StringWriter( -new StringBuilder(256), -System.Globalization.CultureInfo.InvariantCulture -); -using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) -{ -jsonTextWriter.IndentChar = ' '; -jsonTextWriter.Indentation = 2; -jsonTextWriter.Formatting = Formatting.Indented; -jsonSerializer.Serialize(jsonTextWriter, this, null); -} - -return stringWriter.ToString(); -} diff --git a/codegen/layouts/route.hbs b/codegen/layouts/route.hbs new file mode 100644 index 00000000..01e6a9af --- /dev/null +++ b/codegen/layouts/route.hbs @@ -0,0 +1,50 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ +public sealed class {{className}} +{ +private readonly SeamHttpTransport _transport; +private readonly ActionAttemptWait _waitForActionAttemptDefault; + +internal {{className}}(SeamHttpTransport transport, ActionAttemptWait waitForActionAttemptDefault) +{ +_transport = transport; +_waitForActionAttemptDefault = waitForActionAttemptDefault; +{{#each children}} +{{propertyName}} = new {{className}}(transport, waitForActionAttemptDefault); +{{/each}} +} +{{#each children}} + +public {{className}} {{propertyName}} { get; } +{{/each}} +{{#each routes}} + +{{> model-class request}} +{{#each requestSiblings}} + +{{> model-class this}} +{{/each}} +{{#if response}} + +{{> model-class response}} +{{/if}} +{{#each responseSiblings}} + +{{> model-class this}} +{{/each}} + +{{> route-methods this}} +{{/each}} +} +} diff --git a/codegen/lib/build-model.ts b/codegen/lib/build-model.ts index d28d9fba..48cc65d1 100644 --- a/codegen/lib/build-model.ts +++ b/codegen/lib/build-model.ts @@ -2,12 +2,22 @@ // // Consumes the normalized @seamapi/blueprint and produces the plain data model // in class-model.ts. This file decides *what* classes, enums, unions, -// properties, and routes exist, their names, order, types, and nullability. All -// string serialization lives in the Handlebars layouts. +// properties, and routes exist, their names, order, types, and nullability. // // The builder depends only on the blueprint. It never reads the OpenAPI spec: // the blueprint already resolves int vs. float (Number.isInt), enum members, // inline objects, discriminated unions, and endpoint request/response shapes. +// +// Nullability model: +// +// - Response models deserialize leniently: no property is `required`, and a +// property that may be absent or null gets a nullable C# type. A property +// the schema guarantees keeps its non-nullable type with a `default!` +// initializer, since the wire value is what satisfies it. +// - Request parameters enforce the schema locally: a required parameter is a +// C# `required` member, an optional one is nullable (null means omitted), +// and a nullable one is `Optional` so an explicit JSON null +// (`Null.Value`) is distinct from omission. import type { ActionAttempt, @@ -17,10 +27,9 @@ import type { Property, Resource, } from '@seamapi/blueprint' -import { camelCase, pascalCase, snakeCase } from 'change-case' +import { pascalCase, snakeCase } from 'change-case' import type { - CsApiFile, CsClass, CsEnum, CsModelFile, @@ -29,38 +38,10 @@ import type { CsRoute, CsUnion, } from './class-model.js' -import { GLOBAL_NAMESPACE } from './constants.js' - -const MODEL_NAMESPACE = [...GLOBAL_NAMESPACE, 'Model'] - -// C# reserved identifiers cannot be used verbatim as camelCase parameter or -// local names. `override` is renamed and `event` is suffixed to keep the -// generated argument names legal. -const reservedKeywordMap: Record = { override: 'mustOverride' } -const RESERVED_TOKENS = ['event'] - -const applyReserved = (token: string): string => - RESERVED_TOKENS.includes(token) ? `${token}_` : token - -const camelIdentifier = (name: string): string => - applyReserved(reservedKeywordMap[camelCase(name)] ?? camelCase(name)) const withNullable = (type: string, nullable: boolean): string => nullable ? `${type}?` : type -const dataContractName = ( - className: string, - resourceType: 'response' | 'request' | 'model', - namespace?: string[], -): string => - [ - ...(namespace != null && namespace.length > 0 - ? [camelCase(namespace.join('_'))] - : []), - camelCase(className), - resourceType, - ].join('_') - const safeWrapEnumValue = (value: string): string => { if (!value) return 'empty' const code = value.charCodeAt(0) @@ -99,7 +80,7 @@ interface Field { description: string deprecationMessage?: string isRequired: boolean - nullable: boolean + isNullable: boolean kind: Kind } @@ -185,10 +166,8 @@ const normalizeItemKind = (property: Property): Kind => { } const normalizeProperty = (property: Property): Field => { - // Response models deserialize leniently: `IsRequired` stays false so a - // payload that omits a field (as real responses and partial fixtures do) - // never throws. `isOptional` and `isNullable` instead widen the C# type to - // nullable, so a value that may be absent or null is representable. + // Model properties: `isRequired` stays false so deserialization is lenient; + // `isNullable` widens the C# type when the schema allows absence or null. const base = { name: property.name, description: property.description, @@ -196,7 +175,7 @@ const normalizeProperty = (property: Property): Field => { ? { deprecationMessage: property.deprecationMessage || 'Deprecated.' } : {}), isRequired: false, - nullable: property.isNullable || property.isOptional, + isNullable: property.isNullable || property.isOptional, } switch (property.format) { case 'string': @@ -275,7 +254,6 @@ const normalizeParameterItemKind = (parameter: Parameter): Kind => { } const normalizeParameter = (parameter: Parameter): Field => { - // Endpoint parameters carry `isRequired`; optional parameters become nullable. const base = { name: parameter.name, description: parameter.description, @@ -283,7 +261,7 @@ const normalizeParameter = (parameter: Parameter): Field => { ? { deprecationMessage: parameter.deprecationMessage || 'Deprecated.' } : {}), isRequired: parameter.isRequired, - nullable: !parameter.isRequired, + isNullable: parameter.isNullable, } switch (parameter.format) { case 'string': @@ -323,13 +301,14 @@ const normalizeParameter = (parameter: Parameter): Field => { } interface BuildClassOptions { + // Requests enforce the schema locally (required members, Optional for + // nullable parameters); models deserialize leniently. resourceType: 'response' | 'request' | 'model' - namespace?: string[] | undefined // When set, the class is a discriminated-union subclass: the discriminator // property is emitted as a get-only override with a constant value. discriminator?: { name: string; value: string; base: string } - // Property names lifted onto the union's abstract base; emitted as overrides. - overrideNames?: Set | undefined + // Field names declared concretely on the union base; omitted from subclasses. + omitNames?: Set | undefined documentation?: string obsoleteMessage?: string } @@ -341,6 +320,12 @@ interface BuiltClass { properties: CsProperty[] } +// Whether a C# type needs a `default!` initializer to satisfy non-nullable +// analysis when the wire value is what actually assigns it. Value types are +// self-satisfying but `default!` is harmless and uniform. +const lenientInitializer = (type: string): string | undefined => + type.endsWith('?') ? undefined : 'default!' + const buildClass = ( className: string, fields: Field[], @@ -348,9 +333,8 @@ const buildClass = ( ): BuiltClass => { const { resourceType, - namespace, discriminator, - overrideNames, + omitNames, documentation, obsoleteMessage, } = options @@ -363,15 +347,16 @@ const buildClass = ( nestedByKey.set(key, value) } - const csType = ( + // The core (non-nullable) C# type of a field, declaring any nested enum, + // union, or sibling class it needs. + const coreType = ( kind: Kind, fieldName: string, - nullable: boolean, documentation?: string, ): string => { switch (kind.t) { case 'prim': - return withNullable(kind.cs, nullable) + return kind.cs case 'ref': return kind.cs case 'enum': { @@ -380,79 +365,86 @@ const buildClass = ( ...(documentation != null ? { documentation } : {}), } setNested(csEnum.name, { enum: csEnum }) - return withNullable(`${className}.${csEnum.name}`, nullable) + return `${className}.${csEnum.name}` } case 'object': { const childName = pascalCase(className + pascalCase(fieldName)) const built = buildClass(childName, kind.fields, { - resourceType: 'model', - namespace, + resourceType: resourceType === 'request' ? 'request' : 'model', }) siblings.push(built.main, ...built.siblings) - return withNullable(childName, nullable) + return childName } case 'list': - return withNullable( - `List<${csType(kind.item, fieldName, false, documentation)}>`, - nullable, - ) + return `List<${coreType(kind.item, fieldName, documentation)}>` case 'union': { const unionName = pascalCase(className + pascalCase(fieldName)) const union = buildUnion(unionName, kind.discriminator, kind.variants, { resourceType, - namespace, }) setNested(unionName, { union }) - return withNullable(unionName, nullable) + return unionName } } } - const overrideProperty = (name: string, value: string): CsProperty => ({ - pascalName: pascalCase(name), - camelName: camelIdentifier(name), - snakeName: snakeCase(name), - type: 'string', - isRequired: true, - isOverride: true, - getOnly: true, - initializer: `"${value}"`, - }) + const mapField = (field: Field): CsProperty => { + const core = coreType(field.kind, field.name, field.description) + + let type: string + let isRequired = false + let initializer: string | undefined + + if (resourceType === 'request') { + // Optionality composes with nullability rather than replacing it: an + // optional parameter is omitted by leaving it null (or unset), while + // only a nullable parameter accepts an explicit Null.Value. + type = field.isNullable ? `Optional<${core}>` : core + isRequired = field.isRequired + if (!field.isRequired && !field.isNullable) { + type = withNullable(type, true) + } + } else { + type = withNullable(core, field.isNullable) + initializer = lenientInitializer(type) + } - const mapField = (field: Field): CsProperty => ({ - pascalName: pascalCase(field.name), - camelName: camelIdentifier(field.name), - snakeName: snakeCase(field.name), - type: csType(field.kind, field.name, field.nullable, field.description), - isRequired: field.isRequired, - isOverride: overrideNames?.has(field.name) ?? false, - getOnly: false, - documentation: field.description, - ...(field.deprecationMessage != null - ? { obsoleteMessage: field.deprecationMessage } - : {}), - }) + return { + pascalName: pascalCase(field.name), + snakeName: snakeCase(field.name), + type, + isRequired, + isOverride: false, + getOnly: false, + ...(initializer != null ? { initializer } : {}), + documentation: field.description, + ...(field.deprecationMessage != null + ? { obsoleteMessage: field.deprecationMessage } + : {}), + } + } const properties: CsProperty[] = [] - let emittedDiscriminator = false for (const field of fields) { - if (discriminator != null && field.name === discriminator.name) { - properties.push(overrideProperty(discriminator.name, discriminator.value)) - emittedDiscriminator = true - continue - } + if (field.name === discriminator?.name) continue + if (omitNames?.has(field.name) ?? false) continue properties.push(mapField(field)) } - if (discriminator != null && !emittedDiscriminator) { - properties.unshift( - overrideProperty(discriminator.name, discriminator.value), - ) + if (discriminator != null) { + properties.unshift({ + pascalName: pascalCase(discriminator.name), + snakeName: snakeCase(discriminator.name), + type: 'string', + isRequired: false, + isOverride: true, + getOnly: true, + initializer: `"${discriminator.value}"`, + }) } const main: CsClass = { kind: 'class', className, - dataContractName: dataContractName(className, resourceType, namespace), ...(discriminator != null ? { baseClass: discriminator.base } : {}), nested, properties, @@ -463,29 +455,39 @@ const buildClass = ( return { main, siblings, properties } } +interface BuildUnionOptions { + resourceType: 'response' | 'request' | 'model' + // Field names removed from every variant in favor of `extraBaseProps` + // declared on the base with a shared type, e.g. the action attempt + // status/error contract the runtime resolver depends on. + omitFieldNames?: string[] + extraBaseProps?: CsProperty[] +} + const buildUnion = ( className: string, discriminator: string, variants: Variant[], - options: { - resourceType: 'response' | 'request' | 'model' - namespace?: string[] | undefined - }, + options: BuildUnionOptions, ): CsUnion => { - const { resourceType, namespace } = options + const { resourceType, omitFieldNames = [], extraBaseProps = [] } = options + const omitted = new Set(omitFieldNames) - // Lift properties shared by every variant onto the abstract base so consumers - // can read them polymorphically without downcasting. Only primitive-typed + // Lift properties shared by every variant onto the base so consumers can + // read them polymorphically without downcasting. Only primitive-typed // properties with an identical resolved C# type across all variants qualify // (enum/object/list types are owned by a specific subclass and cannot be - // shared). The discriminator is lifted separately as a get-only override. + // shared). Lifted properties are declared concretely on the base and + // omitted from the subclasses, which inherit them. const primType = (field: Field): string | null => - field.kind.t === 'prim' ? withNullable(field.kind.cs, field.nullable) : null + field.kind.t === 'prim' + ? withNullable(field.kind.cs, field.isNullable) + : null const byName = new Map() for (const variant of variants) { for (const field of variant.fields) { - if (field.name === discriminator) continue + if (field.name === discriminator || omitted.has(field.name)) continue byName.set(field.name, [...(byName.get(field.name) ?? []), field]) } } @@ -499,7 +501,32 @@ const buildUnion = ( byName.get(field.name)?.every((f) => primType(f) === type) ) }) - const overrideNames = new Set(liftedFields.map((f) => f.name)) + const omitNames = new Set([ + ...liftedFields.map((f) => f.name), + ...omitFieldNames, + ]) + + const baseProps: CsProperty[] = [ + ...liftedFields.map((field): CsProperty => { + const type = primType(field) as string + return { + pascalName: pascalCase(field.name), + snakeName: snakeCase(field.name), + type, + isRequired: false, + isOverride: false, + getOnly: false, + ...(lenientInitializer(type) != null + ? { initializer: lenientInitializer(type) as string } + : {}), + documentation: field.description, + ...(field.deprecationMessage != null + ? { obsoleteMessage: field.deprecationMessage } + : {}), + } + }), + ...extraBaseProps, + ] const subclasses: CsClass[] = [] const known: Array<[string, string]> = [] @@ -508,13 +535,12 @@ const buildUnion = ( const subName = pascalCase(className + pascalCase(variant.value)) const built = buildClass(subName, variant.fields, { resourceType, - namespace, discriminator: { name: discriminator, value: variant.value, base: className, }, - overrideNames, + omitNames, ...(variant.description != null ? { documentation: variant.description } : {}), @@ -527,43 +553,26 @@ const buildUnion = ( } const unrecognizedTypeName = `${className}Unrecognized` - const fallback = buildClass( - unrecognizedTypeName, - // The fallback carries the lifted properties so it satisfies the abstract - // base; they are optional since an unrecognized payload may omit them. - liftedFields.map((field) => ({ ...field, isRequired: false })), - { - resourceType, - namespace, - discriminator: { - name: discriminator, - value: 'unrecognized', - base: className, - }, - overrideNames, + const fallback = buildClass(unrecognizedTypeName, [], { + resourceType, + discriminator: { + name: discriminator, + value: 'unrecognized', + base: className, }, - ) - subclasses.push(fallback.main, ...fallback.siblings) + }) + subclasses.push({ ...fallback.main, isUnrecognizedFallback: true }) - // The KnownSubType attribute order is the reverse of subclass definition order. - const knownSubTypes = [...known] - .reverse() - .map(([typeName, value]) => ({ typeName, value })) + const knownSubTypes = known.map(([typeName, value]) => ({ typeName, value })) return { kind: 'union', className, discriminatorSnake: discriminator, + discriminatorPascal: pascalCase(discriminator), knownSubTypes, unrecognizedTypeName, - abstractProps: [ - { type: 'string', pascalName: pascalCase(discriminator), getOnly: true }, - ...liftedFields.map((field) => ({ - type: primType(field) as string, - pascalName: pascalCase(field.name), - getOnly: false, - })), - ], + baseProps, subclasses, } } @@ -574,7 +583,6 @@ export const buildModelFile = ( const name = pascalCase(resource.resourceType) const built = buildClass(name, resource.properties.map(normalizeProperty), { resourceType: 'model', - namespace: MODEL_NAMESPACE, documentation: resource.description, ...(resource.isDeprecated ? { obsoleteMessage: resource.deprecationMessage || 'Deprecated.' } @@ -583,22 +591,13 @@ export const buildModelFile = ( return { name, file: { decls: [built.main, ...built.siblings] } } } -const buildUnionModelFile = ( - name: string, - discriminator: string, - variants: Variant[], -): { name: string; file: CsModelFile } => { - const union = buildUnion(name, discriminator, variants, { - resourceType: 'model', - namespace: MODEL_NAMESPACE, - }) - return { name, file: { decls: [union] } } -} - export const buildActionAttemptFile = ( actionAttempts: ActionAttempt[], -): { name: string; file: CsModelFile } => - buildUnionModelFile( +): { name: string; file: CsModelFile } => { + // The status and error of every action attempt share one wire shape, so they + // are declared once on the base with the runtime-owned ActionAttemptStatus + // and ActionAttemptError types the action attempt resolver depends on. + const union = buildUnion( 'ActionAttempt', 'action_type', actionAttempts.map((actionAttempt) => ({ @@ -612,12 +611,38 @@ export const buildActionAttemptFile = ( } : {}), })), + { + resourceType: 'model', + omitFieldNames: ['status', 'error'], + extraBaseProps: [ + { + pascalName: 'Status', + snakeName: 'status', + type: 'ActionAttemptStatus', + isRequired: false, + isOverride: false, + getOnly: false, + documentation: 'The status of the action attempt.', + }, + { + pascalName: 'Error', + snakeName: 'error', + type: 'ActionAttemptError?', + isRequired: false, + isOverride: false, + getOnly: false, + documentation: 'The error of a failed action attempt, or null.', + }, + ], + }, ) + return { name: 'ActionAttempt', file: { decls: [union] } } +} export const buildEventFile = ( events: EventResource[], -): { name: string; file: CsModelFile } => - buildUnionModelFile( +): { name: string; file: CsModelFile } => { + const union = buildUnion( 'Event', 'event_type', events.map((event) => ({ @@ -628,20 +653,24 @@ export const buildEventFile = ( ? { deprecationMessage: event.deprecationMessage || 'Deprecated.' } : {}), })), + { resourceType: 'model' }, ) + return { name: 'Event', file: { decls: [union] } } +} // Resolves the model type for a resource reference. A reference to a type that // is not a generated model (e.g. an undocumented resource, which the blueprint -// reports as `unknown`) falls back to the untyped `object`. The batch -// find-anything endpoint is keyed by its response key, which is a model. +// reports as `unknown`) has no class to deserialize into, so the endpoint is +// generated as returning void. The batch find-anything endpoint is keyed by +// its response key, which is a model. const resolveModel = ( resourceType: string, responseKey: string, modelTypes: Set, -): string => { +): string | undefined => { if (modelTypes.has(resourceType)) return pascalCase(resourceType) if (modelTypes.has(responseKey)) return pascalCase(responseKey) - return 'object' + return undefined } // The C# type for an endpoint's return value, and the resource property name it @@ -649,7 +678,9 @@ const resolveModel = ( const responseReturn = ( response: Endpoint['response'], modelTypes: Set, -): { returnType: string; returnProp: string } | undefined => { +): + | { returnType: string; returnProp: string; model: string; isList: boolean } + | undefined => { if (response.responseType === 'void') return undefined const returnProp = pascalCase(response.responseKey) const model = resolveModel( @@ -657,93 +688,126 @@ const responseReturn = ( response.responseKey, modelTypes, ) - const returnType = - response.responseType === 'resource_list' ? `List<${model}>` : model - return { returnType, returnProp } + if (model == null) return undefined + const isList = response.responseType === 'resource_list' + const returnType = isList ? `List<${model}>` : model + return { returnType, returnProp, model, isList } } -export const buildApiFile = ( - className: string, - endpoints: Endpoint[], +// The C# condition under which a request property counts as not given, for +// the require-any-of validation of "at least one parameter" endpoints. +const notGivenCondition = (property: CsProperty): string => + property.type.startsWith('Optional<') + ? `!${property.pascalName}.IsSet` + : `${property.pascalName} == null` + +export const buildRoute = ( + endpoint: Endpoint, modelTypes: Set, -): CsApiFile => { - const routes: CsRoute[] = endpoints.map((endpoint) => { - const methodName = pascalCase(endpoint.name) - const httpMethod = pascalCase(endpoint.request.preferredMethod) - - const request = buildClass( - pascalCase(`${endpoint.name}_request`), - endpoint.request.parameters.map(normalizeParameter), - { - resourceType: 'request', - documentation: `Request parameters for ${endpoint.title}.`, - ...(endpoint.isDeprecated - ? { obsoleteMessage: endpoint.deprecationMessage || 'Deprecated.' } - : {}), - }, - ) +): CsRoute => { + const methodName = pascalCase(endpoint.name) + const httpMethod = pascalCase(endpoint.request.preferredMethod) - const routeDocumentation = { - documentation: endpoint.description, + const request = buildClass( + pascalCase(`${endpoint.name}_request`), + endpoint.request.parameters.map(normalizeParameter), + { + resourceType: 'request', + documentation: `Request parameters for ${endpoint.title}.`, ...(endpoint.isDeprecated ? { obsoleteMessage: endpoint.deprecationMessage || 'Deprecated.' } : {}), + }, + ) + + // An endpoint that requires parameters without any individual parameter + // being required needs at least one of them, checked locally before the + // request is sent. + const requiresAnyParameter = + endpoint.request.hasRequiredParameters && + endpoint.request.parameters.every((parameter) => !parameter.isRequired) + if (requiresAnyParameter) { + request.main.requireAnyOf = { + path: endpoint.path, + conditions: request.properties.map(notGivenCondition), } + } - const returned = responseReturn(endpoint.response, modelTypes) - const isVoid = returned == null + // The request object is only optional when the endpoint requires nothing. + const requestOptional = !endpoint.request.hasRequiredParameters - if (isVoid) { - return { - methodName, - path: endpoint.path, - httpMethod, - request: request.main, - requestSiblings: request.siblings, - responseSiblings: [], - responseTypeArg: 'object', - isVoid: true, - params: request.properties, - ...routeDocumentation, - } - } + const routeDocumentation = { + documentation: endpoint.description, + ...(endpoint.isDeprecated + ? { obsoleteMessage: endpoint.deprecationMessage || 'Deprecated.' } + : {}), + } - const { returnType, returnProp } = returned - const responseKey = (endpoint.response as { responseKey: string }) - .responseKey - const responseClassName = pascalCase(`${endpoint.name}_response`) - const response = buildClass( - responseClassName, - [ - { - name: responseKey, - description: endpoint.response.description, - isRequired: false, - nullable: false, - kind: { t: 'ref', cs: returnType }, - }, - ], - { resourceType: 'response' }, - ) + const returned = responseReturn(endpoint.response, modelTypes) + if (returned == null) { return { methodName, path: endpoint.path, httpMethod, request: request.main, requestSiblings: request.siblings, - response: response.main, - responseSiblings: response.siblings, - responseTypeArg: responseClassName, - returnProp, - returnType, - isVoid: false, - params: request.properties, + responseSiblings: [], + isVoid: true, + usesActionAttempt: false, + usesPagination: false, + requestOptional, ...routeDocumentation, } + } + + const { returnType, returnProp, model, isList } = returned + const responseKey = (endpoint.response as { responseKey: string }).responseKey + const usesActionAttempt = model === 'ActionAttempt' && !isList + const usesPagination = endpoint.hasPagination && isList + + const responseClassName = pascalCase(`${endpoint.name}_response`) + const responseFields: Field[] = [ + { + name: responseKey, + description: endpoint.response.description, + isRequired: false, + isNullable: true, + kind: { t: 'ref', cs: returnType }, + }, + ...(usesPagination + ? [ + { + name: 'pagination', + description: 'The pagination metadata for the page of results.', + isRequired: false, + isNullable: true, + kind: { t: 'ref', cs: 'Pagination' } as Kind, + }, + ] + : []), + ] + const response = buildClass(responseClassName, responseFields, { + resourceType: 'response', }) - return { className: pascalCase(className), routes } + return { + methodName, + path: endpoint.path, + httpMethod, + request: request.main, + requestSiblings: request.siblings, + response: response.main, + responseSiblings: response.siblings, + responseTypeArg: responseClassName, + returnProp, + returnKey: snakeCase(responseKey), + returnType, + isVoid: false, + usesActionAttempt, + usesPagination, + ...(usesPagination ? { pageItemType: model } : {}), + requestOptional, + ...routeDocumentation, + } } - -export { GLOBAL_NAMESPACE } diff --git a/codegen/lib/class-model.ts b/codegen/lib/class-model.ts index 13d64f9f..4beaa522 100644 --- a/codegen/lib/class-model.ts +++ b/codegen/lib/class-model.ts @@ -3,7 +3,8 @@ // These interfaces hold the resolved structure of each generated file, decoupled // from serialization. build-model.ts produces them from the @seamapi/blueprint; // the Handlebars layouts turn them into C#. String serialization lives entirely -// in the templates. +// in the templates, except for the computed C# type names and the +// require-any-of validation conditions. // A single enum member, e.g. `[EnumMember(Value = "setting")] Setting = 1,`. export interface CsEnumMember { @@ -23,19 +24,19 @@ export interface CsEnum { documentation?: string } -// A resolved property: one [DataMember] declaration plus its constructor -// parameter and assignment (which share the property's order and type). +// A resolved property: one [JsonPropertyName] init property. export interface CsProperty { pascalName: string - camelName: string snakeName: string type: string + // Emits the C# `required` modifier: the property must be set in the object + // initializer, enforcing required request parameters at compile time. isRequired: boolean isOverride: boolean - // A get-only property (no setter): the discriminator override and enum - // overrides. + // A get-only property (no init): the discriminator override. getOnly: boolean - // A constant initializer appended to the property, e.g. ` = "LOCK_DOOR"`. + // An initializer appended to the property, e.g. ` = "LOCK_DOOR"` for a + // discriminator or ` = default!` for a leniently-deserialized model property. initializer?: string documentation?: string obsoleteMessage?: string @@ -48,34 +49,36 @@ export interface CsNested { union?: CsUnion } -// A concrete data class: [DataContract] + JsonConstructor ctor + public all-args -// ctor + nested enums/unions + [DataMember] properties + ToString. +// A concrete data record: [JsonPropertyName] init properties plus nested +// enums/unions. export interface CsClass { kind: 'class' className: string - dataContractName: string baseClass?: string + // The generated `…Unrecognized` fallback variant of a union, which also + // implements ISeamUnrecognizedVariant to preserve the raw payload. + isUnrecognizedFallback?: boolean nested: CsNested[] properties: CsProperty[] + // An "at least one parameter is required" endpoint constraint, validated + // locally before the request is sent. + requireAnyOf?: { path: string; conditions: string[] } documentation?: string obsoleteMessage?: string } -// The abstract base of a discriminated union. -export interface CsAbstractProp { - type: string - pascalName: string - getOnly: boolean -} - export interface CsUnion { kind: 'union' className: string discriminatorSnake: string - // typeof(...) subtype attributes, in their emitted (reversed) order. + discriminatorPascal: string + // [SeamUnionVariant] attributes, in variant definition order. knownSubTypes: Array<{ typeName: string; value: string }> unrecognizedTypeName: string - abstractProps: CsAbstractProp[] + // Properties shared by every variant, declared concretely on the base so + // consumers can read them polymorphically without downcasting. Subclasses + // inherit them rather than redeclare them. + baseProps: CsProperty[] // Concrete subclasses followed by the Unrecognized fallback, in definition // order. subclasses: CsClass[] @@ -83,44 +86,67 @@ export interface CsUnion { export type CsDecl = CsClass | CsUnion -// A generated model file (src/Seam/Model/.cs): one or more +// A generated model file (src/Seam/Models/.cs): one or more // top-level declarations (the main type first, then sibling classes spawned by // inline-object properties). export interface CsModelFile { decls: CsDecl[] } -// A single route method (generates four overloads: sync/async x request-object/ -// expanded-params). +// A single route method: one async request-object method with a +// CancellationToken, plus page/pager methods for paginated endpoints. export interface CsRoute { methodName: string path: string - // The client method for the endpoint's preferred HTTP method, e.g. `Get` for - // `_seam.Get(...)`. The client decides from the method whether the request - // parameters travel as a query string or as a JSON body. + // The System.Net.Http.HttpMethod property for the endpoint's semantic HTTP + // method, e.g. `Get` for `HttpMethod.Get`. The transport decides from the + // method whether the request parameters travel as a query string or as a + // JSON body. httpMethod: string request: CsClass // Sibling classes spawned by inline-object request/response properties, - // rendered (nested) inside the Api class after the request/response class. + // rendered (nested) inside the route class after the request/response class. requestSiblings: CsClass[] responseSiblings: CsClass[] response?: CsClass - // The type argument to the client method (the response class, or `object` for - // void). - responseTypeArg: string - // The `.Data.` accessor tail (absent for void). + // The type argument to the transport call (the response class name). + responseTypeArg?: string + // The response property the return value is unwrapped from (absent for void). returnProp?: string - // The declared return type, e.g. `Webhook` or `List` (absent for void). + // The wire name of that property, for error messages. + returnKey?: string + // The declared return type, e.g. `Workspace` or `List` (absent + // for void). returnType?: string isVoid: boolean - // Expanded-overload parameters (the request class properties). - params: CsProperty[] + // The endpoint returns a single action attempt: the method takes a + // `waitForActionAttempt` option and resolves the attempt before returning. + usesActionAttempt: boolean + // The endpoint is paginated: the response keeps its `pagination` envelope + // and the route also emits `PageAsync` and `Pager`. + usesPagination: boolean + // The item type of a paginated endpoint, e.g. `Device`. + pageItemType?: string + // Every request parameter is optional, so the request object itself is too. + requestOptional: boolean documentation?: string obsoleteMessage?: string } -// A generated Api file (src/Seam/Api/.cs). -export interface CsApiFile { +// A child route client exposed as a property, e.g. `Users` on `Acs`. +export interface CsClientChild { className: string + propertyName: string +} + +// A generated route client file (src/Seam/Routes/.cs). +export interface CsRouteFile { + className: string + children: CsClientChild[] routes: CsRoute[] } + +// The generated SeamClient partial wiring the root route clients. +export interface CsClientRootsFile { + roots: Array +} diff --git a/codegen/lib/constants.ts b/codegen/lib/constants.ts deleted file mode 100644 index 3966bf68..00000000 --- a/codegen/lib/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const GLOBAL_NAMESPACE = ['Seam'] diff --git a/codegen/lib/csharp.ts b/codegen/lib/csharp.ts deleted file mode 100644 index d35e4d82..00000000 --- a/codegen/lib/csharp.ts +++ /dev/null @@ -1,82 +0,0 @@ -import type { Blueprint, Endpoint } from '@seamapi/blueprint' -import { pascalCase } from 'change-case' -import type Metalsmith from 'metalsmith' - -import { - buildActionAttemptFile, - buildApiFile, - buildEventFile, - buildModelFile, -} from './build-model.js' - -const outputRoot = 'src/Seam' - -// Resource types that are emitted as discriminated unions rather than plain -// model classes. -const UNION_RESOURCE_TYPES = new Set(['event', 'action_attempt']) - -// Derives the Api class name from a route path: the path segments in reverse, -// pascal-cased (e.g. /acs/credential_pools -> CredentialPoolsAcs). -const apiClassName = (path: string): string => - pascalCase(path.split('/').filter(Boolean).reverse().join('_')) - -// Metalsmith plugin that generates the blueprint-derived C# SDK files: the Api -// route classes (src/Seam/Api/*.cs) and the resource models -// (src/Seam/Model/*.cs). Static, schema-independent files (the -// Client/* runtime, the static Model helpers, the .sln, the test project) are -// normal committed package source and are intentionally NOT generated here. -// -// The blueprint is placed on the Metalsmith metadata by the @seamapi/smith -// `blueprint` plugin, which must run before this one. -export const csharp = ( - files: Metalsmith.Files, - metalsmith: Metalsmith, -): void => { - const { blueprint } = metalsmith.metadata() as { blueprint: Blueprint } - - const writeModel = (name: string, file: unknown): void => { - files[`${outputRoot}/Model/${name}.cs`] = { - contents: Buffer.from('\n'), - layout: 'model.hbs', - ...(file as object), - } - } - - for (const resource of blueprint.resources) { - if (UNION_RESOURCE_TYPES.has(resource.resourceType)) continue - const { name, file } = buildModelFile(resource) - writeModel(name, file) - } - - if (blueprint.actionAttempts.length > 0) { - const { name, file } = buildActionAttemptFile(blueprint.actionAttempts) - writeModel(name, file) - } - - if (blueprint.events.length > 0) { - const { name, file } = buildEventFile(blueprint.events) - writeModel(name, file) - } - - // Resource types emitted as models, used to resolve endpoint return types. - // action_attempt is not a resource but is emitted as a union model. - const modelTypes = new Set(blueprint.resources.map((r) => r.resourceType)) - modelTypes.add('action_attempt') - - const endpointsByClass = new Map() - for (const route of blueprint.routes) { - if (route.endpoints.length === 0) continue - const className = apiClassName(route.path) - const existing = endpointsByClass.get(className) ?? [] - endpointsByClass.set(className, [...existing, ...route.endpoints]) - } - - for (const [className, endpoints] of endpointsByClass) { - const apiFile = buildApiFile(className, endpoints, modelTypes) - files[`${outputRoot}/Api/${apiFile.className}.cs`] = { - contents: Buffer.from('\n'), - layout: 'api.hbs', - ...apiFile, - } - } -} diff --git a/codegen/lib/handlebars-helpers.ts b/codegen/lib/handlebars-helpers.ts index 7d6e5423..c4f4d27a 100644 --- a/codegen/lib/handlebars-helpers.ts +++ b/codegen/lib/handlebars-helpers.ts @@ -1,5 +1,3 @@ -import type { CsProperty } from './class-model.js' - export const identity = (x: unknown): unknown => x export const eq = (a: unknown, b: unknown): boolean => a === b @@ -30,11 +28,3 @@ export const csDoc = (documentation?: string): string => { // Escape a schema-supplied deprecation reason for a C# string literal. export const csString = (value?: string): string => (value ?? 'Deprecated.').replaceAll('\\', '\\\\').replaceAll('"', '\\"') - -// Comma-joined constructor / method parameter list: `Type name = default, ...`. -export const csParams = (properties: CsProperty[]): string => - (properties ?? []).map((p) => `${p.type} ${p.camelName} = default`).join(', ') - -// Comma-joined named-argument list for `new XRequest(...)`: `name: name, ...`. -export const csNamedArgs = (properties: CsProperty[]): string => - (properties ?? []).map((p) => `${p.camelName}: ${p.camelName}`).join(', ') diff --git a/codegen/lib/index.ts b/codegen/lib/index.ts index e5820024..9c0d3f6d 100644 --- a/codegen/lib/index.ts +++ b/codegen/lib/index.ts @@ -4,4 +4,4 @@ import * as customHelpers from './handlebars-helpers.js' export const helpers = { ...handlebarsHelpers, ...customHelpers } -export * from './csharp.js' +export * from './routes.js' diff --git a/codegen/lib/routes.ts b/codegen/lib/routes.ts new file mode 100644 index 00000000..9a29ae06 --- /dev/null +++ b/codegen/lib/routes.ts @@ -0,0 +1,136 @@ +// The Metalsmith plugin that generates the C# SDK source files. +// +// The blueprint from @seamapi/blueprint is the only input: it drives the +// resource models written to src/Seam/Models, the route client classes written +// to src/Seam/Routes, and the SeamClient partial wiring the root clients. + +import type { Blueprint } from '@seamapi/blueprint' +import { camelCase, pascalCase } from 'change-case' +import type Metalsmith from 'metalsmith' + +import { + buildActionAttemptFile, + buildEventFile, + buildModelFile, + buildRoute, +} from './build-model.js' +import type { CsClientChild, CsRoute } from './class-model.js' + +const outputRoot = 'src/Seam' + +// Resource types that are emitted as discriminated unions rather than plain +// model classes. +const UNION_RESOURCE_TYPES = new Set(['event', 'action_attempt']) + +interface Client { + className: string + segments: string[] + children: CsClientChild[] + routes: CsRoute[] +} + +// Metalsmith plugin that generates the blueprint-derived C# SDK files: the +// route client classes (src/Seam/Routes/*.cs) and the resource models +// (src/Seam/Models/*.cs). Static, schema-independent files (the handwritten +// runtime, the .sln, the test project) are normal committed package source and +// are intentionally NOT generated here. +// +// The blueprint is placed on the Metalsmith metadata by the @seamapi/smith +// `blueprint` plugin, which must run before this one. +export const routes = ( + files: Metalsmith.Files, + metalsmith: Metalsmith, +): void => { + const { blueprint } = metalsmith.metadata() as { blueprint: Blueprint } + + const writeModel = (name: string, file: unknown): void => { + files[`${outputRoot}/Models/${name}.cs`] = { + contents: Buffer.from('\n'), + layout: 'model.hbs', + ...(file as object), + } + } + + for (const resource of blueprint.resources) { + if (UNION_RESOURCE_TYPES.has(resource.resourceType)) continue + const { name, file } = buildModelFile(resource) + writeModel(name, file) + } + + if (blueprint.actionAttempts.length > 0) { + const { name, file } = buildActionAttemptFile(blueprint.actionAttempts) + writeModel(name, file) + } + + if (blueprint.events.length > 0) { + const { name, file } = buildEventFile(blueprint.events) + writeModel(name, file) + } + + // Resource types emitted as models, used to resolve endpoint return types. + // action_attempt is not a resource but is emitted as a union model. + const modelTypes = new Set(blueprint.resources.map((r) => r.resourceType)) + modelTypes.add('action_attempt') + + // Route client classes, one file per client. Each route path maps to a + // client class, e.g. /acs/users to AcsUsers, wired to a property on its + // parent client (Acs) or, for top-level routes, on the SeamClient itself. + const classMap = new Map() + + const ensureClient = (segments: string[]): Client => { + const className = pascalCase(segments.join('_')) + const existing = classMap.get(className) + if (existing != null) return existing + + const client: Client = { className, segments, children: [], routes: [] } + classMap.set(className, client) + + if (segments.length > 1) { + const parent = ensureClient(segments.slice(0, -1)) + parent.children.push({ + className, + propertyName: pascalCase(segments.at(-1) as string), + }) + } + + return client + } + + for (const route of blueprint.routes) { + if (route.endpoints.length === 0) continue + + const segments = route.path.split('/').filter((s) => s.length > 0) + const client = ensureClient(segments) + + for (const endpoint of route.endpoints) { + client.routes.push(buildRoute(endpoint, modelTypes)) + } + } + + const clients = [...classMap.values()] + + for (const client of clients) { + files[`${outputRoot}/Routes/${client.className}.cs`] = { + contents: Buffer.from('\n'), + layout: 'route.hbs', + className: client.className, + children: client.children, + routes: client.routes, + } + } + + const roots = clients + .filter((client) => client.segments.length === 1) + .map((client) => ({ + className: client.className, + propertyName: client.className, + fieldName: camelCase(client.className), + })) + .sort((a, b) => a.className.localeCompare(b.className)) + + files[`${outputRoot}/Routes/SeamClientRoutes.cs`] = { + contents: Buffer.from('\n'), + layout: 'client-routes.hbs', + roots, + } +} diff --git a/codegen/smith.ts b/codegen/smith.ts index 246b77fb..a9da424b 100644 --- a/codegen/smith.ts +++ b/codegen/smith.ts @@ -4,17 +4,23 @@ import { fileURLToPath } from 'node:url' import layouts from '@metalsmith/layouts' import { blueprint, getHandlebarsPartials } from '@seamapi/smith' import * as types from '@seamapi/types/connect' +import { deleteAsync } from 'del' import Metalsmith from 'metalsmith' -import { csharp, helpers } from './lib/index.js' +import { helpers, routes } from './lib/index.js' const rootDir = dirname(fileURLToPath(import.meta.url)) +// The generated directories are deleted before every build so files no longer +// produced by the blueprint never linger. Handwritten runtime source lives +// outside these directories. +await deleteAsync(['./src/Seam/Routes', './src/Seam/Models']) + const partials = await getHandlebarsPartials(`${rootDir}/layouts/partials`) -// The destination is the repository root, so cleaning is left disabled to avoid -// deleting checked-in package source. Generated files no longer produced by the -// blueprint are pruned by removing them from version control. +// The destination is the repository root, so Metalsmith cleaning stays +// disabled to avoid deleting checked-in package source; the delete above +// prunes the generated directories instead. // // `omitUndocumented` excludes undocumented routes, endpoints, resources, and // properties from the blueprint so the generated SDK contains only the public @@ -24,7 +30,7 @@ Metalsmith(rootDir) .destination('../') .clean(false) .use(blueprint({ types, omitUndocumented: true })) - .use(csharp) + .use(routes) .use( layouts({ default: 'default.hbs', diff --git a/coverlet.runsettings b/coverlet.runsettings new file mode 100644 index 00000000..7162c4df --- /dev/null +++ b/coverlet.runsettings @@ -0,0 +1,15 @@ + + + + + + + + **/src/Seam/Routes/**/*.cs,**/src/Seam/Models/**/*.cs + + + + + diff --git a/global.json b/global.json new file mode 100644 index 00000000..01cb6588 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "10.0.400", + "rollForward": "latestFeature" + } +} diff --git a/justfile b/justfile index 7e39b832..431c311b 100644 --- a/justfile +++ b/justfile @@ -4,12 +4,12 @@ build: # Run the tests test framework="": - dotnet test ./Seam.sln {{ if framework == "" { "" } else { "--framework " + framework } }} + dotnet test ./Seam.sln --settings coverlet.runsettings {{ if framework == "" { "" } else { "--framework " + framework } }} # Lint lint: - dotnet csharpier --check ./src ./test + dotnet csharpier --check --include-generated ./src ./test # Format format: - dotnet csharpier ./src ./test + dotnet csharpier --include-generated ./src ./test diff --git a/package-lock.json b/package-lock.json index 48a079df..ed9c2c46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,20 @@ { "name": "@seamapi/csharp", - "version": "1.4.0", + "version": "2.0.0-beta.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seamapi/csharp", - "version": "1.4.0", + "version": "2.0.0-beta.3", "license": "MIT", "devDependencies": { "@seamapi/blueprint": "^1.8.0", + "@seamapi/fake-seam-connect": "2.0.5", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1033.0", + "@seamapi/types": "1.1034.0", "change-case": "^5.4.4", + "del": "^8.0.0", "execa": "^10.0.1", "prettier": "^3.0.0" }, @@ -747,7 +749,6 @@ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -762,7 +763,6 @@ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 8" } @@ -773,7 +773,6 @@ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -804,6 +803,24 @@ "npm": ">=10.0.0" } }, + "node_modules/@seamapi/fake-seam-connect": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@seamapi/fake-seam-connect/-/fake-seam-connect-2.0.5.tgz", + "integrity": "sha512-dnHoZtHUHyQP9yqduEqE8dfmOJGMMt0MuqviwgOZo8ElAaPoZk/G+QM5MDg2LJ6q0t54kARYjSngp+IfTme6TQ==", + "dev": true, + "license": "MIT", + "bin": { + "fake-seam-connect": "dist/server.js" + }, + "engines": { + "node": ">=22.12.0", + "npm": ">=10.0.0" + }, + "optionalDependencies": { + "zustand": "^4.3.7", + "zustand-hoist": "^2.0.0" + } + }, "node_modules/@seamapi/smith": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@seamapi/smith/-/smith-1.1.0.tgz", @@ -838,9 +855,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1033.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1033.0.tgz", - "integrity": "sha512-lknlLNUj22pxaukHrnOsOhi2M0th2iVJht2h7scKEXw9eL3l9JEGfvTzFgp5dUEJS593k0LADKO3qGBwaFECPg==", + "version": "1.1034.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1034.0.tgz", + "integrity": "sha512-lFw1r32E3bfSfHYv/ATadTFfubtOo2Vuf9Om88g0yBz85HOusqtl31hniK4oDXQWIacb8HTUpI69dOlzubSqqQ==", "dev": true, "license": "MIT", "engines": { @@ -864,7 +881,6 @@ "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -1487,7 +1503,6 @@ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -1738,7 +1753,6 @@ "integrity": "sha512-gPqh0mKTPvaUZGAuHbrBUYKZWBNAeHG7TU3QH5EhVwPMyKvmfJaNXhcD2jTcXsJRRcffuho4vaYweu80dRrMGA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "globby": "^14.0.2", "is-glob": "^4.0.3", @@ -1761,7 +1775,6 @@ "integrity": "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@sindresorhus/merge-streams": "^2.1.0", "fast-glob": "^3.3.3", @@ -1783,7 +1796,6 @@ "integrity": "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 4" } @@ -1794,7 +1806,6 @@ "integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -2660,7 +2671,6 @@ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -2694,7 +2704,6 @@ "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "reusify": "^1.0.4" } @@ -2735,7 +2744,6 @@ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2981,7 +2989,6 @@ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -3578,7 +3585,6 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.12.0" } @@ -3606,7 +3612,6 @@ "integrity": "sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -3620,7 +3625,6 @@ "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -4091,7 +4095,6 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 8" } @@ -4159,7 +4162,6 @@ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -4618,7 +4620,6 @@ "integrity": "sha512-I4Prw6ivkd6p8PiYR1tXASOAOBzIJwu0TB7fqaX0c/8c3QAehNYmX57EijyGGGBt3c/BIowGwV03RVBtXvHEVg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -4727,7 +4728,6 @@ "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8.6" }, @@ -4762,7 +4762,6 @@ "integrity": "sha512-E6rsNU1QNJgB3sjj7OANinGncFKuK+164sLXw1/CqBjj/EkXSoSdHCtWQGBNlREIGLnL7IEUEGa08YFVUbrhVg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=16" }, @@ -4855,8 +4854,19 @@ "url": "https://feross.org/support" } ], + "license": "MIT" + }, + "node_modules/react": { + "version": "19.2.8", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz", + "integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==", + "dev": true, "license": "MIT", - "peer": true + "optional": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } }, "node_modules/react-is": { "version": "16.13.1", @@ -4968,7 +4978,6 @@ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -4994,7 +5003,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "queue-microtask": "^1.2.2" } @@ -5251,7 +5259,6 @@ "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=14.16" }, @@ -5545,7 +5552,6 @@ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "is-number": "^7.0.0" }, @@ -5831,6 +5837,17 @@ "punycode": "^2.1.0" } }, + "node_modules/use-sync-external-store": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", + "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", + "dev": true, + "license": "MIT", + "optional": true, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/ware": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ware/-/ware-1.3.0.tgz", @@ -6030,6 +6047,51 @@ "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "node_modules/zustand": { + "version": "4.5.7", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", + "integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "use-sync-external-store": "^1.2.2" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0.6", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } + }, + "node_modules/zustand-hoist": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/zustand-hoist/-/zustand-hoist-2.0.1.tgz", + "integrity": "sha512-Lhvv3RlLQx1NSUtuhk8jegXe1Wyav9RAOnLd4CRs1SbB5qcFoarAGQTE43vIxXizrm1UQJl1q5uRbOZuXGXGpQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=18.12.0", + "npm": ">= 9.0.0" + }, + "peerDependencies": { + "zustand": ">=4.0.0" + } } } } diff --git a/package.json b/package.json index 46dfbd42..f7398162 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "@seamapi/csharp", - "version": "1.4.0", + "version": "2.0.0-beta.3", "type": "module", "private": true, "license": "MIT", "scripts": { + "start": "fake-seam-connect --seed", "version": "tsx ./version.ts", "postversion": "git push --follow-tags", "generate": "tsx codegen/smith.ts", @@ -32,9 +33,11 @@ "packageManager": "npm@11.19.0", "devDependencies": { "@seamapi/blueprint": "^1.8.0", + "@seamapi/fake-seam-connect": "2.0.5", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1033.0", + "@seamapi/types": "1.1034.0", "change-case": "^5.4.4", + "del": "^8.0.0", "execa": "^10.0.1", "prettier": "^3.0.0" } diff --git a/src/Seam/ActionAttempts/ActionAttemptCore.cs b/src/Seam/ActionAttempts/ActionAttemptCore.cs new file mode 100644 index 00000000..03df738e --- /dev/null +++ b/src/Seam/ActionAttempts/ActionAttemptCore.cs @@ -0,0 +1,40 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// The status of an action attempt. + /// + /// + /// Declared by the runtime rather than generated: every action attempt shares this wire + /// shape, and the action attempt resolver depends on it. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ActionAttemptStatus + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pending")] + Pending = 1, + + [EnumMember(Value = "success")] + Success = 2, + + [EnumMember(Value = "error")] + Error = 3, + } + + /// + /// The error of a failed action attempt. + /// + public sealed record ActionAttemptError + { + [JsonPropertyName("type")] + public string? Type { get; init; } + + [JsonPropertyName("message")] + public string? Message { get; init; } + } +} diff --git a/src/Seam/ActionAttempts/ActionAttemptResolver.cs b/src/Seam/ActionAttempts/ActionAttemptResolver.cs new file mode 100644 index 00000000..9d489277 --- /dev/null +++ b/src/Seam/ActionAttempts/ActionAttemptResolver.cs @@ -0,0 +1,92 @@ +using System.Diagnostics; +using System.Net.Http; +using System.Text.Json.Serialization; +using System.Threading; +using System.Threading.Tasks; +using Seam.Http; + +namespace Seam +{ + /// + /// Waits for an action attempt to reach a terminal state. + /// + /// + /// A successful attempt is returned as is, a failed one raises, and a pending one is polled + /// until it finishes or the timeout elapses. The timeout is checked before each poll so the + /// resolver never sleeps past the deadline. Cancelling the caller's token raises + /// , distinct from the Seam timeout. + /// + internal static class ActionAttemptResolver + { + public static async Task ResolveAsync( + Models.ActionAttempt actionAttempt, + SeamHttpTransport transport, + ActionAttemptWait wait, + CancellationToken cancellationToken + ) + { + if (!wait.Enabled) + return actionAttempt; + + var elapsed = Stopwatch.StartNew(); + + while (true) + { + if (actionAttempt.Status == Models.ActionAttemptStatus.Success) + return actionAttempt; + + if (actionAttempt.Status == Models.ActionAttemptStatus.Error) + throw new SeamActionAttemptFailedException(actionAttempt); + + if (elapsed.Elapsed + wait.PollingInterval > wait.Timeout) + throw new SeamActionAttemptTimeoutException(actionAttempt, wait.Timeout); + + await Task.Delay(wait.PollingInterval, cancellationToken).ConfigureAwait(false); + + actionAttempt = await GetActionAttemptAsync( + transport, + actionAttempt.ActionAttemptId, + cancellationToken + ) + .ConfigureAwait(false); + } + } + + /// + /// Fetches the action attempt directly through the transport, rather than through the + /// generated endpoint method, so waiting does not recurse. + /// + private static async Task GetActionAttemptAsync( + SeamHttpTransport transport, + string actionAttemptId, + CancellationToken cancellationToken + ) + { + var response = await transport + .SendAsync( + HttpMethod.Get, + "/action_attempts/get", + new GetActionAttemptRequest { ActionAttemptId = actionAttemptId }, + cancellationToken + ) + .ConfigureAwait(false); + + return response.ActionAttempt + ?? throw new HttpRequestException( + $"Seam returned no action attempt for {actionAttemptId}" + ); + } + + private sealed record GetActionAttemptRequest + { + [JsonPropertyName("action_attempt_id")] + public required string ActionAttemptId { get; init; } + } + + private sealed record GetActionAttemptResponse + { + [JsonPropertyName("action_attempt")] + public Models.ActionAttempt? ActionAttempt { get; init; } + } + } +} diff --git a/src/Seam/ActionAttempts/ActionAttemptWait.cs b/src/Seam/ActionAttempts/ActionAttemptWait.cs new file mode 100644 index 00000000..166345cf --- /dev/null +++ b/src/Seam/ActionAttempts/ActionAttemptWait.cs @@ -0,0 +1,33 @@ +using System; + +namespace Seam +{ + /// + /// How an endpoint that returns an action attempt waits for it to finish. + /// + /// + /// By default, every such endpoint polls the action attempt until it succeeds, returning the + /// finished attempt, raising when it fails, + /// and when it is still pending after + /// . Pass (or false) to get the pending + /// attempt back immediately instead. Set client-wide via + /// or per call via the endpoint's + /// waitForActionAttempt parameter. + /// + public sealed class ActionAttemptWait + { + /// Wait with the default timeout and polling interval. + public static ActionAttemptWait Default { get; } = new(); + + /// Return the pending action attempt immediately without waiting. + public static ActionAttemptWait DoNotWait { get; } = new() { Enabled = false }; + + public bool Enabled { get; init; } = true; + + public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(10); + + public TimeSpan PollingInterval { get; init; } = TimeSpan.FromSeconds(1); + + public static implicit operator ActionAttemptWait(bool wait) => wait ? Default : DoNotWait; + } +} diff --git a/src/Seam/Api/AccessCodes.cs b/src/Seam/Api/AccessCodes.cs deleted file mode 100644 index 102433ad..00000000 --- a/src/Seam/Api/AccessCodes.cs +++ /dev/null @@ -1,2078 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class AccessCodes - { - private ISeamClient _seam; - - public AccessCodes(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create an Access Code. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - bool? allowExternalModification = default, - bool? attemptForOfflineDevice = default, - string? code = default, - string? commonCodeKey = default, - string deviceId = default, - string? endsAt = default, - bool? isExternalModificationAllowed = default, - bool? isOfflineAccessCode = default, - bool? isOneTimeUse = default, - CreateRequest.MaxTimeRoundingEnum? maxTimeRounding = default, - string? name = default, - bool? preferNativeScheduling = default, - float? preferredCodeLength = default, - string? startsAt = default, - bool? useBackupAccessCodePool = default, - bool? useOfflineAccessCode = default - ) - { - AllowExternalModification = allowExternalModification; - AttemptForOfflineDevice = attemptForOfflineDevice; - Code = code; - CommonCodeKey = commonCodeKey; - DeviceId = deviceId; - EndsAt = endsAt; - IsExternalModificationAllowed = isExternalModificationAllowed; - IsOfflineAccessCode = isOfflineAccessCode; - IsOneTimeUse = isOneTimeUse; - MaxTimeRounding = maxTimeRounding; - Name = name; - PreferNativeScheduling = preferNativeScheduling; - PreferredCodeLength = preferredCodeLength; - StartsAt = startsAt; - UseBackupAccessCodePool = useBackupAccessCodePool; - UseOfflineAccessCode = useOfflineAccessCode; - } - - /// - /// Maximum rounding adjustment. To create a daily-bound [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) for devices that support this feature, set this parameter to `1d`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum MaxTimeRoundingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "1hour")] - _1hour = 1, - - [EnumMember(Value = "1day")] - _1day = 2, - - [EnumMember(Value = "1h")] - _1h = 3, - - [EnumMember(Value = "1d")] - _1d = 4, - } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. - /// - [DataMember( - Name = "allow_external_modification", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AllowExternalModification { get; set; } - - [DataMember( - Name = "attempt_for_offline_device", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AttemptForOfflineDevice { get; set; } - - /// - /// Code to be used for access. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Key to identify access codes that should have the same code. Any two access codes with the same `common_code_key` are guaranteed to have the same `code`. See also [Creating and Updating Multiple Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes). - /// - [DataMember(Name = "common_code_key", IsRequired = false, EmitDefaultValue = false)] - public string? CommonCodeKey { get; set; } - - /// - /// ID of the device for which you want to create the new access code. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. - /// - [DataMember( - Name = "is_external_modification_allowed", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsExternalModificationAllowed { get; set; } - - /// - /// Indicates whether the access code is an [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes). - /// - [DataMember( - Name = "is_offline_access_code", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsOfflineAccessCode { get; set; } - - /// - /// Indicates whether the [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) is a single-use access code. - /// - [DataMember(Name = "is_one_time_use", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOneTimeUse { get; set; } - - /// - /// Maximum rounding adjustment. To create a daily-bound [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) for devices that support this feature, set this parameter to `1d`. - /// - [DataMember(Name = "max_time_rounding", IsRequired = false, EmitDefaultValue = false)] - public CreateRequest.MaxTimeRoundingEnum? MaxTimeRounding { get; set; } - - /// - /// Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. - /// - /// Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. - /// - /// To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. - /// - /// To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`. - /// - [DataMember( - Name = "prefer_native_scheduling", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? PreferNativeScheduling { get; set; } - - /// - /// Preferred code length. Only applicable if you do not specify a `code`. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length. - /// - [DataMember( - Name = "preferred_code_length", - IsRequired = false, - EmitDefaultValue = false - )] - public float? PreferredCodeLength { get; set; } - - /// - /// Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code). - /// - [DataMember( - Name = "use_backup_access_code_pool", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? UseBackupAccessCodePool { get; set; } - - [Obsolete("Use `is_offline_access_code` instead.")] - [DataMember( - Name = "use_offline_access_code", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? UseOfflineAccessCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(AccessCode accessCode = default) - { - AccessCode = accessCode; - } - - /// - /// OK - /// - [DataMember(Name = "access_code", IsRequired = false, EmitDefaultValue = false)] - public AccessCode AccessCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [access code](https://docs.seam.co/low-level-apis/access-codes). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they work across both standalone smart locks and access control systems and manage the underlying codes for you. Use this low-level endpoint only when you need direct control over a code on a single device, such as setting a custom PIN value. - /// - public AccessCode Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/access_codes/create", requestOptions) - .EnsureData("/access_codes/create") - .AccessCode; - } - - /// - /// Creates a new [access code](https://docs.seam.co/low-level-apis/access-codes). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they work across both standalone smart locks and access control systems and manage the underlying codes for you. Use this low-level endpoint only when you need direct control over a code on a single device, such as setting a custom PIN value. - /// - public AccessCode Create( - bool? allowExternalModification = default, - bool? attemptForOfflineDevice = default, - string? code = default, - string? commonCodeKey = default, - string deviceId = default, - string? endsAt = default, - bool? isExternalModificationAllowed = default, - bool? isOfflineAccessCode = default, - bool? isOneTimeUse = default, - CreateRequest.MaxTimeRoundingEnum? maxTimeRounding = default, - string? name = default, - bool? preferNativeScheduling = default, - float? preferredCodeLength = default, - string? startsAt = default, - bool? useBackupAccessCodePool = default, - bool? useOfflineAccessCode = default - ) - { - return Create( - new CreateRequest( - allowExternalModification: allowExternalModification, - attemptForOfflineDevice: attemptForOfflineDevice, - code: code, - commonCodeKey: commonCodeKey, - deviceId: deviceId, - endsAt: endsAt, - isExternalModificationAllowed: isExternalModificationAllowed, - isOfflineAccessCode: isOfflineAccessCode, - isOneTimeUse: isOneTimeUse, - maxTimeRounding: maxTimeRounding, - name: name, - preferNativeScheduling: preferNativeScheduling, - preferredCodeLength: preferredCodeLength, - startsAt: startsAt, - useBackupAccessCodePool: useBackupAccessCodePool, - useOfflineAccessCode: useOfflineAccessCode - ) - ); - } - - /// - /// Creates a new [access code](https://docs.seam.co/low-level-apis/access-codes). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they work across both standalone smart locks and access control systems and manage the underlying codes for you. Use this low-level endpoint only when you need direct control over a code on a single device, such as setting a custom PIN value. - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/access_codes/create", requestOptions)) - .EnsureData("/access_codes/create") - .AccessCode; - } - - /// - /// Creates a new [access code](https://docs.seam.co/low-level-apis/access-codes). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they work across both standalone smart locks and access control systems and manage the underlying codes for you. Use this low-level endpoint only when you need direct control over a code on a single device, such as setting a custom PIN value. - /// - public async Task CreateAsync( - bool? allowExternalModification = default, - bool? attemptForOfflineDevice = default, - string? code = default, - string? commonCodeKey = default, - string deviceId = default, - string? endsAt = default, - bool? isExternalModificationAllowed = default, - bool? isOfflineAccessCode = default, - bool? isOneTimeUse = default, - CreateRequest.MaxTimeRoundingEnum? maxTimeRounding = default, - string? name = default, - bool? preferNativeScheduling = default, - float? preferredCodeLength = default, - string? startsAt = default, - bool? useBackupAccessCodePool = default, - bool? useOfflineAccessCode = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - allowExternalModification: allowExternalModification, - attemptForOfflineDevice: attemptForOfflineDevice, - code: code, - commonCodeKey: commonCodeKey, - deviceId: deviceId, - endsAt: endsAt, - isExternalModificationAllowed: isExternalModificationAllowed, - isOfflineAccessCode: isOfflineAccessCode, - isOneTimeUse: isOneTimeUse, - maxTimeRounding: maxTimeRounding, - name: name, - preferNativeScheduling: preferNativeScheduling, - preferredCodeLength: preferredCodeLength, - startsAt: startsAt, - useBackupAccessCodePool: useBackupAccessCodePool, - useOfflineAccessCode: useOfflineAccessCode - ) - ) - ); - } - - /// - /// Request parameters for Create Multiple Linked Access Codes. - /// - [DataContract(Name = "createMultipleRequest_request")] - public class CreateMultipleRequest - { - [JsonConstructorAttribute] - protected CreateMultipleRequest() { } - - public CreateMultipleRequest( - bool? allowExternalModification = default, - bool? attemptForOfflineDevice = default, - CreateMultipleRequest.BehaviorWhenCodeCannotBeSharedEnum? behaviorWhenCodeCannotBeShared = - default, - string? code = default, - List deviceIds = default, - string? endsAt = default, - bool? isExternalModificationAllowed = default, - string? name = default, - bool? preferNativeScheduling = default, - float? preferredCodeLength = default, - string? startsAt = default, - bool? useBackupAccessCodePool = default - ) - { - AllowExternalModification = allowExternalModification; - AttemptForOfflineDevice = attemptForOfflineDevice; - BehaviorWhenCodeCannotBeShared = behaviorWhenCodeCannotBeShared; - Code = code; - DeviceIds = deviceIds; - EndsAt = endsAt; - IsExternalModificationAllowed = isExternalModificationAllowed; - Name = name; - PreferNativeScheduling = preferNativeScheduling; - PreferredCodeLength = preferredCodeLength; - StartsAt = startsAt; - UseBackupAccessCodePool = useBackupAccessCodePool; - } - - /// - /// Desired behavior if any device cannot share a code. If `throw` (default), no access codes will be created if any device cannot share a code. If `create_random_code`, a random code will be created on devices that cannot share a code. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum BehaviorWhenCodeCannotBeSharedEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "throw")] - Throw = 1, - - [EnumMember(Value = "create_random_code")] - CreateRandomCode = 2, - } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. - /// - [DataMember( - Name = "allow_external_modification", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AllowExternalModification { get; set; } - - [DataMember( - Name = "attempt_for_offline_device", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AttemptForOfflineDevice { get; set; } - - /// - /// Desired behavior if any device cannot share a code. If `throw` (default), no access codes will be created if any device cannot share a code. If `create_random_code`, a random code will be created on devices that cannot share a code. - /// - [DataMember( - Name = "behavior_when_code_cannot_be_shared", - IsRequired = false, - EmitDefaultValue = false - )] - public CreateMultipleRequest.BehaviorWhenCodeCannotBeSharedEnum? BehaviorWhenCodeCannotBeShared { get; set; } - - /// - /// Code to be used for access. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// IDs of the devices for which you want to create the new access codes. - /// - [DataMember(Name = "device_ids", IsRequired = true, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - /// - /// Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. - /// - [DataMember( - Name = "is_external_modification_allowed", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsExternalModificationAllowed { get; set; } - - /// - /// Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. - /// - /// Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. - /// - /// To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. - /// - /// To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`. - /// - [DataMember( - Name = "prefer_native_scheduling", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? PreferNativeScheduling { get; set; } - - /// - /// Preferred code length. If the affected devices do not support the preferred code length, Seam reverts to using the shortest supported code length. - /// - [DataMember( - Name = "preferred_code_length", - IsRequired = false, - EmitDefaultValue = false - )] - public float? PreferredCodeLength { get; set; } - - /// - /// Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code). - /// - [DataMember( - Name = "use_backup_access_code_pool", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? UseBackupAccessCodePool { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createMultipleResponse_response")] - public class CreateMultipleResponse - { - [JsonConstructorAttribute] - protected CreateMultipleResponse() { } - - public CreateMultipleResponse(List accessCodes = default) - { - AccessCodes = accessCodes; - } - - /// - /// OK - /// - [DataMember(Name = "access_codes", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodes { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates new [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. - /// - /// Users with more than one door lock in a property may want to create groups of linked access codes, all of which have the same code (PIN). For example, a short-term rental host may want to provide guests the same PIN for both a front door lock and a back door lock. - /// - /// If you specify a custom code, Seam assigns this custom code to each of the resulting access codes. However, in this case, Seam does not link these access codes together with a `common_code_key`. That is, `common_code_key` remains null for these access codes. - /// - /// If you want to change these access codes that are not linked by a `common_code_key`, you cannot use `/access_codes/update_multiple`. However, you can update each of these access codes individually, using `/access_codes/update`. - /// - /// See also [Creating and Updating Multiple Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes). - /// - /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. - /// - public List CreateMultiple(CreateMultipleRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Put("/access_codes/create_multiple", requestOptions) - .EnsureData("/access_codes/create_multiple") - .AccessCodes; - } - - /// - /// Creates new [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. - /// - /// Users with more than one door lock in a property may want to create groups of linked access codes, all of which have the same code (PIN). For example, a short-term rental host may want to provide guests the same PIN for both a front door lock and a back door lock. - /// - /// If you specify a custom code, Seam assigns this custom code to each of the resulting access codes. However, in this case, Seam does not link these access codes together with a `common_code_key`. That is, `common_code_key` remains null for these access codes. - /// - /// If you want to change these access codes that are not linked by a `common_code_key`, you cannot use `/access_codes/update_multiple`. However, you can update each of these access codes individually, using `/access_codes/update`. - /// - /// See also [Creating and Updating Multiple Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes). - /// - /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. - /// - public List CreateMultiple( - bool? allowExternalModification = default, - bool? attemptForOfflineDevice = default, - CreateMultipleRequest.BehaviorWhenCodeCannotBeSharedEnum? behaviorWhenCodeCannotBeShared = - default, - string? code = default, - List deviceIds = default, - string? endsAt = default, - bool? isExternalModificationAllowed = default, - string? name = default, - bool? preferNativeScheduling = default, - float? preferredCodeLength = default, - string? startsAt = default, - bool? useBackupAccessCodePool = default - ) - { - return CreateMultiple( - new CreateMultipleRequest( - allowExternalModification: allowExternalModification, - attemptForOfflineDevice: attemptForOfflineDevice, - behaviorWhenCodeCannotBeShared: behaviorWhenCodeCannotBeShared, - code: code, - deviceIds: deviceIds, - endsAt: endsAt, - isExternalModificationAllowed: isExternalModificationAllowed, - name: name, - preferNativeScheduling: preferNativeScheduling, - preferredCodeLength: preferredCodeLength, - startsAt: startsAt, - useBackupAccessCodePool: useBackupAccessCodePool - ) - ); - } - - /// - /// Creates new [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. - /// - /// Users with more than one door lock in a property may want to create groups of linked access codes, all of which have the same code (PIN). For example, a short-term rental host may want to provide guests the same PIN for both a front door lock and a back door lock. - /// - /// If you specify a custom code, Seam assigns this custom code to each of the resulting access codes. However, in this case, Seam does not link these access codes together with a `common_code_key`. That is, `common_code_key` remains null for these access codes. - /// - /// If you want to change these access codes that are not linked by a `common_code_key`, you cannot use `/access_codes/update_multiple`. However, you can update each of these access codes individually, using `/access_codes/update`. - /// - /// See also [Creating and Updating Multiple Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes). - /// - /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. - /// - public async Task> CreateMultipleAsync(CreateMultipleRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PutAsync( - "/access_codes/create_multiple", - requestOptions - ) - ) - .EnsureData("/access_codes/create_multiple") - .AccessCodes; - } - - /// - /// Creates new [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. - /// - /// Users with more than one door lock in a property may want to create groups of linked access codes, all of which have the same code (PIN). For example, a short-term rental host may want to provide guests the same PIN for both a front door lock and a back door lock. - /// - /// If you specify a custom code, Seam assigns this custom code to each of the resulting access codes. However, in this case, Seam does not link these access codes together with a `common_code_key`. That is, `common_code_key` remains null for these access codes. - /// - /// If you want to change these access codes that are not linked by a `common_code_key`, you cannot use `/access_codes/update_multiple`. However, you can update each of these access codes individually, using `/access_codes/update`. - /// - /// See also [Creating and Updating Multiple Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes). - /// - /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. - /// - public async Task> CreateMultipleAsync( - bool? allowExternalModification = default, - bool? attemptForOfflineDevice = default, - CreateMultipleRequest.BehaviorWhenCodeCannotBeSharedEnum? behaviorWhenCodeCannotBeShared = - default, - string? code = default, - List deviceIds = default, - string? endsAt = default, - bool? isExternalModificationAllowed = default, - string? name = default, - bool? preferNativeScheduling = default, - float? preferredCodeLength = default, - string? startsAt = default, - bool? useBackupAccessCodePool = default - ) - { - return ( - await CreateMultipleAsync( - new CreateMultipleRequest( - allowExternalModification: allowExternalModification, - attemptForOfflineDevice: attemptForOfflineDevice, - behaviorWhenCodeCannotBeShared: behaviorWhenCodeCannotBeShared, - code: code, - deviceIds: deviceIds, - endsAt: endsAt, - isExternalModificationAllowed: isExternalModificationAllowed, - name: name, - preferNativeScheduling: preferNativeScheduling, - preferredCodeLength: preferredCodeLength, - startsAt: startsAt, - useBackupAccessCodePool: useBackupAccessCodePool - ) - ) - ); - } - - /// - /// Request parameters for Delete an Access Code. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string accessCodeId = default, string? deviceId = default) - { - AccessCodeId = accessCodeId; - DeviceId = deviceId; - } - - /// - /// ID of the access code that you want to delete. - /// - [DataMember(Name = "access_code_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// ID of the device for which you want to delete the access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/access_codes/delete", requestOptions); - } - - /// - /// Deletes an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - public void Delete(string accessCodeId = default, string? deviceId = default) - { - Delete(new DeleteRequest(accessCodeId: accessCodeId, deviceId: deviceId)); - } - - /// - /// Deletes an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/access_codes/delete", requestOptions); - } - - /// - /// Deletes an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - public async Task DeleteAsync(string accessCodeId = default, string? deviceId = default) - { - await DeleteAsync(new DeleteRequest(accessCodeId: accessCodeId, deviceId: deviceId)); - } - - /// - /// Request parameters for Generate a Code. - /// - [DataContract(Name = "generateCodeRequest_request")] - public class GenerateCodeRequest - { - [JsonConstructorAttribute] - protected GenerateCodeRequest() { } - - public GenerateCodeRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the device for which you want to generate a code. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "generateCodeResponse_response")] - public class GenerateCodeResponse - { - [JsonConstructorAttribute] - protected GenerateCodeResponse() { } - - public GenerateCodeResponse(AccessCode generatedCode = default) - { - GeneratedCode = generatedCode; - } - - /// - /// OK - /// - [DataMember(Name = "generated_code", IsRequired = false, EmitDefaultValue = false)] - public AccessCode GeneratedCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Generates a code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes), given a device ID. - /// - public AccessCode GenerateCode(GenerateCodeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_codes/generate_code", requestOptions) - .EnsureData("/access_codes/generate_code") - .GeneratedCode; - } - - /// - /// Generates a code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes), given a device ID. - /// - public AccessCode GenerateCode(string deviceId = default) - { - return GenerateCode(new GenerateCodeRequest(deviceId: deviceId)); - } - - /// - /// Generates a code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes), given a device ID. - /// - public async Task GenerateCodeAsync(GenerateCodeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/access_codes/generate_code", - requestOptions - ) - ) - .EnsureData("/access_codes/generate_code") - .GeneratedCode; - } - - /// - /// Generates a code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes), given a device ID. - /// - public async Task GenerateCodeAsync(string deviceId = default) - { - return (await GenerateCodeAsync(new GenerateCodeRequest(deviceId: deviceId))); - } - - /// - /// Request parameters for Get an Access Code. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest( - string? accessCodeId = default, - string? code = default, - string? deviceId = default - ) - { - AccessCodeId = accessCodeId; - Code = code; - DeviceId = deviceId; - } - - /// - /// ID of the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessCodeId { get; set; } - - /// - /// Code of the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// ID of the device containing the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(AccessCode accessCode = default) - { - AccessCode = accessCode; - } - - /// - /// OK - /// - [DataMember(Name = "access_code", IsRequired = false, EmitDefaultValue = false)] - public AccessCode AccessCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// You must specify either `access_code_id` or both `device_id` and `code`. - /// - public AccessCode Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_codes/get", requestOptions) - .EnsureData("/access_codes/get") - .AccessCode; - } - - /// - /// Returns a specified [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// You must specify either `access_code_id` or both `device_id` and `code`. - /// - public AccessCode Get( - string? accessCodeId = default, - string? code = default, - string? deviceId = default - ) - { - return Get(new GetRequest(accessCodeId: accessCodeId, code: code, deviceId: deviceId)); - } - - /// - /// Returns a specified [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// You must specify either `access_code_id` or both `device_id` and `code`. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/access_codes/get", requestOptions)) - .EnsureData("/access_codes/get") - .AccessCode; - } - - /// - /// Returns a specified [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// You must specify either `access_code_id` or both `device_id` and `code`. - /// - public async Task GetAsync( - string? accessCodeId = default, - string? code = default, - string? deviceId = default - ) - { - return ( - await GetAsync( - new GetRequest(accessCodeId: accessCodeId, code: code, deviceId: deviceId) - ) - ); - } - - /// - /// Request parameters for List Access Codes. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - List? accessCodeIds = default, - string? accessGrantId = default, - string? accessGrantKey = default, - string? accessMethodId = default, - string? customerKey = default, - string? deviceId = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentifierKey = default - ) - { - AccessCodeIds = accessCodeIds; - AccessGrantId = accessGrantId; - AccessGrantKey = accessGrantKey; - AccessMethodId = accessMethodId; - CustomerKey = customerKey; - DeviceId = deviceId; - Limit = limit; - PageCursor = pageCursor; - Search = search; - UserIdentifierKey = userIdentifierKey; - } - - /// - /// IDs of the access codes that you want to retrieve. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. - /// - [DataMember(Name = "access_code_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AccessCodeIds { get; set; } - - /// - /// ID of the access grant for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantId { get; set; } - - /// - /// Key of the access grant for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// ID of the access method for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessMethodId { get; set; } - - /// - /// Customer key for which you want to list access codes. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// ID of the device for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Numerical limit on the number of access codes to return. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned access codes to include all records that satisfy a partial match using `name`, `code` or `access_code_id`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// Your user ID for the user by which to filter access codes. - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List accessCodes = default) - { - AccessCodes = accessCodes; - } - - /// - /// OK - /// - [DataMember(Name = "access_codes", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodes { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_codes/list", requestOptions) - .EnsureData("/access_codes/list") - .AccessCodes; - } - - /// - /// Returns a list of all [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. - /// - public List List( - List? accessCodeIds = default, - string? accessGrantId = default, - string? accessGrantKey = default, - string? accessMethodId = default, - string? customerKey = default, - string? deviceId = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentifierKey = default - ) - { - return List( - new ListRequest( - accessCodeIds: accessCodeIds, - accessGrantId: accessGrantId, - accessGrantKey: accessGrantKey, - accessMethodId: accessMethodId, - customerKey: customerKey, - deviceId: deviceId, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentifierKey: userIdentifierKey - ) - ); - } - - /// - /// Returns a list of all [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/access_codes/list", requestOptions)) - .EnsureData("/access_codes/list") - .AccessCodes; - } - - /// - /// Returns a list of all [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. - /// - public async Task> ListAsync( - List? accessCodeIds = default, - string? accessGrantId = default, - string? accessGrantKey = default, - string? accessMethodId = default, - string? customerKey = default, - string? deviceId = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentifierKey = default - ) - { - return ( - await ListAsync( - new ListRequest( - accessCodeIds: accessCodeIds, - accessGrantId: accessGrantId, - accessGrantKey: accessGrantKey, - accessMethodId: accessMethodId, - customerKey: customerKey, - deviceId: deviceId, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentifierKey: userIdentifierKey - ) - ) - ); - } - - /// - /// Request parameters for Pull a Backup Access Code. - /// - [DataContract(Name = "pullBackupAccessCodeRequest_request")] - public class PullBackupAccessCodeRequest - { - [JsonConstructorAttribute] - protected PullBackupAccessCodeRequest() { } - - public PullBackupAccessCodeRequest(string accessCodeId = default) - { - AccessCodeId = accessCodeId; - } - - /// - /// ID of the access code for which you want to pull a backup access code. - /// - [DataMember(Name = "access_code_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pullBackupAccessCodeResponse_response")] - public class PullBackupAccessCodeResponse - { - [JsonConstructorAttribute] - protected PullBackupAccessCodeResponse() { } - - public PullBackupAccessCodeResponse(AccessCode accessCode = default) - { - AccessCode = accessCode; - } - - /// - /// OK - /// - [DataMember(Name = "access_code", IsRequired = false, EmitDefaultValue = false)] - public AccessCode AccessCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Retrieves a backup access code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). See also [Managing Backup Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes). - /// - /// A backup access code pool is a collection of pre-programmed access codes stored on a device, ready for use. These codes are programmed in addition to the regular access codes on Seam, serving as a safety net for any issues with the primary codes. If there's ever a complication with a primary access code—be it due to intermittent connectivity, manual removal from a device, or provider outages—a backup code can be retrieved. Its end time can then be adjusted to align with the original code, facilitating seamless and uninterrupted access. - /// - /// You can pull a backup access code from the pool at any time. These backup codes are guaranteed to work immediately and automatically programmed to be removed from the device after the access code ends. - /// - /// You can only pull backup access codes for time-bound access codes. - /// - /// Before pulling a backup access code, make sure that the device's `properties.supports_backup_access_code_pool` is `true`. Then, to activate the backup pool, set `use_backup_access_code_pool` to `true` when creating an access code. - /// - public AccessCode PullBackupAccessCode(PullBackupAccessCodeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post( - "/access_codes/pull_backup_access_code", - requestOptions - ) - .EnsureData("/access_codes/pull_backup_access_code") - .AccessCode; - } - - /// - /// Retrieves a backup access code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). See also [Managing Backup Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes). - /// - /// A backup access code pool is a collection of pre-programmed access codes stored on a device, ready for use. These codes are programmed in addition to the regular access codes on Seam, serving as a safety net for any issues with the primary codes. If there's ever a complication with a primary access code—be it due to intermittent connectivity, manual removal from a device, or provider outages—a backup code can be retrieved. Its end time can then be adjusted to align with the original code, facilitating seamless and uninterrupted access. - /// - /// You can pull a backup access code from the pool at any time. These backup codes are guaranteed to work immediately and automatically programmed to be removed from the device after the access code ends. - /// - /// You can only pull backup access codes for time-bound access codes. - /// - /// Before pulling a backup access code, make sure that the device's `properties.supports_backup_access_code_pool` is `true`. Then, to activate the backup pool, set `use_backup_access_code_pool` to `true` when creating an access code. - /// - public AccessCode PullBackupAccessCode(string accessCodeId = default) - { - return PullBackupAccessCode( - new PullBackupAccessCodeRequest(accessCodeId: accessCodeId) - ); - } - - /// - /// Retrieves a backup access code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). See also [Managing Backup Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes). - /// - /// A backup access code pool is a collection of pre-programmed access codes stored on a device, ready for use. These codes are programmed in addition to the regular access codes on Seam, serving as a safety net for any issues with the primary codes. If there's ever a complication with a primary access code—be it due to intermittent connectivity, manual removal from a device, or provider outages—a backup code can be retrieved. Its end time can then be adjusted to align with the original code, facilitating seamless and uninterrupted access. - /// - /// You can pull a backup access code from the pool at any time. These backup codes are guaranteed to work immediately and automatically programmed to be removed from the device after the access code ends. - /// - /// You can only pull backup access codes for time-bound access codes. - /// - /// Before pulling a backup access code, make sure that the device's `properties.supports_backup_access_code_pool` is `true`. Then, to activate the backup pool, set `use_backup_access_code_pool` to `true` when creating an access code. - /// - public async Task PullBackupAccessCodeAsync(PullBackupAccessCodeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/access_codes/pull_backup_access_code", - requestOptions - ) - ) - .EnsureData("/access_codes/pull_backup_access_code") - .AccessCode; - } - - /// - /// Retrieves a backup access code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). See also [Managing Backup Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes). - /// - /// A backup access code pool is a collection of pre-programmed access codes stored on a device, ready for use. These codes are programmed in addition to the regular access codes on Seam, serving as a safety net for any issues with the primary codes. If there's ever a complication with a primary access code—be it due to intermittent connectivity, manual removal from a device, or provider outages—a backup code can be retrieved. Its end time can then be adjusted to align with the original code, facilitating seamless and uninterrupted access. - /// - /// You can pull a backup access code from the pool at any time. These backup codes are guaranteed to work immediately and automatically programmed to be removed from the device after the access code ends. - /// - /// You can only pull backup access codes for time-bound access codes. - /// - /// Before pulling a backup access code, make sure that the device's `properties.supports_backup_access_code_pool` is `true`. Then, to activate the backup pool, set `use_backup_access_code_pool` to `true` when creating an access code. - /// - public async Task PullBackupAccessCodeAsync(string accessCodeId = default) - { - return ( - await PullBackupAccessCodeAsync( - new PullBackupAccessCodeRequest(accessCodeId: accessCodeId) - ) - ); - } - - /// - /// Request parameters for Report Device Access Code Constraints. - /// - [DataContract(Name = "reportDeviceConstraintsRequest_request")] - public class ReportDeviceConstraintsRequest - { - [JsonConstructorAttribute] - protected ReportDeviceConstraintsRequest() { } - - public ReportDeviceConstraintsRequest( - string deviceId = default, - int? maxCodeLength = default, - int? minCodeLength = default, - List? supportedCodeLengths = default - ) - { - DeviceId = deviceId; - MaxCodeLength = maxCodeLength; - MinCodeLength = minCodeLength; - SupportedCodeLengths = supportedCodeLengths; - } - - /// - /// ID of the device for which you want to report constraints. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Maximum supported code length as an integer between 4 and 20, inclusive. You can specify either `min_code_length`/`max_code_length` or `supported_code_lengths`. - /// - [DataMember(Name = "max_code_length", IsRequired = false, EmitDefaultValue = false)] - public int? MaxCodeLength { get; set; } - - /// - /// Minimum supported code length as an integer between 4 and 20, inclusive. You can specify either `min_code_length`/`max_code_length` or `supported_code_lengths`. - /// - [DataMember(Name = "min_code_length", IsRequired = false, EmitDefaultValue = false)] - public int? MinCodeLength { get; set; } - - /// - /// Array of supported code lengths as integers between 4 and 20, inclusive. You can specify either `supported_code_lengths` or `min_code_length`/`max_code_length`. - /// - [DataMember( - Name = "supported_code_lengths", - IsRequired = false, - EmitDefaultValue = false - )] - public List? SupportedCodeLengths { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Enables you to report access code-related constraints for a device. Currently, supports reporting supported code length constraints for SmartThings devices. - /// - /// Specify either `supported_code_lengths` or `min_code_length`/`max_code_length`. - /// - public void ReportDeviceConstraints(ReportDeviceConstraintsRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/access_codes/report_device_constraints", requestOptions); - } - - /// - /// Enables you to report access code-related constraints for a device. Currently, supports reporting supported code length constraints for SmartThings devices. - /// - /// Specify either `supported_code_lengths` or `min_code_length`/`max_code_length`. - /// - public void ReportDeviceConstraints( - string deviceId = default, - int? maxCodeLength = default, - int? minCodeLength = default, - List? supportedCodeLengths = default - ) - { - ReportDeviceConstraints( - new ReportDeviceConstraintsRequest( - deviceId: deviceId, - maxCodeLength: maxCodeLength, - minCodeLength: minCodeLength, - supportedCodeLengths: supportedCodeLengths - ) - ); - } - - /// - /// Enables you to report access code-related constraints for a device. Currently, supports reporting supported code length constraints for SmartThings devices. - /// - /// Specify either `supported_code_lengths` or `min_code_length`/`max_code_length`. - /// - public async Task ReportDeviceConstraintsAsync(ReportDeviceConstraintsRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/access_codes/report_device_constraints", - requestOptions - ); - } - - /// - /// Enables you to report access code-related constraints for a device. Currently, supports reporting supported code length constraints for SmartThings devices. - /// - /// Specify either `supported_code_lengths` or `min_code_length`/`max_code_length`. - /// - public async Task ReportDeviceConstraintsAsync( - string deviceId = default, - int? maxCodeLength = default, - int? minCodeLength = default, - List? supportedCodeLengths = default - ) - { - await ReportDeviceConstraintsAsync( - new ReportDeviceConstraintsRequest( - deviceId: deviceId, - maxCodeLength: maxCodeLength, - minCodeLength: minCodeLength, - supportedCodeLengths: supportedCodeLengths - ) - ); - } - - /// - /// Request parameters for Update an Access Code. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string accessCodeId = default, - bool? allowExternalModification = default, - bool? attemptForOfflineDevice = default, - string? code = default, - string? deviceId = default, - string? endsAt = default, - bool? isExternalModificationAllowed = default, - bool? isManaged = default, - string? name = default, - string? startsAt = default, - UpdateRequest.TypeEnum? type = default - ) - { - AccessCodeId = accessCodeId; - AllowExternalModification = allowExternalModification; - AttemptForOfflineDevice = attemptForOfflineDevice; - Code = code; - DeviceId = deviceId; - EndsAt = endsAt; - IsExternalModificationAllowed = isExternalModificationAllowed; - IsManaged = isManaged; - Name = name; - StartsAt = startsAt; - Type = type; - } - - /// - /// Type to which you want to convert the access code. To convert a time-bound access code to an ongoing access code, set `type` to `ongoing`. See also [Changing a time-bound access code to permanent access](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes#special-case-2-changing-a-time-bound-access-code-to-permanent-access). - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum TypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "ongoing")] - Ongoing = 1, - - [EnumMember(Value = "time_bound")] - TimeBound = 2, - } - - /// - /// ID of the access code that you want to update. - /// - [DataMember(Name = "access_code_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. - /// - [DataMember( - Name = "allow_external_modification", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AllowExternalModification { get; set; } - - [DataMember( - Name = "attempt_for_offline_device", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AttemptForOfflineDevice { get; set; } - - /// - /// Code to be used for access. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// ID of the device containing the access code that you want to update. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. - /// - [DataMember( - Name = "is_external_modification_allowed", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsExternalModificationAllowed { get; set; } - - /// - /// Indicates whether the access code is managed through Seam. Note that to convert an unmanaged access code into a managed access code, use `/access_codes/unmanaged/convert_to_managed`. - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsManaged { get; set; } - - /// - /// Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. - /// - /// Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. - /// - /// To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. - /// - /// To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Type to which you want to convert the access code. To convert a time-bound access code to an ongoing access code, set `type` to `ongoing`. See also [Changing a time-bound access code to permanent access](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes#special-case-2-changing-a-time-bound-access-code-to-permanent-access). - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public UpdateRequest.TypeEnum? Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a specified active or upcoming [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// See also [Modifying Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/access_codes/update", requestOptions); - } - - /// - /// Updates a specified active or upcoming [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// See also [Modifying Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes). - /// - public void Update( - string accessCodeId = default, - bool? allowExternalModification = default, - bool? attemptForOfflineDevice = default, - string? code = default, - string? deviceId = default, - string? endsAt = default, - bool? isExternalModificationAllowed = default, - bool? isManaged = default, - string? name = default, - string? startsAt = default, - UpdateRequest.TypeEnum? type = default - ) - { - Update( - new UpdateRequest( - accessCodeId: accessCodeId, - allowExternalModification: allowExternalModification, - attemptForOfflineDevice: attemptForOfflineDevice, - code: code, - deviceId: deviceId, - endsAt: endsAt, - isExternalModificationAllowed: isExternalModificationAllowed, - isManaged: isManaged, - name: name, - startsAt: startsAt, - type: type - ) - ); - } - - /// - /// Updates a specified active or upcoming [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// See also [Modifying Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/access_codes/update", requestOptions); - } - - /// - /// Updates a specified active or upcoming [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// See also [Modifying Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes). - /// - public async Task UpdateAsync( - string accessCodeId = default, - bool? allowExternalModification = default, - bool? attemptForOfflineDevice = default, - string? code = default, - string? deviceId = default, - string? endsAt = default, - bool? isExternalModificationAllowed = default, - bool? isManaged = default, - string? name = default, - string? startsAt = default, - UpdateRequest.TypeEnum? type = default - ) - { - await UpdateAsync( - new UpdateRequest( - accessCodeId: accessCodeId, - allowExternalModification: allowExternalModification, - attemptForOfflineDevice: attemptForOfflineDevice, - code: code, - deviceId: deviceId, - endsAt: endsAt, - isExternalModificationAllowed: isExternalModificationAllowed, - isManaged: isManaged, - name: name, - startsAt: startsAt, - type: type - ) - ); - } - - /// - /// Request parameters for Update Multiple Linked Access Codes. - /// - [DataContract(Name = "updateMultipleRequest_request")] - public class UpdateMultipleRequest - { - [JsonConstructorAttribute] - protected UpdateMultipleRequest() { } - - public UpdateMultipleRequest( - string commonCodeKey = default, - string? endsAt = default, - string? name = default, - string? startsAt = default - ) - { - CommonCodeKey = commonCodeKey; - EndsAt = endsAt; - Name = name; - StartsAt = startsAt; - } - - /// - /// Key that links the group of access codes, assigned on creation by `/access_codes/create_multiple`. - /// - [DataMember(Name = "common_code_key", IsRequired = true, EmitDefaultValue = false)] - public string CommonCodeKey { get; set; } - - /// - /// Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. - /// - /// Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. - /// - /// To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. - /// - /// To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. - /// - /// Specify the `common_code_key` to identify the set of access codes that you want to update. - /// - /// See also [Update Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes#update-linked-access-codes). - /// - public void UpdateMultiple(UpdateMultipleRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/access_codes/update_multiple", requestOptions); - } - - /// - /// Updates [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. - /// - /// Specify the `common_code_key` to identify the set of access codes that you want to update. - /// - /// See also [Update Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes#update-linked-access-codes). - /// - public void UpdateMultiple( - string commonCodeKey = default, - string? endsAt = default, - string? name = default, - string? startsAt = default - ) - { - UpdateMultiple( - new UpdateMultipleRequest( - commonCodeKey: commonCodeKey, - endsAt: endsAt, - name: name, - startsAt: startsAt - ) - ); - } - - /// - /// Updates [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. - /// - /// Specify the `common_code_key` to identify the set of access codes that you want to update. - /// - /// See also [Update Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes#update-linked-access-codes). - /// - public async Task UpdateMultipleAsync(UpdateMultipleRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/access_codes/update_multiple", requestOptions); - } - - /// - /// Updates [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. - /// - /// Specify the `common_code_key` to identify the set of access codes that you want to update. - /// - /// See also [Update Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes#update-linked-access-codes). - /// - public async Task UpdateMultipleAsync( - string commonCodeKey = default, - string? endsAt = default, - string? name = default, - string? startsAt = default - ) - { - await UpdateMultipleAsync( - new UpdateMultipleRequest( - commonCodeKey: commonCodeKey, - endsAt: endsAt, - name: name, - startsAt: startsAt - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.AccessCodes AccessCodes => new(this); - } - - public partial interface ISeamClient - { - public Api.AccessCodes AccessCodes { get; } - } -} diff --git a/src/Seam/Api/AccessGrants.cs b/src/Seam/Api/AccessGrants.cs deleted file mode 100644 index f3eb6a9b..00000000 --- a/src/Seam/Api/AccessGrants.cs +++ /dev/null @@ -1,1629 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class AccessGrants - { - private ISeamClient _seam; - - public AccessGrants(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create an Access Grant. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - string? userIdentityId = default, - CreateRequestUserIdentity? userIdentity = default, - string? accessGrantKey = default, - List? acsEntranceIds = default, - string? customizationProfileId = default, - List? deviceIds = default, - string? endsAt = default, - CreateRequestLocation? location = default, - List? locationIds = default, - string? name = default, - List requestedAccessMethods = default, - string? reservationKey = default, - List? spaceIds = default, - List? spaceKeys = default, - string? startsAt = default - ) - { - UserIdentityId = userIdentityId; - UserIdentity = userIdentity; - AccessGrantKey = accessGrantKey; - AcsEntranceIds = acsEntranceIds; - CustomizationProfileId = customizationProfileId; - DeviceIds = deviceIds; - EndsAt = endsAt; - Location = location; - LocationIds = locationIds; - Name = name; - RequestedAccessMethods = requestedAccessMethods; - ReservationKey = reservationKey; - SpaceIds = spaceIds; - SpaceKeys = spaceKeys; - StartsAt = startsAt; - } - - /// - /// ID of user identity for whom access is being granted. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// When used, creates a new user identity with the given details, and grants them access. - /// - [DataMember(Name = "user_identity", IsRequired = false, EmitDefaultValue = false)] - public CreateRequestUserIdentity? UserIdentity { get; set; } - - /// - /// Unique key for the access grant within the workspace. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// Set of IDs of the [entrances](https://docs.seam.co/api/acs/systems/list) to which access is being granted. - /// - [DataMember(Name = "acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AcsEntranceIds { get; set; } - - /// - /// ID of the customization profile to apply to the Access Grant and its access methods. - /// - [DataMember( - Name = "customization_profile_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomizationProfileId { get; set; } - - /// - /// Set of IDs of the [devices](https://docs.seam.co/api/devices/list) to which access is being granted. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceIds { get; set; } - - /// - /// Date and time at which the validity of the new grant ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - [Obsolete("Create a space first, then reference it using `space_ids`.")] - [DataMember(Name = "location", IsRequired = false, EmitDefaultValue = false)] - public CreateRequestLocation? Location { get; set; } - - [Obsolete("Use `space_ids`.")] - [DataMember(Name = "location_ids", IsRequired = false, EmitDefaultValue = false)] - public List? LocationIds { get; set; } - - /// - /// Name for the access grant. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - [DataMember( - Name = "requested_access_methods", - IsRequired = true, - EmitDefaultValue = false - )] - public List RequestedAccessMethods { get; set; } - - /// - /// Reservation key for the access grant. - /// - [DataMember(Name = "reservation_key", IsRequired = false, EmitDefaultValue = false)] - public string? ReservationKey { get; set; } - - /// - /// Set of IDs of existing spaces to which access is being granted. - /// - [DataMember(Name = "space_ids", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceIds { get; set; } - - /// - /// Set of keys of existing spaces to which access is being granted. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// Date and time at which the validity of the new grant starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestUserIdentity_model")] - public class CreateRequestUserIdentity - { - [JsonConstructorAttribute] - protected CreateRequestUserIdentity() { } - - public CreateRequestUserIdentity( - string? emailAddress = default, - string? fullName = default, - string? phoneNumber = default, - string? userIdentityKey = default - ) - { - EmailAddress = emailAddress; - FullName = fullName; - PhoneNumber = phoneNumber; - UserIdentityKey = userIdentityKey; - } - - /// - /// Unique email address for the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Full name of the user associated with the user identity. - /// - [DataMember(Name = "full_name", IsRequired = false, EmitDefaultValue = false)] - public string? FullName { get; set; } - - /// - /// Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Unique key for the user identity. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestLocation_model")] - public class CreateRequestLocation - { - [JsonConstructorAttribute] - protected CreateRequestLocation() { } - - public CreateRequestLocation( - List? acsEntranceIds = default, - List? deviceIds = default, - string? name = default - ) - { - AcsEntranceIds = acsEntranceIds; - DeviceIds = deviceIds; - Name = name; - } - - [Obsolete("Use `acs_entrance_ids` at the top level.")] - [DataMember(Name = "acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AcsEntranceIds { get; set; } - - [Obsolete("Use `device_ids` at the top level.")] - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceIds { get; set; } - - /// - /// Name of the location. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestRequestedAccessMethods_model")] - public class CreateRequestRequestedAccessMethods - { - [JsonConstructorAttribute] - protected CreateRequestRequestedAccessMethods() { } - - public CreateRequestRequestedAccessMethods( - string? code = default, - int? instantKeyMaxUseCount = default, - CreateRequestRequestedAccessMethods.ModeEnum? mode = default - ) - { - Code = code; - InstantKeyMaxUseCount = instantKeyMaxUseCount; - Mode = mode; - } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// Specific PIN code to use for this access method. Only applicable when mode is 'code'. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Maximum number of times the instant key can be used. Only applicable when mode is 'mobile_key'. Defaults to 1 if not specified. - /// - [DataMember( - Name = "instant_key_max_use_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int? InstantKeyMaxUseCount { get; set; } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "mode", IsRequired = false, EmitDefaultValue = false)] - public CreateRequestRequestedAccessMethods.ModeEnum? Mode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(AccessGrant accessGrant = default) - { - AccessGrant = accessGrant; - } - - /// - /// OK - /// - [DataMember(Name = "access_grant", IsRequired = false, EmitDefaultValue = false)] - public AccessGrant AccessGrant { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [Access Grant](https://docs.seam.co/use-cases/granting-access/access-grants). Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using `device_ids`) and access control systems (using `acs_entrance_ids` or `space_ids`), and can issue PIN codes, key cards, and mobile keys through a single request. - /// - public AccessGrant Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/access_grants/create", requestOptions) - .EnsureData("/access_grants/create") - .AccessGrant; - } - - /// - /// Creates a new [Access Grant](https://docs.seam.co/use-cases/granting-access/access-grants). Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using `device_ids`) and access control systems (using `acs_entrance_ids` or `space_ids`), and can issue PIN codes, key cards, and mobile keys through a single request. - /// - public AccessGrant Create( - string? userIdentityId = default, - CreateRequestUserIdentity? userIdentity = default, - string? accessGrantKey = default, - List? acsEntranceIds = default, - string? customizationProfileId = default, - List? deviceIds = default, - string? endsAt = default, - CreateRequestLocation? location = default, - List? locationIds = default, - string? name = default, - List requestedAccessMethods = default, - string? reservationKey = default, - List? spaceIds = default, - List? spaceKeys = default, - string? startsAt = default - ) - { - return Create( - new CreateRequest( - userIdentityId: userIdentityId, - userIdentity: userIdentity, - accessGrantKey: accessGrantKey, - acsEntranceIds: acsEntranceIds, - customizationProfileId: customizationProfileId, - deviceIds: deviceIds, - endsAt: endsAt, - location: location, - locationIds: locationIds, - name: name, - requestedAccessMethods: requestedAccessMethods, - reservationKey: reservationKey, - spaceIds: spaceIds, - spaceKeys: spaceKeys, - startsAt: startsAt - ) - ); - } - - /// - /// Creates a new [Access Grant](https://docs.seam.co/use-cases/granting-access/access-grants). Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using `device_ids`) and access control systems (using `acs_entrance_ids` or `space_ids`), and can issue PIN codes, key cards, and mobile keys through a single request. - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/access_grants/create", requestOptions)) - .EnsureData("/access_grants/create") - .AccessGrant; - } - - /// - /// Creates a new [Access Grant](https://docs.seam.co/use-cases/granting-access/access-grants). Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using `device_ids`) and access control systems (using `acs_entrance_ids` or `space_ids`), and can issue PIN codes, key cards, and mobile keys through a single request. - /// - public async Task CreateAsync( - string? userIdentityId = default, - CreateRequestUserIdentity? userIdentity = default, - string? accessGrantKey = default, - List? acsEntranceIds = default, - string? customizationProfileId = default, - List? deviceIds = default, - string? endsAt = default, - CreateRequestLocation? location = default, - List? locationIds = default, - string? name = default, - List requestedAccessMethods = default, - string? reservationKey = default, - List? spaceIds = default, - List? spaceKeys = default, - string? startsAt = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - userIdentityId: userIdentityId, - userIdentity: userIdentity, - accessGrantKey: accessGrantKey, - acsEntranceIds: acsEntranceIds, - customizationProfileId: customizationProfileId, - deviceIds: deviceIds, - endsAt: endsAt, - location: location, - locationIds: locationIds, - name: name, - requestedAccessMethods: requestedAccessMethods, - reservationKey: reservationKey, - spaceIds: spaceIds, - spaceKeys: spaceKeys, - startsAt: startsAt - ) - ) - ); - } - - /// - /// Request parameters for Delete an Access Grant. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string accessGrantId = default) - { - AccessGrantId = accessGrantId; - } - - /// - /// ID of Access Grant to delete. - /// - [DataMember(Name = "access_grant_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Delete an Access Grant. - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/access_grants/delete", requestOptions); - } - - /// - /// Delete an Access Grant. - /// - public void Delete(string accessGrantId = default) - { - Delete(new DeleteRequest(accessGrantId: accessGrantId)); - } - - /// - /// Delete an Access Grant. - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/access_grants/delete", requestOptions); - } - - /// - /// Delete an Access Grant. - /// - public async Task DeleteAsync(string accessGrantId = default) - { - await DeleteAsync(new DeleteRequest(accessGrantId: accessGrantId)); - } - - /// - /// Request parameters for Get an Access Grant. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string? accessGrantId = default, string? accessGrantKey = default) - { - AccessGrantId = accessGrantId; - AccessGrantKey = accessGrantKey; - } - - /// - /// ID of Access Grant to get. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantId { get; set; } - - /// - /// Unique key of Access Grant to get. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(AccessGrant accessGrant = default) - { - AccessGrant = accessGrant; - } - - /// - /// OK - /// - [DataMember(Name = "access_grant", IsRequired = false, EmitDefaultValue = false)] - public AccessGrant AccessGrant { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Get an Access Grant. - /// - public AccessGrant Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_grants/get", requestOptions) - .EnsureData("/access_grants/get") - .AccessGrant; - } - - /// - /// Get an Access Grant. - /// - public AccessGrant Get(string? accessGrantId = default, string? accessGrantKey = default) - { - return Get( - new GetRequest(accessGrantId: accessGrantId, accessGrantKey: accessGrantKey) - ); - } - - /// - /// Get an Access Grant. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/access_grants/get", requestOptions)) - .EnsureData("/access_grants/get") - .AccessGrant; - } - - /// - /// Get an Access Grant. - /// - public async Task GetAsync( - string? accessGrantId = default, - string? accessGrantKey = default - ) - { - return ( - await GetAsync( - new GetRequest(accessGrantId: accessGrantId, accessGrantKey: accessGrantKey) - ) - ); - } - - /// - /// Request parameters for Get related Access Grant resources. - /// - [DataContract(Name = "getRelatedRequest_request")] - public class GetRelatedRequest - { - [JsonConstructorAttribute] - protected GetRelatedRequest() { } - - public GetRelatedRequest( - List? accessGrantIds = default, - List? accessGrantKeys = default, - List? exclude = default, - List? include = default - ) - { - AccessGrantIds = accessGrantIds; - AccessGrantKeys = accessGrantKeys; - Exclude = exclude; - Include = include; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExcludeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "spaces")] - Spaces = 1, - - [EnumMember(Value = "devices")] - Devices = 2, - - [EnumMember(Value = "acs_entrances")] - AcsEntrances = 3, - - [EnumMember(Value = "connected_accounts")] - ConnectedAccounts = 4, - - [EnumMember(Value = "acs_systems")] - AcsSystems = 5, - - [EnumMember(Value = "user_identities")] - UserIdentities = 6, - - [EnumMember(Value = "acs_access_groups")] - AcsAccessGroups = 7, - - [EnumMember(Value = "access_methods")] - AccessMethods = 8, - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum IncludeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "spaces")] - Spaces = 1, - - [EnumMember(Value = "devices")] - Devices = 2, - - [EnumMember(Value = "acs_entrances")] - AcsEntrances = 3, - - [EnumMember(Value = "connected_accounts")] - ConnectedAccounts = 4, - - [EnumMember(Value = "acs_systems")] - AcsSystems = 5, - - [EnumMember(Value = "user_identities")] - UserIdentities = 6, - - [EnumMember(Value = "acs_access_groups")] - AcsAccessGroups = 7, - - [EnumMember(Value = "access_methods")] - AccessMethods = 8, - } - - /// - /// IDs of the access grants that you want to get along with their related resources. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantIds { get; set; } - - /// - /// Keys of the access grants that you want to get along with their related resources. - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - [DataMember(Name = "exclude", IsRequired = false, EmitDefaultValue = false)] - public List? Exclude { get; set; } - - [DataMember(Name = "include", IsRequired = false, EmitDefaultValue = false)] - public List? Include { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getRelatedResponse_response")] - public class GetRelatedResponse - { - [JsonConstructorAttribute] - protected GetRelatedResponse() { } - - public GetRelatedResponse(Batch batch = default) - { - Batch = batch; - } - - /// - /// OK - /// - [DataMember(Name = "batch", IsRequired = false, EmitDefaultValue = false)] - public Batch Batch { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets all related resources for one or more Access Grants. - /// - public Batch GetRelated(GetRelatedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_grants/get_related", requestOptions) - .EnsureData("/access_grants/get_related") - .Batch; - } - - /// - /// Gets all related resources for one or more Access Grants. - /// - public Batch GetRelated( - List? accessGrantIds = default, - List? accessGrantKeys = default, - List? exclude = default, - List? include = default - ) - { - return GetRelated( - new GetRelatedRequest( - accessGrantIds: accessGrantIds, - accessGrantKeys: accessGrantKeys, - exclude: exclude, - include: include - ) - ); - } - - /// - /// Gets all related resources for one or more Access Grants. - /// - public async Task GetRelatedAsync(GetRelatedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/access_grants/get_related", - requestOptions - ) - ) - .EnsureData("/access_grants/get_related") - .Batch; - } - - /// - /// Gets all related resources for one or more Access Grants. - /// - public async Task GetRelatedAsync( - List? accessGrantIds = default, - List? accessGrantKeys = default, - List? exclude = default, - List? include = default - ) - { - return ( - await GetRelatedAsync( - new GetRelatedRequest( - accessGrantIds: accessGrantIds, - accessGrantKeys: accessGrantKeys, - exclude: exclude, - include: include - ) - ) - ); - } - - /// - /// Request parameters for List Access Grants. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? accessCodeId = default, - List? accessGrantIds = default, - string? accessGrantKey = default, - string? acsEntranceId = default, - string? acsSystemId = default, - string? customerKey = default, - string? deviceId = default, - float? limit = default, - string? locationId = default, - string? pageCursor = default, - string? reservationKey = default, - string? spaceId = default, - string? userIdentityId = default - ) - { - AccessCodeId = accessCodeId; - AccessGrantIds = accessGrantIds; - AccessGrantKey = accessGrantKey; - AcsEntranceId = acsEntranceId; - AcsSystemId = acsSystemId; - CustomerKey = customerKey; - DeviceId = deviceId; - Limit = limit; - LocationId = locationId; - PageCursor = pageCursor; - ReservationKey = reservationKey; - SpaceId = spaceId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access code by which you want to filter the list of Access Grants. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessCodeId { get; set; } - - /// - /// IDs of the access grants to retrieve. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantIds { get; set; } - - /// - /// Filter Access Grants by access_grant_key. Use null to filter for Access Grants without an access_grant_key. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// ID of the entrance by which you want to filter the list of Access Grants. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsEntranceId { get; set; } - - /// - /// ID of the access system by which you want to filter the list of Access Grants. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// Customer key for which you want to list access grants. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// ID of the device by which you want to filter the list of Access Grants. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Numerical limit on the number of access grants to return. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } - - [Obsolete("Use `space_id`.")] - [DataMember(Name = "location_id", IsRequired = false, EmitDefaultValue = false)] - public string? LocationId { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// Filter Access Grants by reservation_key. - /// - [DataMember(Name = "reservation_key", IsRequired = false, EmitDefaultValue = false)] - public string? ReservationKey { get; set; } - - /// - /// ID of the space by which you want to filter the list of Access Grants. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceId { get; set; } - - /// - /// ID of user identity by which you want to filter the list of Access Grants. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List accessGrants = default) - { - AccessGrants = accessGrants; - } - - /// - /// OK - /// - [DataMember(Name = "access_grants", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrants { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets an Access Grant. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_grants/list", requestOptions) - .EnsureData("/access_grants/list") - .AccessGrants; - } - - /// - /// Gets an Access Grant. - /// - public List List( - string? accessCodeId = default, - List? accessGrantIds = default, - string? accessGrantKey = default, - string? acsEntranceId = default, - string? acsSystemId = default, - string? customerKey = default, - string? deviceId = default, - float? limit = default, - string? locationId = default, - string? pageCursor = default, - string? reservationKey = default, - string? spaceId = default, - string? userIdentityId = default - ) - { - return List( - new ListRequest( - accessCodeId: accessCodeId, - accessGrantIds: accessGrantIds, - accessGrantKey: accessGrantKey, - acsEntranceId: acsEntranceId, - acsSystemId: acsSystemId, - customerKey: customerKey, - deviceId: deviceId, - limit: limit, - locationId: locationId, - pageCursor: pageCursor, - reservationKey: reservationKey, - spaceId: spaceId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Gets an Access Grant. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/access_grants/list", requestOptions)) - .EnsureData("/access_grants/list") - .AccessGrants; - } - - /// - /// Gets an Access Grant. - /// - public async Task> ListAsync( - string? accessCodeId = default, - List? accessGrantIds = default, - string? accessGrantKey = default, - string? acsEntranceId = default, - string? acsSystemId = default, - string? customerKey = default, - string? deviceId = default, - float? limit = default, - string? locationId = default, - string? pageCursor = default, - string? reservationKey = default, - string? spaceId = default, - string? userIdentityId = default - ) - { - return ( - await ListAsync( - new ListRequest( - accessCodeId: accessCodeId, - accessGrantIds: accessGrantIds, - accessGrantKey: accessGrantKey, - acsEntranceId: acsEntranceId, - acsSystemId: acsSystemId, - customerKey: customerKey, - deviceId: deviceId, - limit: limit, - locationId: locationId, - pageCursor: pageCursor, - reservationKey: reservationKey, - spaceId: spaceId, - userIdentityId: userIdentityId - ) - ) - ); - } - - /// - /// Request parameters for Add Requested Access Methods to Access Grant. - /// - [DataContract(Name = "requestAccessMethodsRequest_request")] - public class RequestAccessMethodsRequest - { - [JsonConstructorAttribute] - protected RequestAccessMethodsRequest() { } - - public RequestAccessMethodsRequest( - string accessGrantId = default, - List requestedAccessMethods = - default - ) - { - AccessGrantId = accessGrantId; - RequestedAccessMethods = requestedAccessMethods; - } - - /// - /// ID of the Access Grant to add access methods to. - /// - [DataMember(Name = "access_grant_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// Array of requested access methods to add to the access grant. - /// - [DataMember( - Name = "requested_access_methods", - IsRequired = true, - EmitDefaultValue = false - )] - public List RequestedAccessMethods { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "requestAccessMethodsRequestRequestedAccessMethods_model")] - public class RequestAccessMethodsRequestRequestedAccessMethods - { - [JsonConstructorAttribute] - protected RequestAccessMethodsRequestRequestedAccessMethods() { } - - public RequestAccessMethodsRequestRequestedAccessMethods( - string? code = default, - int? instantKeyMaxUseCount = default, - RequestAccessMethodsRequestRequestedAccessMethods.ModeEnum? mode = default - ) - { - Code = code; - InstantKeyMaxUseCount = instantKeyMaxUseCount; - Mode = mode; - } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// Specific PIN code to use for this access method. Only applicable when mode is 'code'. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Maximum number of times the instant key can be used. Only applicable when mode is 'mobile_key'. Defaults to 1 if not specified. - /// - [DataMember( - Name = "instant_key_max_use_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int? InstantKeyMaxUseCount { get; set; } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "mode", IsRequired = false, EmitDefaultValue = false)] - public RequestAccessMethodsRequestRequestedAccessMethods.ModeEnum? Mode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "requestAccessMethodsResponse_response")] - public class RequestAccessMethodsResponse - { - [JsonConstructorAttribute] - protected RequestAccessMethodsResponse() { } - - public RequestAccessMethodsResponse(AccessGrant accessGrant = default) - { - AccessGrant = accessGrant; - } - - /// - /// OK - /// - [DataMember(Name = "access_grant", IsRequired = false, EmitDefaultValue = false)] - public AccessGrant AccessGrant { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Adds additional requested access methods to an existing Access Grant. - /// - public AccessGrant RequestAccessMethods(RequestAccessMethodsRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post( - "/access_grants/request_access_methods", - requestOptions - ) - .EnsureData("/access_grants/request_access_methods") - .AccessGrant; - } - - /// - /// Adds additional requested access methods to an existing Access Grant. - /// - public AccessGrant RequestAccessMethods( - string accessGrantId = default, - List requestedAccessMethods = default - ) - { - return RequestAccessMethods( - new RequestAccessMethodsRequest( - accessGrantId: accessGrantId, - requestedAccessMethods: requestedAccessMethods - ) - ); - } - - /// - /// Adds additional requested access methods to an existing Access Grant. - /// - public async Task RequestAccessMethodsAsync( - RequestAccessMethodsRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/access_grants/request_access_methods", - requestOptions - ) - ) - .EnsureData("/access_grants/request_access_methods") - .AccessGrant; - } - - /// - /// Adds additional requested access methods to an existing Access Grant. - /// - public async Task RequestAccessMethodsAsync( - string accessGrantId = default, - List requestedAccessMethods = default - ) - { - return ( - await RequestAccessMethodsAsync( - new RequestAccessMethodsRequest( - accessGrantId: accessGrantId, - requestedAccessMethods: requestedAccessMethods - ) - ) - ); - } - - /// - /// Request parameters for Update an Access Grant. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string? accessGrantId = default, - string? accessGrantKey = default, - string? endsAt = default, - string? name = default, - string? startsAt = default - ) - { - AccessGrantId = accessGrantId; - AccessGrantKey = accessGrantKey; - EndsAt = endsAt; - Name = name; - StartsAt = startsAt; - } - - /// - /// ID of the Access Grant to update. Provide either `access_grant_id` or `access_grant_key`. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantId { get; set; } - - /// - /// Key of the Access Grant to update. Provide either `access_grant_id` or `access_grant_key`. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// Date and time at which the validity of the grant ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Display name for the access grant. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Date and time at which the validity of the grant starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates an existing Access Grant's time window. - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/access_grants/update", requestOptions); - } - - /// - /// Updates an existing Access Grant's time window. - /// - public void Update( - string? accessGrantId = default, - string? accessGrantKey = default, - string? endsAt = default, - string? name = default, - string? startsAt = default - ) - { - Update( - new UpdateRequest( - accessGrantId: accessGrantId, - accessGrantKey: accessGrantKey, - endsAt: endsAt, - name: name, - startsAt: startsAt - ) - ); - } - - /// - /// Updates an existing Access Grant's time window. - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/access_grants/update", requestOptions); - } - - /// - /// Updates an existing Access Grant's time window. - /// - public async Task UpdateAsync( - string? accessGrantId = default, - string? accessGrantKey = default, - string? endsAt = default, - string? name = default, - string? startsAt = default - ) - { - await UpdateAsync( - new UpdateRequest( - accessGrantId: accessGrantId, - accessGrantKey: accessGrantKey, - endsAt: endsAt, - name: name, - startsAt: startsAt - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.AccessGrants AccessGrants => new(this); - } - - public partial interface ISeamClient - { - public Api.AccessGrants AccessGrants { get; } - } -} diff --git a/src/Seam/Api/AccessGroupsAcs.cs b/src/Seam/Api/AccessGroupsAcs.cs deleted file mode 100644 index 3b08fff4..00000000 --- a/src/Seam/Api/AccessGroupsAcs.cs +++ /dev/null @@ -1,885 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class AccessGroupsAcs - { - private ISeamClient _seam; - - public AccessGroupsAcs(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Add an ACS User to an Access Group. - /// - [DataContract(Name = "addUserRequest_request")] - public class AddUserRequest - { - [JsonConstructorAttribute] - protected AddUserRequest() { } - - public AddUserRequest( - string acsAccessGroupId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsAccessGroupId = acsAccessGroupId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access group to which you want to add an access system user. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - /// - /// ID of the access system user that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the desired user identity that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void AddUser(AddUserRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/acs/access_groups/add_user", requestOptions); - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void AddUser( - string acsAccessGroupId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AddUser( - new AddUserRequest( - acsAccessGroupId: acsAccessGroupId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task AddUserAsync(AddUserRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/acs/access_groups/add_user", requestOptions); - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task AddUserAsync( - string acsAccessGroupId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await AddUserAsync( - new AddUserRequest( - acsAccessGroupId: acsAccessGroupId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Request parameters for Delete an Access Group. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string acsAccessGroupId = default) - { - AcsAccessGroupId = acsAccessGroupId; - } - - /// - /// ID of the access group that you want to delete. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/acs/access_groups/delete", requestOptions); - } - - /// - /// Deletes a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void Delete(string acsAccessGroupId = default) - { - Delete(new DeleteRequest(acsAccessGroupId: acsAccessGroupId)); - } - - /// - /// Deletes a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/acs/access_groups/delete", requestOptions); - } - - /// - /// Deletes a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task DeleteAsync(string acsAccessGroupId = default) - { - await DeleteAsync(new DeleteRequest(acsAccessGroupId: acsAccessGroupId)); - } - - /// - /// Request parameters for Get an Access Group. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string acsAccessGroupId = default) - { - AcsAccessGroupId = acsAccessGroupId; - } - - /// - /// ID of the access group that you want to get. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(AcsAccessGroup acsAccessGroup = default) - { - AcsAccessGroup = acsAccessGroup; - } - - /// - /// OK - /// - [DataMember(Name = "acs_access_group", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroup AcsAccessGroup { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public AcsAccessGroup Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/access_groups/get", requestOptions) - .EnsureData("/acs/access_groups/get") - .AcsAccessGroup; - } - - /// - /// Returns a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public AcsAccessGroup Get(string acsAccessGroupId = default) - { - return Get(new GetRequest(acsAccessGroupId: acsAccessGroupId)); - } - - /// - /// Returns a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/access_groups/get", requestOptions)) - .EnsureData("/acs/access_groups/get") - .AcsAccessGroup; - } - - /// - /// Returns a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task GetAsync(string acsAccessGroupId = default) - { - return (await GetAsync(new GetRequest(acsAccessGroupId: acsAccessGroupId))); - } - - /// - /// Request parameters for List Access Groups. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? acsSystemId = default, - string? acsUserId = default, - string? search = default, - string? userIdentityId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - Search = search; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access system for which you want to retrieve all access groups. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user for which you want to retrieve all access groups. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// String for which to search. Filters returned access groups to include all records that satisfy a partial match using `name` or `acs_access_group_id`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// ID of the user identity for which you want to retrieve all access groups. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List acsAccessGroups = default) - { - AcsAccessGroups = acsAccessGroups; - } - - /// - /// OK - /// - [DataMember(Name = "acs_access_groups", IsRequired = false, EmitDefaultValue = false)] - public List AcsAccessGroups { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [access groups](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/access_groups/list", requestOptions) - .EnsureData("/acs/access_groups/list") - .AcsAccessGroups; - } - - /// - /// Returns a list of all [access groups](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public List List( - string? acsSystemId = default, - string? acsUserId = default, - string? search = default, - string? userIdentityId = default - ) - { - return List( - new ListRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - search: search, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Returns a list of all [access groups](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/access_groups/list", requestOptions)) - .EnsureData("/acs/access_groups/list") - .AcsAccessGroups; - } - - /// - /// Returns a list of all [access groups](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task> ListAsync( - string? acsSystemId = default, - string? acsUserId = default, - string? search = default, - string? userIdentityId = default - ) - { - return ( - await ListAsync( - new ListRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - search: search, - userIdentityId: userIdentityId - ) - ) - ); - } - - /// - /// Request parameters for List Entrances Accessible to an Access Group. - /// - [DataContract(Name = "listAccessibleEntrancesRequest_request")] - public class ListAccessibleEntrancesRequest - { - [JsonConstructorAttribute] - protected ListAccessibleEntrancesRequest() { } - - public ListAccessibleEntrancesRequest(string acsAccessGroupId = default) - { - AcsAccessGroupId = acsAccessGroupId; - } - - /// - /// ID of the access group for which you want to retrieve all accessible entrances. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listAccessibleEntrancesResponse_response")] - public class ListAccessibleEntrancesResponse - { - [JsonConstructorAttribute] - protected ListAccessibleEntrancesResponse() { } - - public ListAccessibleEntrancesResponse(List acsEntrances = default) - { - AcsEntrances = acsEntrances; - } - - /// - /// OK - /// - [DataMember(Name = "acs_entrances", IsRequired = false, EmitDefaultValue = false)] - public List AcsEntrances { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all accessible entrances for a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public List ListAccessibleEntrances(ListAccessibleEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get( - "/acs/access_groups/list_accessible_entrances", - requestOptions - ) - .EnsureData("/acs/access_groups/list_accessible_entrances") - .AcsEntrances; - } - - /// - /// Returns a list of all accessible entrances for a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public List ListAccessibleEntrances(string acsAccessGroupId = default) - { - return ListAccessibleEntrances( - new ListAccessibleEntrancesRequest(acsAccessGroupId: acsAccessGroupId) - ); - } - - /// - /// Returns a list of all accessible entrances for a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task> ListAccessibleEntrancesAsync( - ListAccessibleEntrancesRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/acs/access_groups/list_accessible_entrances", - requestOptions - ) - ) - .EnsureData("/acs/access_groups/list_accessible_entrances") - .AcsEntrances; - } - - /// - /// Returns a list of all accessible entrances for a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task> ListAccessibleEntrancesAsync( - string acsAccessGroupId = default - ) - { - return ( - await ListAccessibleEntrancesAsync( - new ListAccessibleEntrancesRequest(acsAccessGroupId: acsAccessGroupId) - ) - ); - } - - /// - /// Request parameters for List ACS Users in an Access Group. - /// - [DataContract(Name = "listUsersRequest_request")] - public class ListUsersRequest - { - [JsonConstructorAttribute] - protected ListUsersRequest() { } - - public ListUsersRequest(string acsAccessGroupId = default) - { - AcsAccessGroupId = acsAccessGroupId; - } - - /// - /// ID of the access group for which you want to retrieve all access system users. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listUsersResponse_response")] - public class ListUsersResponse - { - [JsonConstructorAttribute] - protected ListUsersResponse() { } - - public ListUsersResponse(List acsUsers = default) - { - AcsUsers = acsUsers; - } - - /// - /// OK - /// - [DataMember(Name = "acs_users", IsRequired = false, EmitDefaultValue = false)] - public List AcsUsers { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public List ListUsers(ListUsersRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/access_groups/list_users", requestOptions) - .EnsureData("/acs/access_groups/list_users") - .AcsUsers; - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public List ListUsers(string acsAccessGroupId = default) - { - return ListUsers(new ListUsersRequest(acsAccessGroupId: acsAccessGroupId)); - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task> ListUsersAsync(ListUsersRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/acs/access_groups/list_users", - requestOptions - ) - ) - .EnsureData("/acs/access_groups/list_users") - .AcsUsers; - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task> ListUsersAsync(string acsAccessGroupId = default) - { - return (await ListUsersAsync(new ListUsersRequest(acsAccessGroupId: acsAccessGroupId))); - } - - /// - /// Request parameters for Remove an ACS User from an Access Group. - /// - [DataContract(Name = "removeUserRequest_request")] - public class RemoveUserRequest - { - [JsonConstructorAttribute] - protected RemoveUserRequest() { } - - public RemoveUserRequest( - string acsAccessGroupId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsAccessGroupId = acsAccessGroupId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access group from which you want to remove an access system user. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - /// - /// ID of the access system user that you want to remove from an access group. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity associated with the user that you want to remove from an access group. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void RemoveUser(RemoveUserRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/acs/access_groups/remove_user", requestOptions); - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void RemoveUser( - string acsAccessGroupId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - RemoveUser( - new RemoveUserRequest( - acsAccessGroupId: acsAccessGroupId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task RemoveUserAsync(RemoveUserRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/acs/access_groups/remove_user", requestOptions); - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task RemoveUserAsync( - string acsAccessGroupId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await RemoveUserAsync( - new RemoveUserRequest( - acsAccessGroupId: acsAccessGroupId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.AccessGroupsAcs AccessGroupsAcs => new(this); - } - - public partial interface ISeamClient - { - public Api.AccessGroupsAcs AccessGroupsAcs { get; } - } -} diff --git a/src/Seam/Api/AccessMethods.cs b/src/Seam/Api/AccessMethods.cs deleted file mode 100644 index 6e3f949d..00000000 --- a/src/Seam/Api/AccessMethods.cs +++ /dev/null @@ -1,1127 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class AccessMethods - { - private ISeamClient _seam; - - public AccessMethods(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Assign a Card Credential to an Access Method. - /// - [DataContract(Name = "assignCardRequest_request")] - public class AssignCardRequest - { - [JsonConstructorAttribute] - protected AssignCardRequest() { } - - public AssignCardRequest(string accessMethodId = default, string cardNumber = default) - { - AccessMethodId = accessMethodId; - CardNumber = cardNumber; - } - - /// - /// ID of the `access_method` to assign the credential to. - /// - [DataMember(Name = "access_method_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// Card number of the credential to assign. - /// - [DataMember(Name = "card_number", IsRequired = true, EmitDefaultValue = false)] - public string CardNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "assignCardResponse_response")] - public class AssignCardResponse - { - [JsonConstructorAttribute] - protected AssignCardResponse() { } - - public AssignCardResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Assigns a pre-registered card credential, identified by `card_number`, to a card-mode access method. Use this endpoint for access systems that use pre-registered cards, where a physical card must be associated with an access method before it can be used for access. Assigning a card credential also triggers issuance of the access method. - /// - public ActionAttempt AssignCard(AssignCardRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/access_methods/assign_card", requestOptions) - .EnsureData("/access_methods/assign_card") - .ActionAttempt; - } - - /// - /// Assigns a pre-registered card credential, identified by `card_number`, to a card-mode access method. Use this endpoint for access systems that use pre-registered cards, where a physical card must be associated with an access method before it can be used for access. Assigning a card credential also triggers issuance of the access method. - /// - public ActionAttempt AssignCard( - string accessMethodId = default, - string cardNumber = default - ) - { - return AssignCard( - new AssignCardRequest(accessMethodId: accessMethodId, cardNumber: cardNumber) - ); - } - - /// - /// Assigns a pre-registered card credential, identified by `card_number`, to a card-mode access method. Use this endpoint for access systems that use pre-registered cards, where a physical card must be associated with an access method before it can be used for access. Assigning a card credential also triggers issuance of the access method. - /// - public async Task AssignCardAsync(AssignCardRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/access_methods/assign_card", - requestOptions - ) - ) - .EnsureData("/access_methods/assign_card") - .ActionAttempt; - } - - /// - /// Assigns a pre-registered card credential, identified by `card_number`, to a card-mode access method. Use this endpoint for access systems that use pre-registered cards, where a physical card must be associated with an access method before it can be used for access. Assigning a card credential also triggers issuance of the access method. - /// - public async Task AssignCardAsync( - string accessMethodId = default, - string cardNumber = default - ) - { - return ( - await AssignCardAsync( - new AssignCardRequest(accessMethodId: accessMethodId, cardNumber: cardNumber) - ) - ); - } - - /// - /// Request parameters for Delete an Access Method. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest( - string? accessMethodId = default, - string? accessGrantId = default, - string? reservationKey = default - ) - { - AccessMethodId = accessMethodId; - AccessGrantId = accessGrantId; - ReservationKey = reservationKey; - } - - /// - /// ID of access method to delete. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessMethodId { get; set; } - - /// - /// ID of access grant whose access methods should be deleted. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantId { get; set; } - - /// - /// Reservation key of the access grant whose access methods should be deleted. - /// - [DataMember(Name = "reservation_key", IsRequired = false, EmitDefaultValue = false)] - public string? ReservationKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes an access method. - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/access_methods/delete", requestOptions); - } - - /// - /// Deletes an access method. - /// - public void Delete( - string? accessMethodId = default, - string? accessGrantId = default, - string? reservationKey = default - ) - { - Delete( - new DeleteRequest( - accessMethodId: accessMethodId, - accessGrantId: accessGrantId, - reservationKey: reservationKey - ) - ); - } - - /// - /// Deletes an access method. - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/access_methods/delete", requestOptions); - } - - /// - /// Deletes an access method. - /// - public async Task DeleteAsync( - string? accessMethodId = default, - string? accessGrantId = default, - string? reservationKey = default - ) - { - await DeleteAsync( - new DeleteRequest( - accessMethodId: accessMethodId, - accessGrantId: accessGrantId, - reservationKey: reservationKey - ) - ); - } - - /// - /// Request parameters for Encode an Access Method. - /// - [DataContract(Name = "encodeRequest_request")] - public class EncodeRequest - { - [JsonConstructorAttribute] - protected EncodeRequest() { } - - public EncodeRequest(string accessMethodId = default, string acsEncoderId = default) - { - AccessMethodId = accessMethodId; - AcsEncoderId = acsEncoderId; - } - - /// - /// ID of the `access_method` to encode onto a card. - /// - [DataMember(Name = "access_method_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// ID of the `acs_encoder` to use to encode the `access_method`. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "encodeResponse_response")] - public class EncodeResponse - { - [JsonConstructorAttribute] - protected EncodeResponse() { } - - public EncodeResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Encodes an existing access method onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public ActionAttempt Encode(EncodeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/access_methods/encode", requestOptions) - .EnsureData("/access_methods/encode") - .ActionAttempt; - } - - /// - /// Encodes an existing access method onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public ActionAttempt Encode(string accessMethodId = default, string acsEncoderId = default) - { - return Encode( - new EncodeRequest(accessMethodId: accessMethodId, acsEncoderId: acsEncoderId) - ); - } - - /// - /// Encodes an existing access method onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public async Task EncodeAsync(EncodeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/access_methods/encode", requestOptions)) - .EnsureData("/access_methods/encode") - .ActionAttempt; - } - - /// - /// Encodes an existing access method onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public async Task EncodeAsync( - string accessMethodId = default, - string acsEncoderId = default - ) - { - return ( - await EncodeAsync( - new EncodeRequest(accessMethodId: accessMethodId, acsEncoderId: acsEncoderId) - ) - ); - } - - /// - /// Request parameters for Get an Access Method. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string accessMethodId = default) - { - AccessMethodId = accessMethodId; - } - - /// - /// ID of access method to get. - /// - [DataMember(Name = "access_method_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(AccessMethod accessMethod = default) - { - AccessMethod = accessMethod; - } - - /// - /// OK - /// - [DataMember(Name = "access_method", IsRequired = false, EmitDefaultValue = false)] - public AccessMethod AccessMethod { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets an access method. - /// - public AccessMethod Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_methods/get", requestOptions) - .EnsureData("/access_methods/get") - .AccessMethod; - } - - /// - /// Gets an access method. - /// - public AccessMethod Get(string accessMethodId = default) - { - return Get(new GetRequest(accessMethodId: accessMethodId)); - } - - /// - /// Gets an access method. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/access_methods/get", requestOptions)) - .EnsureData("/access_methods/get") - .AccessMethod; - } - - /// - /// Gets an access method. - /// - public async Task GetAsync(string accessMethodId = default) - { - return (await GetAsync(new GetRequest(accessMethodId: accessMethodId))); - } - - /// - /// Request parameters for Get related Access Method resources. - /// - [DataContract(Name = "getRelatedRequest_request")] - public class GetRelatedRequest - { - [JsonConstructorAttribute] - protected GetRelatedRequest() { } - - public GetRelatedRequest( - List accessMethodIds = default, - List? exclude = default, - List? include = default - ) - { - AccessMethodIds = accessMethodIds; - Exclude = exclude; - Include = include; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExcludeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "spaces")] - Spaces = 1, - - [EnumMember(Value = "devices")] - Devices = 2, - - [EnumMember(Value = "acs_entrances")] - AcsEntrances = 3, - - [EnumMember(Value = "access_grants")] - AccessGrants = 4, - - [EnumMember(Value = "access_methods")] - AccessMethods = 5, - - [EnumMember(Value = "instant_keys")] - InstantKeys = 6, - - [EnumMember(Value = "client_sessions")] - ClientSessions = 7, - - [EnumMember(Value = "acs_credentials")] - AcsCredentials = 8, - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum IncludeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "spaces")] - Spaces = 1, - - [EnumMember(Value = "devices")] - Devices = 2, - - [EnumMember(Value = "acs_entrances")] - AcsEntrances = 3, - - [EnumMember(Value = "access_grants")] - AccessGrants = 4, - - [EnumMember(Value = "access_methods")] - AccessMethods = 5, - - [EnumMember(Value = "instant_keys")] - InstantKeys = 6, - - [EnumMember(Value = "client_sessions")] - ClientSessions = 7, - - [EnumMember(Value = "acs_credentials")] - AcsCredentials = 8, - } - - /// - /// IDs of the access methods that you want to get along with their related resources. - /// - [DataMember(Name = "access_method_ids", IsRequired = true, EmitDefaultValue = false)] - public List AccessMethodIds { get; set; } - - [DataMember(Name = "exclude", IsRequired = false, EmitDefaultValue = false)] - public List? Exclude { get; set; } - - [DataMember(Name = "include", IsRequired = false, EmitDefaultValue = false)] - public List? Include { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getRelatedResponse_response")] - public class GetRelatedResponse - { - [JsonConstructorAttribute] - protected GetRelatedResponse() { } - - public GetRelatedResponse(Batch batch = default) - { - Batch = batch; - } - - /// - /// OK - /// - [DataMember(Name = "batch", IsRequired = false, EmitDefaultValue = false)] - public Batch Batch { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets all related resources for one or more Access Methods. - /// - public Batch GetRelated(GetRelatedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_methods/get_related", requestOptions) - .EnsureData("/access_methods/get_related") - .Batch; - } - - /// - /// Gets all related resources for one or more Access Methods. - /// - public Batch GetRelated( - List accessMethodIds = default, - List? exclude = default, - List? include = default - ) - { - return GetRelated( - new GetRelatedRequest( - accessMethodIds: accessMethodIds, - exclude: exclude, - include: include - ) - ); - } - - /// - /// Gets all related resources for one or more Access Methods. - /// - public async Task GetRelatedAsync(GetRelatedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/access_methods/get_related", - requestOptions - ) - ) - .EnsureData("/access_methods/get_related") - .Batch; - } - - /// - /// Gets all related resources for one or more Access Methods. - /// - public async Task GetRelatedAsync( - List accessMethodIds = default, - List? exclude = default, - List? include = default - ) - { - return ( - await GetRelatedAsync( - new GetRelatedRequest( - accessMethodIds: accessMethodIds, - exclude: exclude, - include: include - ) - ) - ); - } - - /// - /// Request parameters for List Access Methods. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? accessCodeId = default, - string? accessGrantId = default, - string? accessGrantKey = default, - string? acsEntranceId = default, - string? deviceId = default, - int? limit = default, - string? pageCursor = default, - string? spaceId = default - ) - { - AccessCodeId = accessCodeId; - AccessGrantId = accessGrantId; - AccessGrantKey = accessGrantKey; - AcsEntranceId = acsEntranceId; - DeviceId = deviceId; - Limit = limit; - PageCursor = pageCursor; - SpaceId = spaceId; - } - - /// - /// ID of the access code by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessCodeId { get; set; } - - /// - /// ID of Access Grant to list access methods for. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantId { get; set; } - - /// - /// Key of Access Grant to list access methods for. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// ID of the entrance for which you want to retrieve all access methods that grant access to it. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsEntranceId { get; set; } - - /// - /// ID of the device by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Maximum number of records to return per page. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public int? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// ID of the space by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List accessMethods = default) - { - AccessMethods = accessMethods; - } - - /// - /// OK - /// - [DataMember(Name = "access_methods", IsRequired = false, EmitDefaultValue = false)] - public List AccessMethods { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Lists all access methods, usually filtered by Access Grant. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_methods/list", requestOptions) - .EnsureData("/access_methods/list") - .AccessMethods; - } - - /// - /// Lists all access methods, usually filtered by Access Grant. - /// - public List List( - string? accessCodeId = default, - string? accessGrantId = default, - string? accessGrantKey = default, - string? acsEntranceId = default, - string? deviceId = default, - int? limit = default, - string? pageCursor = default, - string? spaceId = default - ) - { - return List( - new ListRequest( - accessCodeId: accessCodeId, - accessGrantId: accessGrantId, - accessGrantKey: accessGrantKey, - acsEntranceId: acsEntranceId, - deviceId: deviceId, - limit: limit, - pageCursor: pageCursor, - spaceId: spaceId - ) - ); - } - - /// - /// Lists all access methods, usually filtered by Access Grant. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/access_methods/list", requestOptions)) - .EnsureData("/access_methods/list") - .AccessMethods; - } - - /// - /// Lists all access methods, usually filtered by Access Grant. - /// - public async Task> ListAsync( - string? accessCodeId = default, - string? accessGrantId = default, - string? accessGrantKey = default, - string? acsEntranceId = default, - string? deviceId = default, - int? limit = default, - string? pageCursor = default, - string? spaceId = default - ) - { - return ( - await ListAsync( - new ListRequest( - accessCodeId: accessCodeId, - accessGrantId: accessGrantId, - accessGrantKey: accessGrantKey, - acsEntranceId: acsEntranceId, - deviceId: deviceId, - limit: limit, - pageCursor: pageCursor, - spaceId: spaceId - ) - ) - ); - } - - /// - /// Request parameters for Unlock a Door with an Access Method. - /// - [DataContract(Name = "unlockDoorRequest_request")] - public class UnlockDoorRequest - { - [JsonConstructorAttribute] - protected UnlockDoorRequest() { } - - public UnlockDoorRequest( - string accessMethodId = default, - string acsEntranceId = default - ) - { - AccessMethodId = accessMethodId; - AcsEntranceId = acsEntranceId; - } - - /// - /// ID of the cloud_key `access_method` to use for the unlock operation. - /// - [DataMember(Name = "access_method_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// ID of the entrance to unlock. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "unlockDoorResponse_response")] - public class UnlockDoorResponse - { - [JsonConstructorAttribute] - protected UnlockDoorResponse() { } - - public UnlockDoorResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using the cloud key credential associated with an access method. Returns an action attempt that tracks the progress of the unlock operation. - /// - public ActionAttempt UnlockDoor(UnlockDoorRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/access_methods/unlock_door", requestOptions) - .EnsureData("/access_methods/unlock_door") - .ActionAttempt; - } - - /// - /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using the cloud key credential associated with an access method. Returns an action attempt that tracks the progress of the unlock operation. - /// - public ActionAttempt UnlockDoor( - string accessMethodId = default, - string acsEntranceId = default - ) - { - return UnlockDoor( - new UnlockDoorRequest(accessMethodId: accessMethodId, acsEntranceId: acsEntranceId) - ); - } - - /// - /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using the cloud key credential associated with an access method. Returns an action attempt that tracks the progress of the unlock operation. - /// - public async Task UnlockDoorAsync(UnlockDoorRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/access_methods/unlock_door", - requestOptions - ) - ) - .EnsureData("/access_methods/unlock_door") - .ActionAttempt; - } - - /// - /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using the cloud key credential associated with an access method. Returns an action attempt that tracks the progress of the unlock operation. - /// - public async Task UnlockDoorAsync( - string accessMethodId = default, - string acsEntranceId = default - ) - { - return ( - await UnlockDoorAsync( - new UnlockDoorRequest( - accessMethodId: accessMethodId, - acsEntranceId: acsEntranceId - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.AccessMethods AccessMethods => new(this); - } - - public partial interface ISeamClient - { - public Api.AccessMethods AccessMethods { get; } - } -} diff --git a/src/Seam/Api/ActionAttempts.cs b/src/Seam/Api/ActionAttempts.cs deleted file mode 100644 index 166de3a8..00000000 --- a/src/Seam/Api/ActionAttempts.cs +++ /dev/null @@ -1,322 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class ActionAttempts - { - private ISeamClient _seam; - - public ActionAttempts(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Get an Action Attempt. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string actionAttemptId = default) - { - ActionAttemptId = actionAttemptId; - } - - /// - /// ID of the action attempt that you want to get. - /// - [DataMember(Name = "action_attempt_id", IsRequired = true, EmitDefaultValue = false)] - public string ActionAttemptId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [action attempt](https://docs.seam.co/core-concepts/action-attempts). - /// - public ActionAttempt Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/action_attempts/get", requestOptions) - .EnsureData("/action_attempts/get") - .ActionAttempt; - } - - /// - /// Returns a specified [action attempt](https://docs.seam.co/core-concepts/action-attempts). - /// - public ActionAttempt Get(string actionAttemptId = default) - { - return Get(new GetRequest(actionAttemptId: actionAttemptId)); - } - - /// - /// Returns a specified [action attempt](https://docs.seam.co/core-concepts/action-attempts). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/action_attempts/get", requestOptions)) - .EnsureData("/action_attempts/get") - .ActionAttempt; - } - - /// - /// Returns a specified [action attempt](https://docs.seam.co/core-concepts/action-attempts). - /// - public async Task GetAsync(string actionAttemptId = default) - { - return (await GetAsync(new GetRequest(actionAttemptId: actionAttemptId))); - } - - /// - /// Request parameters for List Action Attempts. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - List? actionAttemptIds = default, - string? deviceId = default, - int? limit = default, - string? pageCursor = default - ) - { - ActionAttemptIds = actionAttemptIds; - DeviceId = deviceId; - Limit = limit; - PageCursor = pageCursor; - } - - /// - /// IDs of the action attempts that you want to retrieve. - /// - [DataMember(Name = "action_attempt_ids", IsRequired = false, EmitDefaultValue = false)] - public List? ActionAttemptIds { get; set; } - - /// - /// ID of the device to filter action attempts by. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Maximum number of records to return per page. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public int? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List actionAttempts = default) - { - ActionAttempts = actionAttempts; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempts", IsRequired = false, EmitDefaultValue = false)] - public List ActionAttempts { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of the [action attempts](https://docs.seam.co/core-concepts/action-attempts) that you specify as an array of `action_attempt_id`s. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/action_attempts/list", requestOptions) - .EnsureData("/action_attempts/list") - .ActionAttempts; - } - - /// - /// Returns a list of the [action attempts](https://docs.seam.co/core-concepts/action-attempts) that you specify as an array of `action_attempt_id`s. - /// - public List List( - List? actionAttemptIds = default, - string? deviceId = default, - int? limit = default, - string? pageCursor = default - ) - { - return List( - new ListRequest( - actionAttemptIds: actionAttemptIds, - deviceId: deviceId, - limit: limit, - pageCursor: pageCursor - ) - ); - } - - /// - /// Returns a list of the [action attempts](https://docs.seam.co/core-concepts/action-attempts) that you specify as an array of `action_attempt_id`s. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/action_attempts/list", requestOptions)) - .EnsureData("/action_attempts/list") - .ActionAttempts; - } - - /// - /// Returns a list of the [action attempts](https://docs.seam.co/core-concepts/action-attempts) that you specify as an array of `action_attempt_id`s. - /// - public async Task> ListAsync( - List? actionAttemptIds = default, - string? deviceId = default, - int? limit = default, - string? pageCursor = default - ) - { - return ( - await ListAsync( - new ListRequest( - actionAttemptIds: actionAttemptIds, - deviceId: deviceId, - limit: limit, - pageCursor: pageCursor - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.ActionAttempts ActionAttempts => new(this); - } - - public partial interface ISeamClient - { - public Api.ActionAttempts ActionAttempts { get; } - } -} diff --git a/src/Seam/Api/ClientSessions.cs b/src/Seam/Api/ClientSessions.cs deleted file mode 100644 index d663b273..00000000 --- a/src/Seam/Api/ClientSessions.cs +++ /dev/null @@ -1,1108 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class ClientSessions - { - private ISeamClient _seam; - - public ClientSessions(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create a Client Session. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - List? connectWebviewIds = default, - List? connectedAccountIds = default, - string? customerId = default, - string? customerKey = default, - string? expiresAt = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List? userIdentityIds = default - ) - { - ConnectWebviewIds = connectWebviewIds; - ConnectedAccountIds = connectedAccountIds; - CustomerId = customerId; - CustomerKey = customerKey; - ExpiresAt = expiresAt; - UserIdentifierKey = userIdentifierKey; - UserIdentityId = userIdentityId; - UserIdentityIds = userIdentityIds; - } - - /// - /// IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) for which you want to create a client session. - /// - [DataMember(Name = "connect_webview_ids", IsRequired = false, EmitDefaultValue = false)] - public List? ConnectWebviewIds { get; set; } - - /// - /// IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) for which you want to create a client session. - /// - [DataMember( - Name = "connected_account_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? ConnectedAccountIds { get; set; } - - /// - /// Customer ID that you want to associate with the new client session. - /// - [DataMember(Name = "customer_id", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerId { get; set; } - - /// - /// Customer key that you want to associate with the new client session. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Date and time at which the client session should expire, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "expires_at", IsRequired = false, EmitDefaultValue = false)] - public string? ExpiresAt { get; set; } - - /// - /// Your user ID for the user for whom you want to create a client session. - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - /// - /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to create a client session. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. - /// - [Obsolete("Use `user_identity_id` instead.")] - [DataMember(Name = "user_identity_ids", IsRequired = false, EmitDefaultValue = false)] - public List? UserIdentityIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(ClientSession clientSession = default) - { - ClientSession = clientSession; - } - - /// - /// OK - /// - [DataMember(Name = "client_session", IsRequired = false, EmitDefaultValue = false)] - public ClientSession ClientSession { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public ClientSession Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Put("/client_sessions/create", requestOptions) - .EnsureData("/client_sessions/create") - .ClientSession; - } - - /// - /// Creates a new [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public ClientSession Create( - List? connectWebviewIds = default, - List? connectedAccountIds = default, - string? customerId = default, - string? customerKey = default, - string? expiresAt = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List? userIdentityIds = default - ) - { - return Create( - new CreateRequest( - connectWebviewIds: connectWebviewIds, - connectedAccountIds: connectedAccountIds, - customerId: customerId, - customerKey: customerKey, - expiresAt: expiresAt, - userIdentifierKey: userIdentifierKey, - userIdentityId: userIdentityId, - userIdentityIds: userIdentityIds - ) - ); - } - - /// - /// Creates a new [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PutAsync("/client_sessions/create", requestOptions)) - .EnsureData("/client_sessions/create") - .ClientSession; - } - - /// - /// Creates a new [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public async Task CreateAsync( - List? connectWebviewIds = default, - List? connectedAccountIds = default, - string? customerId = default, - string? customerKey = default, - string? expiresAt = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List? userIdentityIds = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - connectWebviewIds: connectWebviewIds, - connectedAccountIds: connectedAccountIds, - customerId: customerId, - customerKey: customerKey, - expiresAt: expiresAt, - userIdentifierKey: userIdentifierKey, - userIdentityId: userIdentityId, - userIdentityIds: userIdentityIds - ) - ) - ); - } - - /// - /// Request parameters for Delete a Client Session. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string clientSessionId = default) - { - ClientSessionId = clientSessionId; - } - - /// - /// ID of the client session that you want to delete. - /// - [DataMember(Name = "client_session_id", IsRequired = true, EmitDefaultValue = false)] - public string ClientSessionId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/client_sessions/delete", requestOptions); - } - - /// - /// Deletes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public void Delete(string clientSessionId = default) - { - Delete(new DeleteRequest(clientSessionId: clientSessionId)); - } - - /// - /// Deletes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/client_sessions/delete", requestOptions); - } - - /// - /// Deletes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public async Task DeleteAsync(string clientSessionId = default) - { - await DeleteAsync(new DeleteRequest(clientSessionId: clientSessionId)); - } - - /// - /// Request parameters for Get a Client Session. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest( - string? clientSessionId = default, - string? userIdentifierKey = default - ) - { - ClientSessionId = clientSessionId; - UserIdentifierKey = userIdentifierKey; - } - - /// - /// ID of the client session that you want to get. - /// - [DataMember(Name = "client_session_id", IsRequired = false, EmitDefaultValue = false)] - public string? ClientSessionId { get; set; } - - /// - /// User identifier key associated with the client session that you want to get. - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(ClientSession clientSession = default) - { - ClientSession = clientSession; - } - - /// - /// OK - /// - [DataMember(Name = "client_session", IsRequired = false, EmitDefaultValue = false)] - public ClientSession ClientSession { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public ClientSession Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/client_sessions/get", requestOptions) - .EnsureData("/client_sessions/get") - .ClientSession; - } - - /// - /// Returns a specified [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public ClientSession Get( - string? clientSessionId = default, - string? userIdentifierKey = default - ) - { - return Get( - new GetRequest( - clientSessionId: clientSessionId, - userIdentifierKey: userIdentifierKey - ) - ); - } - - /// - /// Returns a specified [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/client_sessions/get", requestOptions)) - .EnsureData("/client_sessions/get") - .ClientSession; - } - - /// - /// Returns a specified [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public async Task GetAsync( - string? clientSessionId = default, - string? userIdentifierKey = default - ) - { - return ( - await GetAsync( - new GetRequest( - clientSessionId: clientSessionId, - userIdentifierKey: userIdentifierKey - ) - ) - ); - } - - /// - /// Request parameters for Get or Create a Client Session. - /// - [DataContract(Name = "getOrCreateRequest_request")] - public class GetOrCreateRequest - { - [JsonConstructorAttribute] - protected GetOrCreateRequest() { } - - public GetOrCreateRequest( - List? connectWebviewIds = default, - List? connectedAccountIds = default, - string? expiresAt = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List? userIdentityIds = default - ) - { - ConnectWebviewIds = connectWebviewIds; - ConnectedAccountIds = connectedAccountIds; - ExpiresAt = expiresAt; - UserIdentifierKey = userIdentifierKey; - UserIdentityId = userIdentityId; - UserIdentityIds = userIdentityIds; - } - - /// - /// IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) that you want to associate with the client session (or that are already associated with the existing client session). - /// - [DataMember(Name = "connect_webview_ids", IsRequired = false, EmitDefaultValue = false)] - public List? ConnectWebviewIds { get; set; } - - /// - /// IDs of the [connected accounts](https://docs.seam.co/api/connected_accounts) that you want to associate with the client session (or that are already associated with the existing client session). - /// - [DataMember( - Name = "connected_account_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? ConnectedAccountIds { get; set; } - - /// - /// Date and time at which the client session should expire in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. If the client session already exists, this will update the expiration before returning it. - /// - [DataMember(Name = "expires_at", IsRequired = false, EmitDefaultValue = false)] - public string? ExpiresAt { get; set; } - - /// - /// Your user ID for the user that you want to associate with the client session (or that is already associated with the existing client session). - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - /// - /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session (or that are already associated with the existing client session). - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. - /// - [Obsolete("Use `user_identity_id`.")] - [DataMember(Name = "user_identity_ids", IsRequired = false, EmitDefaultValue = false)] - public List? UserIdentityIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getOrCreateResponse_response")] - public class GetOrCreateResponse - { - [JsonConstructorAttribute] - protected GetOrCreateResponse() { } - - public GetOrCreateResponse(ClientSession clientSession = default) - { - ClientSession = clientSession; - } - - /// - /// OK - /// - [DataMember(Name = "client_session", IsRequired = false, EmitDefaultValue = false)] - public ClientSession ClientSession { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) with specific characteristics or creates a new client session with these characteristics if it does not yet exist. - /// - public ClientSession GetOrCreate(GetOrCreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/client_sessions/get_or_create", requestOptions) - .EnsureData("/client_sessions/get_or_create") - .ClientSession; - } - - /// - /// Returns a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) with specific characteristics or creates a new client session with these characteristics if it does not yet exist. - /// - public ClientSession GetOrCreate( - List? connectWebviewIds = default, - List? connectedAccountIds = default, - string? expiresAt = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List? userIdentityIds = default - ) - { - return GetOrCreate( - new GetOrCreateRequest( - connectWebviewIds: connectWebviewIds, - connectedAccountIds: connectedAccountIds, - expiresAt: expiresAt, - userIdentifierKey: userIdentifierKey, - userIdentityId: userIdentityId, - userIdentityIds: userIdentityIds - ) - ); - } - - /// - /// Returns a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) with specific characteristics or creates a new client session with these characteristics if it does not yet exist. - /// - public async Task GetOrCreateAsync(GetOrCreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/client_sessions/get_or_create", - requestOptions - ) - ) - .EnsureData("/client_sessions/get_or_create") - .ClientSession; - } - - /// - /// Returns a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) with specific characteristics or creates a new client session with these characteristics if it does not yet exist. - /// - public async Task GetOrCreateAsync( - List? connectWebviewIds = default, - List? connectedAccountIds = default, - string? expiresAt = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List? userIdentityIds = default - ) - { - return ( - await GetOrCreateAsync( - new GetOrCreateRequest( - connectWebviewIds: connectWebviewIds, - connectedAccountIds: connectedAccountIds, - expiresAt: expiresAt, - userIdentifierKey: userIdentifierKey, - userIdentityId: userIdentityId, - userIdentityIds: userIdentityIds - ) - ) - ); - } - - /// - /// Request parameters for Grant Access to a Client Session. - /// - [DataContract(Name = "grantAccessRequest_request")] - public class GrantAccessRequest - { - [JsonConstructorAttribute] - protected GrantAccessRequest() { } - - public GrantAccessRequest( - string? clientSessionId = default, - List? connectWebviewIds = default, - List? connectedAccountIds = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List? userIdentityIds = default - ) - { - ClientSessionId = clientSessionId; - ConnectWebviewIds = connectWebviewIds; - ConnectedAccountIds = connectedAccountIds; - UserIdentifierKey = userIdentifierKey; - UserIdentityId = userIdentityId; - UserIdentityIds = userIdentityIds; - } - - /// - /// ID of the client session to which you want to grant access to resources. - /// - [DataMember(Name = "client_session_id", IsRequired = false, EmitDefaultValue = false)] - public string? ClientSessionId { get; set; } - - /// - /// IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) that you want to associate with the client session. - /// - [DataMember(Name = "connect_webview_ids", IsRequired = false, EmitDefaultValue = false)] - public List? ConnectWebviewIds { get; set; } - - /// - /// IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) that you want to associate with the client session. - /// - [DataMember( - Name = "connected_account_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? ConnectedAccountIds { get; set; } - - /// - /// Your user ID for the user that you want to associate with the client session. - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - /// - /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. - /// - [Obsolete("Use `user_identity_id`.")] - [DataMember(Name = "user_identity_ids", IsRequired = false, EmitDefaultValue = false)] - public List? UserIdentityIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Grants a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews), [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), and so on. - /// - public void GrantAccess(GrantAccessRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/client_sessions/grant_access", requestOptions); - } - - /// - /// Grants a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews), [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), and so on. - /// - public void GrantAccess( - string? clientSessionId = default, - List? connectWebviewIds = default, - List? connectedAccountIds = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List? userIdentityIds = default - ) - { - GrantAccess( - new GrantAccessRequest( - clientSessionId: clientSessionId, - connectWebviewIds: connectWebviewIds, - connectedAccountIds: connectedAccountIds, - userIdentifierKey: userIdentifierKey, - userIdentityId: userIdentityId, - userIdentityIds: userIdentityIds - ) - ); - } - - /// - /// Grants a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews), [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), and so on. - /// - public async Task GrantAccessAsync(GrantAccessRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/client_sessions/grant_access", requestOptions); - } - - /// - /// Grants a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews), [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), and so on. - /// - public async Task GrantAccessAsync( - string? clientSessionId = default, - List? connectWebviewIds = default, - List? connectedAccountIds = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List? userIdentityIds = default - ) - { - await GrantAccessAsync( - new GrantAccessRequest( - clientSessionId: clientSessionId, - connectWebviewIds: connectWebviewIds, - connectedAccountIds: connectedAccountIds, - userIdentifierKey: userIdentifierKey, - userIdentityId: userIdentityId, - userIdentityIds: userIdentityIds - ) - ); - } - - /// - /// Request parameters for List Client Sessions. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? clientSessionId = default, - string? connectWebviewId = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - bool? withoutUserIdentifierKey = default - ) - { - ClientSessionId = clientSessionId; - ConnectWebviewId = connectWebviewId; - UserIdentifierKey = userIdentifierKey; - UserIdentityId = userIdentityId; - WithoutUserIdentifierKey = withoutUserIdentifierKey; - } - - /// - /// ID of the client session that you want to retrieve. - /// - [DataMember(Name = "client_session_id", IsRequired = false, EmitDefaultValue = false)] - public string? ClientSessionId { get; set; } - - /// - /// ID of the [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) for which you want to retrieve client sessions. Specify `null` to retrieve client sessions that are not associated with a Connect Webview. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectWebviewId { get; set; } - - /// - /// Your user ID for the user by which you want to filter client sessions. - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - /// - /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to retrieve client sessions. Specify `null` to retrieve client sessions that are not associated with a user identity. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Indicates whether to retrieve only client sessions without associated user identifier keys. - /// - [DataMember( - Name = "without_user_identifier_key", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? WithoutUserIdentifierKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List clientSessions = default) - { - ClientSessions = clientSessions; - } - - /// - /// OK - /// - [DataMember(Name = "client_sessions", IsRequired = false, EmitDefaultValue = false)] - public List ClientSessions { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [client sessions](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/client_sessions/list", requestOptions) - .EnsureData("/client_sessions/list") - .ClientSessions; - } - - /// - /// Returns a list of all [client sessions](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public List List( - string? clientSessionId = default, - string? connectWebviewId = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - bool? withoutUserIdentifierKey = default - ) - { - return List( - new ListRequest( - clientSessionId: clientSessionId, - connectWebviewId: connectWebviewId, - userIdentifierKey: userIdentifierKey, - userIdentityId: userIdentityId, - withoutUserIdentifierKey: withoutUserIdentifierKey - ) - ); - } - - /// - /// Returns a list of all [client sessions](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/client_sessions/list", requestOptions)) - .EnsureData("/client_sessions/list") - .ClientSessions; - } - - /// - /// Returns a list of all [client sessions](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - public async Task> ListAsync( - string? clientSessionId = default, - string? connectWebviewId = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - bool? withoutUserIdentifierKey = default - ) - { - return ( - await ListAsync( - new ListRequest( - clientSessionId: clientSessionId, - connectWebviewId: connectWebviewId, - userIdentifierKey: userIdentifierKey, - userIdentityId: userIdentityId, - withoutUserIdentifierKey: withoutUserIdentifierKey - ) - ) - ); - } - - /// - /// Request parameters for Revoke a Client Session. - /// - [DataContract(Name = "revokeRequest_request")] - public class RevokeRequest - { - [JsonConstructorAttribute] - protected RevokeRequest() { } - - public RevokeRequest(string clientSessionId = default) - { - ClientSessionId = clientSessionId; - } - - /// - /// ID of the client session that you want to revoke. - /// - [DataMember(Name = "client_session_id", IsRequired = true, EmitDefaultValue = false)] - public string ClientSessionId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Revokes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - /// Note that [deleting a client session](https://docs.seam.co/api/client_sessions/delete) is a separate action. - /// - public void Revoke(RevokeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/client_sessions/revoke", requestOptions); - } - - /// - /// Revokes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - /// Note that [deleting a client session](https://docs.seam.co/api/client_sessions/delete) is a separate action. - /// - public void Revoke(string clientSessionId = default) - { - Revoke(new RevokeRequest(clientSessionId: clientSessionId)); - } - - /// - /// Revokes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - /// Note that [deleting a client session](https://docs.seam.co/api/client_sessions/delete) is a separate action. - /// - public async Task RevokeAsync(RevokeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/client_sessions/revoke", requestOptions); - } - - /// - /// Revokes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - /// Note that [deleting a client session](https://docs.seam.co/api/client_sessions/delete) is a separate action. - /// - public async Task RevokeAsync(string clientSessionId = default) - { - await RevokeAsync(new RevokeRequest(clientSessionId: clientSessionId)); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.ClientSessions ClientSessions => new(this); - } - - public partial interface ISeamClient - { - public Api.ClientSessions ClientSessions { get; } - } -} diff --git a/src/Seam/Api/ConnectWebviews.cs b/src/Seam/Api/ConnectWebviews.cs deleted file mode 100644 index 5498fb7b..00000000 --- a/src/Seam/Api/ConnectWebviews.cs +++ /dev/null @@ -1,998 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class ConnectWebviews - { - private ISeamClient _seam; - - public ConnectWebviews(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create a Connect Webview. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - List? acceptedCapabilities = default, - List? acceptedProviders = default, - bool? automaticallyManageNewDevices = default, - object? customMetadata = default, - string? customRedirectFailureUrl = default, - string? customRedirectUrl = default, - string? customerKey = default, - List? excludedProviders = default, - CreateRequest.ProviderCategoryEnum? providerCategory = default, - bool? waitForDeviceCreation = default - ) - { - AcceptedCapabilities = acceptedCapabilities; - AcceptedProviders = acceptedProviders; - AutomaticallyManageNewDevices = automaticallyManageNewDevices; - CustomMetadata = customMetadata; - CustomRedirectFailureUrl = customRedirectFailureUrl; - CustomRedirectUrl = customRedirectUrl; - CustomerKey = customerKey; - ExcludedProviders = excludedProviders; - ProviderCategory = providerCategory; - WaitForDeviceCreation = waitForDeviceCreation; - } - - /// - /// List of accepted device capabilities that restrict the types of devices that can be connected through the Connect Webview. If not provided, defaults will be determined based on the accepted providers. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AcceptedCapabilitiesEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "lock")] - Lock = 1, - - [EnumMember(Value = "thermostat")] - Thermostat = 2, - - [EnumMember(Value = "noise_sensor")] - NoiseSensor = 3, - - [EnumMember(Value = "access_control")] - AccessControl = 4, - - [EnumMember(Value = "camera")] - Camera = 5, - } - - /// - /// Accepted device provider keys as an alternative to `provider_category`. Use this parameter to specify accepted providers explicitly. See [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). To list all provider keys, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with no filters. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AcceptedProvidersEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "hotek")] - Hotek = 1, - - [EnumMember(Value = "dormakaba_community")] - DormakabaCommunity = 2, - - [EnumMember(Value = "legic_connect")] - LegicConnect = 3, - - [EnumMember(Value = "akuvox")] - Akuvox = 4, - - [EnumMember(Value = "august")] - August = 5, - - [EnumMember(Value = "avigilon_alta")] - AvigilonAlta = 6, - - [EnumMember(Value = "brivo")] - Brivo = 7, - - [EnumMember(Value = "butterflymx")] - Butterflymx = 8, - - [EnumMember(Value = "schlage")] - Schlage = 9, - - [EnumMember(Value = "smartthings")] - Smartthings = 10, - - [EnumMember(Value = "yale")] - Yale = 11, - - [EnumMember(Value = "genie")] - Genie = 12, - - [EnumMember(Value = "doorking")] - Doorking = 13, - - [EnumMember(Value = "salto")] - Salto = 14, - - [EnumMember(Value = "salto_ks")] - SaltoKs = 15, - - [EnumMember(Value = "salto_ks_accept")] - SaltoKsAccept = 16, - - [EnumMember(Value = "lockly")] - Lockly = 17, - - [EnumMember(Value = "ttlock")] - Ttlock = 18, - - [EnumMember(Value = "linear")] - Linear = 19, - - [EnumMember(Value = "noiseaware")] - Noiseaware = 20, - - [EnumMember(Value = "nuki")] - Nuki = 21, - - [EnumMember(Value = "igloo")] - Igloo = 22, - - [EnumMember(Value = "kwikset")] - Kwikset = 23, - - [EnumMember(Value = "minut")] - Minut = 24, - - [EnumMember(Value = "my_2n")] - My_2n = 25, - - [EnumMember(Value = "controlbyweb")] - Controlbyweb = 26, - - [EnumMember(Value = "nest")] - Nest = 27, - - [EnumMember(Value = "igloohome")] - Igloohome = 28, - - [EnumMember(Value = "ecobee")] - Ecobee = 29, - - [EnumMember(Value = "four_suites")] - FourSuites = 30, - - [EnumMember(Value = "dormakaba_oracode")] - DormakabaOracode = 31, - - [EnumMember(Value = "pti")] - Pti = 32, - - [EnumMember(Value = "wyze")] - Wyze = 33, - - [EnumMember(Value = "seam_passport")] - SeamPassport = 34, - - [EnumMember(Value = "visionline")] - Visionline = 35, - - [EnumMember(Value = "assa_abloy_credential_service")] - AssaAbloyCredentialService = 36, - - [EnumMember(Value = "tedee")] - Tedee = 37, - - [EnumMember(Value = "honeywell_resideo")] - HoneywellResideo = 38, - - [EnumMember(Value = "first_alert")] - FirstAlert = 39, - - [EnumMember(Value = "latch")] - Latch = 40, - - [EnumMember(Value = "akiles")] - Akiles = 41, - - [EnumMember(Value = "assa_abloy_vostio")] - AssaAbloyVostio = 42, - - [EnumMember(Value = "assa_abloy_vostio_credential_service")] - AssaAbloyVostioCredentialService = 43, - - [EnumMember(Value = "tado")] - Tado = 44, - - [EnumMember(Value = "salto_space")] - SaltoSpace = 45, - - [EnumMember(Value = "sensi")] - Sensi = 46, - - [EnumMember(Value = "keynest")] - Keynest = 47, - - [EnumMember(Value = "korelock")] - Korelock = 48, - - [EnumMember(Value = "keyincode")] - Keyincode = 49, - - [EnumMember(Value = "dormakaba_ambiance")] - DormakabaAmbiance = 50, - - [EnumMember(Value = "ultraloq")] - Ultraloq = 51, - - [EnumMember(Value = "yacan")] - Yacan = 52, - - [EnumMember(Value = "dusaw")] - Dusaw = 53, - - [EnumMember(Value = "sifely")] - Sifely = 54, - - [EnumMember(Value = "thirty_three_lock")] - ThirtyThreeLock = 55, - - [EnumMember(Value = "ring")] - Ring = 56, - - [EnumMember(Value = "ical")] - Ical = 57, - - [EnumMember(Value = "lodgify")] - Lodgify = 58, - - [EnumMember(Value = "hostaway")] - Hostaway = 59, - - [EnumMember(Value = "guesty")] - Guesty = 60, - - [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 61, - - [EnumMember(Value = "omnitec")] - Omnitec = 62, - - [EnumMember(Value = "kisi")] - Kisi = 63, - - [EnumMember(Value = "aqara")] - Aqara = 64, - - [EnumMember(Value = "yale_access")] - YaleAccess = 65, - - [EnumMember(Value = "hid_cm")] - HidCm = 66, - - [EnumMember(Value = "google_nest")] - GoogleNest = 67, - - [EnumMember(Value = "slack")] - Slack = 68, - } - - /// - /// Specifies the category of providers that you want to include. To list all providers within a category, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with the desired `provider_category` filter. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ProviderCategoryEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "stable")] - Stable = 1, - - [EnumMember(Value = "consumer_smartlocks")] - ConsumerSmartlocks = 2, - - [EnumMember(Value = "beta")] - Beta = 3, - - [EnumMember(Value = "thermostats")] - Thermostats = 4, - - [EnumMember(Value = "noise_sensors")] - NoiseSensors = 5, - - [EnumMember(Value = "access_control_systems")] - AccessControlSystems = 6, - - [EnumMember(Value = "cameras")] - Cameras = 7, - - [EnumMember(Value = "connectors")] - Connectors = 8, - - [EnumMember(Value = "internal_beta")] - InternalBeta = 9, - } - - /// - /// List of accepted device capabilities that restrict the types of devices that can be connected through the Connect Webview. If not provided, defaults will be determined based on the accepted providers. - /// - [DataMember( - Name = "accepted_capabilities", - IsRequired = false, - EmitDefaultValue = false - )] - public List? AcceptedCapabilities { get; set; } - - /// - /// Accepted device provider keys as an alternative to `provider_category`. Use this parameter to specify accepted providers explicitly. See [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). To list all provider keys, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with no filters. - /// - [DataMember(Name = "accepted_providers", IsRequired = false, EmitDefaultValue = false)] - public List? AcceptedProviders { get; set; } - - /// - /// Indicates whether newly-added devices should appear as [managed devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). See also: [Customize the Behavior Settings of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-behavior-settings-of-your-connect-webviews). - /// - [DataMember( - Name = "automatically_manage_new_devices", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AutomaticallyManageNewDevices { get; set; } - - /// - /// Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview) enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) that were connected using the Connect Webview, making it easy to find and filter these resources in your [workspace](https://docs.seam.co/core-concepts/workspaces). You can also [filter Connect Webviews by custom metadata](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadata { get; set; } - - /// - /// Alternative URL that you want to redirect the user to on an error. If you do not set this parameter, the Connect Webview falls back to the `custom_redirect_url`. - /// - [DataMember( - Name = "custom_redirect_failure_url", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomRedirectFailureUrl { get; set; } - - /// - /// URL that you want to redirect the user to after the provider login is complete. - /// - [DataMember(Name = "custom_redirect_url", IsRequired = false, EmitDefaultValue = false)] - public string? CustomRedirectUrl { get; set; } - - /// - /// Associate the Connect Webview, the connected account, and all resources under the connected account with a customer. If the connected account already exists, it will be associated with the customer. If the connected account already exists, but is already associated with a customer, the Connect Webview will show an error. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// List of provider keys to exclude from the Connect Webview. These providers will not be shown when the user tries to connect an account. - /// - [DataMember(Name = "excluded_providers", IsRequired = false, EmitDefaultValue = false)] - public List? ExcludedProviders { get; set; } - - /// - /// Specifies the category of providers that you want to include. To list all providers within a category, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with the desired `provider_category` filter. - /// - [DataMember(Name = "provider_category", IsRequired = false, EmitDefaultValue = false)] - public CreateRequest.ProviderCategoryEnum? ProviderCategory { get; set; } - - /// - /// Indicates whether Seam should finish syncing all devices in a newly-connected account before completing the associated Connect Webview. See also: [Customize the Behavior Settings of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-behavior-settings-of-your-connect-webviews). - /// - [DataMember( - Name = "wait_for_device_creation", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? WaitForDeviceCreation { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(ConnectWebview connectWebview = default) - { - ConnectWebview = connectWebview; - } - - /// - /// OK - /// - [DataMember(Name = "connect_webview", IsRequired = false, EmitDefaultValue = false)] - public ConnectWebview ConnectWebview { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// To enable a user to connect their devices or systems to Seam, they must sign in to their device or system account. To enable a user to sign in, you create a `connect_webview`. After creating the Connect Webview, you receive a URL that you can use to display the visual component of this Connect Webview for your user. You can open an iframe or new window to display the Connect Webview. - /// - /// You should make a new `connect_webview` for each unique login request. Each `connect_webview` tracks the user that signed in with it. You receive an error if you reuse a Connect Webview for the same user twice or if you use the same Connect Webview for multiple users. - /// - /// See also: [Connect Webview Process](https://docs.seam.co/core-concepts/connect-webviews/connect-webview-process). - /// - public ConnectWebview Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/connect_webviews/create", requestOptions) - .EnsureData("/connect_webviews/create") - .ConnectWebview; - } - - /// - /// Creates a new [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// To enable a user to connect their devices or systems to Seam, they must sign in to their device or system account. To enable a user to sign in, you create a `connect_webview`. After creating the Connect Webview, you receive a URL that you can use to display the visual component of this Connect Webview for your user. You can open an iframe or new window to display the Connect Webview. - /// - /// You should make a new `connect_webview` for each unique login request. Each `connect_webview` tracks the user that signed in with it. You receive an error if you reuse a Connect Webview for the same user twice or if you use the same Connect Webview for multiple users. - /// - /// See also: [Connect Webview Process](https://docs.seam.co/core-concepts/connect-webviews/connect-webview-process). - /// - public ConnectWebview Create( - List? acceptedCapabilities = default, - List? acceptedProviders = default, - bool? automaticallyManageNewDevices = default, - object? customMetadata = default, - string? customRedirectFailureUrl = default, - string? customRedirectUrl = default, - string? customerKey = default, - List? excludedProviders = default, - CreateRequest.ProviderCategoryEnum? providerCategory = default, - bool? waitForDeviceCreation = default - ) - { - return Create( - new CreateRequest( - acceptedCapabilities: acceptedCapabilities, - acceptedProviders: acceptedProviders, - automaticallyManageNewDevices: automaticallyManageNewDevices, - customMetadata: customMetadata, - customRedirectFailureUrl: customRedirectFailureUrl, - customRedirectUrl: customRedirectUrl, - customerKey: customerKey, - excludedProviders: excludedProviders, - providerCategory: providerCategory, - waitForDeviceCreation: waitForDeviceCreation - ) - ); - } - - /// - /// Creates a new [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// To enable a user to connect their devices or systems to Seam, they must sign in to their device or system account. To enable a user to sign in, you create a `connect_webview`. After creating the Connect Webview, you receive a URL that you can use to display the visual component of this Connect Webview for your user. You can open an iframe or new window to display the Connect Webview. - /// - /// You should make a new `connect_webview` for each unique login request. Each `connect_webview` tracks the user that signed in with it. You receive an error if you reuse a Connect Webview for the same user twice or if you use the same Connect Webview for multiple users. - /// - /// See also: [Connect Webview Process](https://docs.seam.co/core-concepts/connect-webviews/connect-webview-process). - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync("/connect_webviews/create", requestOptions) - ) - .EnsureData("/connect_webviews/create") - .ConnectWebview; - } - - /// - /// Creates a new [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// To enable a user to connect their devices or systems to Seam, they must sign in to their device or system account. To enable a user to sign in, you create a `connect_webview`. After creating the Connect Webview, you receive a URL that you can use to display the visual component of this Connect Webview for your user. You can open an iframe or new window to display the Connect Webview. - /// - /// You should make a new `connect_webview` for each unique login request. Each `connect_webview` tracks the user that signed in with it. You receive an error if you reuse a Connect Webview for the same user twice or if you use the same Connect Webview for multiple users. - /// - /// See also: [Connect Webview Process](https://docs.seam.co/core-concepts/connect-webviews/connect-webview-process). - /// - public async Task CreateAsync( - List? acceptedCapabilities = default, - List? acceptedProviders = default, - bool? automaticallyManageNewDevices = default, - object? customMetadata = default, - string? customRedirectFailureUrl = default, - string? customRedirectUrl = default, - string? customerKey = default, - List? excludedProviders = default, - CreateRequest.ProviderCategoryEnum? providerCategory = default, - bool? waitForDeviceCreation = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - acceptedCapabilities: acceptedCapabilities, - acceptedProviders: acceptedProviders, - automaticallyManageNewDevices: automaticallyManageNewDevices, - customMetadata: customMetadata, - customRedirectFailureUrl: customRedirectFailureUrl, - customRedirectUrl: customRedirectUrl, - customerKey: customerKey, - excludedProviders: excludedProviders, - providerCategory: providerCategory, - waitForDeviceCreation: waitForDeviceCreation - ) - ) - ); - } - - /// - /// Request parameters for Delete a Connect Webview. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string connectWebviewId = default) - { - ConnectWebviewId = connectWebviewId; - } - - /// - /// ID of the Connect Webview that you want to delete. - /// - [DataMember(Name = "connect_webview_id", IsRequired = true, EmitDefaultValue = false)] - public string ConnectWebviewId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// You do not need to delete a Connect Webview once a user completes it. Instead, you can simply ignore completed Connect Webviews. - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/connect_webviews/delete", requestOptions); - } - - /// - /// Deletes a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// You do not need to delete a Connect Webview once a user completes it. Instead, you can simply ignore completed Connect Webviews. - /// - public void Delete(string connectWebviewId = default) - { - Delete(new DeleteRequest(connectWebviewId: connectWebviewId)); - } - - /// - /// Deletes a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// You do not need to delete a Connect Webview once a user completes it. Instead, you can simply ignore completed Connect Webviews. - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/connect_webviews/delete", requestOptions); - } - - /// - /// Deletes a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// You do not need to delete a Connect Webview once a user completes it. Instead, you can simply ignore completed Connect Webviews. - /// - public async Task DeleteAsync(string connectWebviewId = default) - { - await DeleteAsync(new DeleteRequest(connectWebviewId: connectWebviewId)); - } - - /// - /// Request parameters for Get a Connect Webview. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string connectWebviewId = default) - { - ConnectWebviewId = connectWebviewId; - } - - /// - /// ID of the Connect Webview that you want to get. - /// - [DataMember(Name = "connect_webview_id", IsRequired = true, EmitDefaultValue = false)] - public string ConnectWebviewId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(ConnectWebview connectWebview = default) - { - ConnectWebview = connectWebview; - } - - /// - /// OK - /// - [DataMember(Name = "connect_webview", IsRequired = false, EmitDefaultValue = false)] - public ConnectWebview ConnectWebview { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// Unless you're using a `custom_redirect_url`, you should poll a newly-created `connect_webview` to find out if the user has signed in or to get details about what devices they've connected. - /// - public ConnectWebview Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/connect_webviews/get", requestOptions) - .EnsureData("/connect_webviews/get") - .ConnectWebview; - } - - /// - /// Returns a specified [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// Unless you're using a `custom_redirect_url`, you should poll a newly-created `connect_webview` to find out if the user has signed in or to get details about what devices they've connected. - /// - public ConnectWebview Get(string connectWebviewId = default) - { - return Get(new GetRequest(connectWebviewId: connectWebviewId)); - } - - /// - /// Returns a specified [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// Unless you're using a `custom_redirect_url`, you should poll a newly-created `connect_webview` to find out if the user has signed in or to get details about what devices they've connected. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/connect_webviews/get", requestOptions)) - .EnsureData("/connect_webviews/get") - .ConnectWebview; - } - - /// - /// Returns a specified [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). - /// - /// Unless you're using a `custom_redirect_url`, you should poll a newly-created `connect_webview` to find out if the user has signed in or to get details about what devices they've connected. - /// - public async Task GetAsync(string connectWebviewId = default) - { - return (await GetAsync(new GetRequest(connectWebviewId: connectWebviewId))); - } - - /// - /// Request parameters for List Connect Webviews. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - object? customMetadataHas = default, - string? customerKey = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentifierKey = default - ) - { - CustomMetadataHas = customMetadataHas; - CustomerKey = customerKey; - Limit = limit; - PageCursor = pageCursor; - Search = search; - UserIdentifierKey = userIdentifierKey; - } - - /// - /// Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. - /// - [DataMember(Name = "custom_metadata_has", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadataHas { get; set; } - - /// - /// Customer key for which you want to list connect webviews. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Maximum number of records to return per page. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned Connect Webviews to include all records that satisfy a partial match using `connect_webview_id`, `accepted_providers`, `custom_metadata`, or `customer_key`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// Your user ID for the user by which you want to filter Connect Webviews. - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List connectWebviews = default) - { - ConnectWebviews = connectWebviews; - } - - /// - /// OK - /// - [DataMember(Name = "connect_webviews", IsRequired = false, EmitDefaultValue = false)] - public List ConnectWebviews { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/connect_webviews/list", requestOptions) - .EnsureData("/connect_webviews/list") - .ConnectWebviews; - } - - /// - /// Returns a list of all [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews). - /// - public List List( - object? customMetadataHas = default, - string? customerKey = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentifierKey = default - ) - { - return List( - new ListRequest( - customMetadataHas: customMetadataHas, - customerKey: customerKey, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentifierKey: userIdentifierKey - ) - ); - } - - /// - /// Returns a list of all [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/connect_webviews/list", requestOptions)) - .EnsureData("/connect_webviews/list") - .ConnectWebviews; - } - - /// - /// Returns a list of all [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews). - /// - public async Task> ListAsync( - object? customMetadataHas = default, - string? customerKey = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentifierKey = default - ) - { - return ( - await ListAsync( - new ListRequest( - customMetadataHas: customMetadataHas, - customerKey: customerKey, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentifierKey: userIdentifierKey - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.ConnectWebviews ConnectWebviews => new(this); - } - - public partial interface ISeamClient - { - public Api.ConnectWebviews ConnectWebviews { get; } - } -} diff --git a/src/Seam/Api/ConnectedAccounts.cs b/src/Seam/Api/ConnectedAccounts.cs deleted file mode 100644 index ab35f5f4..00000000 --- a/src/Seam/Api/ConnectedAccounts.cs +++ /dev/null @@ -1,725 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class ConnectedAccounts - { - private ISeamClient _seam; - - public ConnectedAccounts(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Delete a Connected Account. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string connectedAccountId = default) - { - ConnectedAccountId = connectedAccountId; - } - - /// - /// ID of the connected account that you want to delete. - /// - [DataMember(Name = "connected_account_id", IsRequired = true, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - /// Deleting a connected account triggers a `connected_account.deleted` event and removes the connected account and all data associated with the connected account from Seam, including devices, events, access codes, and so on. For every deleted resource, Seam sends a corresponding deleted event, but the resource is not deleted from the provider. - /// - /// For example, if you delete a connected account with a device that has an access code, Seam sends a `connected_account.deleted` event, a `device.deleted` event, and an `access_code.deleted` event, but Seam does not remove the access code from the device. - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/connected_accounts/delete", requestOptions); - } - - /// - /// Deletes a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - /// Deleting a connected account triggers a `connected_account.deleted` event and removes the connected account and all data associated with the connected account from Seam, including devices, events, access codes, and so on. For every deleted resource, Seam sends a corresponding deleted event, but the resource is not deleted from the provider. - /// - /// For example, if you delete a connected account with a device that has an access code, Seam sends a `connected_account.deleted` event, a `device.deleted` event, and an `access_code.deleted` event, but Seam does not remove the access code from the device. - /// - public void Delete(string connectedAccountId = default) - { - Delete(new DeleteRequest(connectedAccountId: connectedAccountId)); - } - - /// - /// Deletes a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - /// Deleting a connected account triggers a `connected_account.deleted` event and removes the connected account and all data associated with the connected account from Seam, including devices, events, access codes, and so on. For every deleted resource, Seam sends a corresponding deleted event, but the resource is not deleted from the provider. - /// - /// For example, if you delete a connected account with a device that has an access code, Seam sends a `connected_account.deleted` event, a `device.deleted` event, and an `access_code.deleted` event, but Seam does not remove the access code from the device. - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/connected_accounts/delete", requestOptions); - } - - /// - /// Deletes a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - /// Deleting a connected account triggers a `connected_account.deleted` event and removes the connected account and all data associated with the connected account from Seam, including devices, events, access codes, and so on. For every deleted resource, Seam sends a corresponding deleted event, but the resource is not deleted from the provider. - /// - /// For example, if you delete a connected account with a device that has an access code, Seam sends a `connected_account.deleted` event, a `device.deleted` event, and an `access_code.deleted` event, but Seam does not remove the access code from the device. - /// - public async Task DeleteAsync(string connectedAccountId = default) - { - await DeleteAsync(new DeleteRequest(connectedAccountId: connectedAccountId)); - } - - /// - /// Request parameters for Get a Connected Account. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string? connectedAccountId = default, string? email = default) - { - ConnectedAccountId = connectedAccountId; - Email = email; - } - - /// - /// ID of the connected account that you want to get. - /// - [DataMember( - Name = "connected_account_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectedAccountId { get; set; } - - /// - /// Email address associated with the connected account that you want to get. - /// - [DataMember(Name = "email", IsRequired = false, EmitDefaultValue = false)] - public string? Email { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(ConnectedAccount connectedAccount = default) - { - ConnectedAccount = connectedAccount; - } - - /// - /// OK - /// - [DataMember(Name = "connected_account", IsRequired = false, EmitDefaultValue = false)] - public ConnectedAccount ConnectedAccount { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - public ConnectedAccount Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/connected_accounts/get", requestOptions) - .EnsureData("/connected_accounts/get") - .ConnectedAccount; - } - - /// - /// Returns a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - public ConnectedAccount Get(string? connectedAccountId = default, string? email = default) - { - return Get(new GetRequest(connectedAccountId: connectedAccountId, email: email)); - } - - /// - /// Returns a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/connected_accounts/get", requestOptions)) - .EnsureData("/connected_accounts/get") - .ConnectedAccount; - } - - /// - /// Returns a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - public async Task GetAsync( - string? connectedAccountId = default, - string? email = default - ) - { - return ( - await GetAsync(new GetRequest(connectedAccountId: connectedAccountId, email: email)) - ); - } - - /// - /// Request parameters for List Connected Accounts. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - object? customMetadataHas = default, - string? customerKey = default, - int? limit = default, - string? pageCursor = default, - string? search = default, - string? spaceId = default, - string? userIdentifierKey = default - ) - { - CustomMetadataHas = customMetadataHas; - CustomerKey = customerKey; - Limit = limit; - PageCursor = pageCursor; - Search = search; - SpaceId = spaceId; - UserIdentifierKey = userIdentifierKey; - } - - /// - /// Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. - /// - [DataMember(Name = "custom_metadata_has", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadataHas { get; set; } - - /// - /// Customer key by which you want to filter connected accounts. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Maximum number of records to return per page. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public int? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned connected accounts to include all records that satisfy a partial match using `connected_account_id`, `account_type`, `customer_key`, `custom_metadata`, `user_identifier.username`, `user_identifier.email` or `user_identifier.phone`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// ID of the space by which you want to filter connected accounts. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceId { get; set; } - - /// - /// Your user ID for the user by which you want to filter connected accounts. - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List connectedAccounts = default) - { - ConnectedAccounts = connectedAccounts; - } - - /// - /// OK - /// - [DataMember(Name = "connected_accounts", IsRequired = false, EmitDefaultValue = false)] - public List ConnectedAccounts { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [connected accounts](https://docs.seam.co/core-concepts/connected-accounts). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/connected_accounts/list", requestOptions) - .EnsureData("/connected_accounts/list") - .ConnectedAccounts; - } - - /// - /// Returns a list of all [connected accounts](https://docs.seam.co/core-concepts/connected-accounts). - /// - public List List( - object? customMetadataHas = default, - string? customerKey = default, - int? limit = default, - string? pageCursor = default, - string? search = default, - string? spaceId = default, - string? userIdentifierKey = default - ) - { - return List( - new ListRequest( - customMetadataHas: customMetadataHas, - customerKey: customerKey, - limit: limit, - pageCursor: pageCursor, - search: search, - spaceId: spaceId, - userIdentifierKey: userIdentifierKey - ) - ); - } - - /// - /// Returns a list of all [connected accounts](https://docs.seam.co/core-concepts/connected-accounts). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/connected_accounts/list", requestOptions)) - .EnsureData("/connected_accounts/list") - .ConnectedAccounts; - } - - /// - /// Returns a list of all [connected accounts](https://docs.seam.co/core-concepts/connected-accounts). - /// - public async Task> ListAsync( - object? customMetadataHas = default, - string? customerKey = default, - int? limit = default, - string? pageCursor = default, - string? search = default, - string? spaceId = default, - string? userIdentifierKey = default - ) - { - return ( - await ListAsync( - new ListRequest( - customMetadataHas: customMetadataHas, - customerKey: customerKey, - limit: limit, - pageCursor: pageCursor, - search: search, - spaceId: spaceId, - userIdentifierKey: userIdentifierKey - ) - ) - ); - } - - /// - /// Request parameters for Sync a Connected Account. - /// - [DataContract(Name = "syncRequest_request")] - public class SyncRequest - { - [JsonConstructorAttribute] - protected SyncRequest() { } - - public SyncRequest(string connectedAccountId = default) - { - ConnectedAccountId = connectedAccountId; - } - - /// - /// ID of the connected account that you want to sync. - /// - [DataMember(Name = "connected_account_id", IsRequired = true, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Request a [connected account](https://docs.seam.co/core-concepts/connected-accounts) sync attempt for the specified `connected_account_id`. - /// - public void Sync(SyncRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/connected_accounts/sync", requestOptions); - } - - /// - /// Request a [connected account](https://docs.seam.co/core-concepts/connected-accounts) sync attempt for the specified `connected_account_id`. - /// - public void Sync(string connectedAccountId = default) - { - Sync(new SyncRequest(connectedAccountId: connectedAccountId)); - } - - /// - /// Request a [connected account](https://docs.seam.co/core-concepts/connected-accounts) sync attempt for the specified `connected_account_id`. - /// - public async Task SyncAsync(SyncRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/connected_accounts/sync", requestOptions); - } - - /// - /// Request a [connected account](https://docs.seam.co/core-concepts/connected-accounts) sync attempt for the specified `connected_account_id`. - /// - public async Task SyncAsync(string connectedAccountId = default) - { - await SyncAsync(new SyncRequest(connectedAccountId: connectedAccountId)); - } - - /// - /// Request parameters for Update a Connected Account. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - List? acceptedCapabilities = default, - bool? automaticallyManageNewDevices = default, - string connectedAccountId = default, - object? customMetadata = default, - string? customerKey = default, - string? displayName = default - ) - { - AcceptedCapabilities = acceptedCapabilities; - AutomaticallyManageNewDevices = automaticallyManageNewDevices; - ConnectedAccountId = connectedAccountId; - CustomMetadata = customMetadata; - CustomerKey = customerKey; - DisplayName = displayName; - } - - /// - /// List of accepted device capabilities that restrict the types of devices that can be connected through this connected account. Valid values are `lock`, `thermostat`, `noise_sensor`, and `access_control`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AcceptedCapabilitiesEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "lock")] - Lock = 1, - - [EnumMember(Value = "thermostat")] - Thermostat = 2, - - [EnumMember(Value = "noise_sensor")] - NoiseSensor = 3, - - [EnumMember(Value = "access_control")] - AccessControl = 4, - - [EnumMember(Value = "camera")] - Camera = 5, - } - - /// - /// List of accepted device capabilities that restrict the types of devices that can be connected through this connected account. Valid values are `lock`, `thermostat`, `noise_sensor`, and `access_control`. - /// - [DataMember( - Name = "accepted_capabilities", - IsRequired = false, - EmitDefaultValue = false - )] - public List? AcceptedCapabilities { get; set; } - - /// - /// Indicates whether newly-added devices should appear as [managed devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - [DataMember( - Name = "automatically_manage_new_devices", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AutomaticallyManageNewDevices { get; set; } - - /// - /// ID of the connected account that you want to update. - /// - [DataMember(Name = "connected_account_id", IsRequired = true, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter connected accounts by the desired metadata](https://docs.seam.co/core-concepts/connected-accounts/filtering-connected-accounts-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadata { get; set; } - - /// - /// The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Human-readable name for the connected account, shown in the dashboard. For example, `Booking from Airbnb House 1`. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string? DisplayName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/connected_accounts/update", requestOptions); - } - - /// - /// Updates a [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - public void Update( - List? acceptedCapabilities = default, - bool? automaticallyManageNewDevices = default, - string connectedAccountId = default, - object? customMetadata = default, - string? customerKey = default, - string? displayName = default - ) - { - Update( - new UpdateRequest( - acceptedCapabilities: acceptedCapabilities, - automaticallyManageNewDevices: automaticallyManageNewDevices, - connectedAccountId: connectedAccountId, - customMetadata: customMetadata, - customerKey: customerKey, - displayName: displayName - ) - ); - } - - /// - /// Updates a [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/connected_accounts/update", requestOptions); - } - - /// - /// Updates a [connected account](https://docs.seam.co/core-concepts/connected-accounts). - /// - public async Task UpdateAsync( - List? acceptedCapabilities = default, - bool? automaticallyManageNewDevices = default, - string connectedAccountId = default, - object? customMetadata = default, - string? customerKey = default, - string? displayName = default - ) - { - await UpdateAsync( - new UpdateRequest( - acceptedCapabilities: acceptedCapabilities, - automaticallyManageNewDevices: automaticallyManageNewDevices, - connectedAccountId: connectedAccountId, - customMetadata: customMetadata, - customerKey: customerKey, - displayName: displayName - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.ConnectedAccounts ConnectedAccounts => new(this); - } - - public partial interface ISeamClient - { - public Api.ConnectedAccounts ConnectedAccounts { get; } - } -} diff --git a/src/Seam/Api/CredentialsAcs.cs b/src/Seam/Api/CredentialsAcs.cs deleted file mode 100644 index 5130261b..00000000 --- a/src/Seam/Api/CredentialsAcs.cs +++ /dev/null @@ -1,1426 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class CredentialsAcs - { - private ISeamClient _seam; - - public CredentialsAcs(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Assign a Credential to an ACS User. - /// - [DataContract(Name = "assignRequest_request")] - public class AssignRequest - { - [JsonConstructorAttribute] - protected AssignRequest() { } - - public AssignRequest( - string acsCredentialId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsCredentialId = acsCredentialId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the credential that you want to assign to an access system user. - /// - [DataMember(Name = "acs_credential_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the access system user to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the credential belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Assigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) to a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public void Assign(AssignRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/acs/credentials/assign", requestOptions); - } - - /// - /// Assigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) to a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public void Assign( - string acsCredentialId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - Assign( - new AssignRequest( - acsCredentialId: acsCredentialId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Assigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) to a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task AssignAsync(AssignRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/acs/credentials/assign", requestOptions); - } - - /// - /// Assigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) to a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task AssignAsync( - string acsCredentialId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await AssignAsync( - new AssignRequest( - acsCredentialId: acsCredentialId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Request parameters for Create a Credential for an ACS User. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - CreateRequest.AccessMethodEnum accessMethod = default, - string? acsSystemId = default, - string? acsUserId = default, - List? allowedAcsEntranceIds = default, - CreateRequestAssaAbloyVostioMetadata? assaAbloyVostioMetadata = default, - string? code = default, - string? credentialManagerAcsSystemId = default, - string? endsAt = default, - bool? isMultiPhoneSyncCredential = default, - CreateRequestSaltoSpaceMetadata? saltoSpaceMetadata = default, - string? startsAt = default, - string? userIdentityId = default, - CreateRequestVisionlineMetadata? visionlineMetadata = default - ) - { - AccessMethod = accessMethod; - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - AllowedAcsEntranceIds = allowedAcsEntranceIds; - AssaAbloyVostioMetadata = assaAbloyVostioMetadata; - Code = code; - CredentialManagerAcsSystemId = credentialManagerAcsSystemId; - EndsAt = endsAt; - IsMultiPhoneSyncCredential = isMultiPhoneSyncCredential; - SaltoSpaceMetadata = saltoSpaceMetadata; - StartsAt = startsAt; - UserIdentityId = userIdentityId; - VisionlineMetadata = visionlineMetadata; - } - - /// - /// Access method for the new credential. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AccessMethodEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// Access method for the new credential. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "access_method", IsRequired = true, EmitDefaultValue = false)] - public CreateRequest.AccessMethodEnum AccessMethod { get; set; } - - /// - /// ID of the access system to which the new credential belongs. You must provide either `acs_user_id` or the combination of `user_identity_id` and `acs_system_id`. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user to whom the new credential belongs. You must provide either `acs_user_id` or the combination of `user_identity_id` and `acs_system_id`. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// Set of IDs of the [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) for which the new credential grants access. - /// - [DataMember( - Name = "allowed_acs_entrance_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? AllowedAcsEntranceIds { get; set; } - - /// - /// Vostio-specific metadata for the new credential. - /// - [DataMember( - Name = "assa_abloy_vostio_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public CreateRequestAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; set; } - - /// - /// Access (PIN) code for the new credential. There may be manufacturer-specific code restrictions. For details, see the applicable [device or system integration guide](https://docs.seam.co/device-and-system-integration-guides). - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// ACS system ID of the credential manager for the new credential. - /// - [DataMember( - Name = "credential_manager_acs_system_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CredentialManagerAcsSystemId { get; set; } - - /// - /// Date and time at which the validity of the new credential ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Indicates whether the new credential is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). - /// - [DataMember( - Name = "is_multi_phone_sync_credential", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsMultiPhoneSyncCredential { get; set; } - - /// - /// Salto Space-specific metadata for the new credential. - /// - [DataMember( - Name = "salto_space_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public CreateRequestSaltoSpaceMetadata? SaltoSpaceMetadata { get; set; } - - /// - /// Date and time at which the validity of the new credential starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// ID of the user identity to whom the new credential belongs. You must provide either `acs_user_id` or the combination of `user_identity_id` and `acs_system_id`. If the access system contains a user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the credential belongs to the access system user. If the access system does not have a corresponding user, one is created. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Visionline-specific metadata for the new credential. - /// - [DataMember(Name = "visionline_metadata", IsRequired = false, EmitDefaultValue = false)] - public CreateRequestVisionlineMetadata? VisionlineMetadata { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestAssaAbloyVostioMetadata_model")] - public class CreateRequestAssaAbloyVostioMetadata - { - [JsonConstructorAttribute] - protected CreateRequestAssaAbloyVostioMetadata() { } - - public CreateRequestAssaAbloyVostioMetadata( - bool? autoJoin = default, - bool? joinAllGuestAcsEntrances = default, - bool? overrideAllGuestAcsEntrances = default, - List? overrideGuestAcsEntranceIds = default - ) - { - AutoJoin = autoJoin; - JoinAllGuestAcsEntrances = joinAllGuestAcsEntrances; - OverrideAllGuestAcsEntrances = overrideAllGuestAcsEntrances; - OverrideGuestAcsEntranceIds = overrideGuestAcsEntranceIds; - } - - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - [DataMember( - Name = "join_all_guest_acs_entrances", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? JoinAllGuestAcsEntrances { get; set; } - - [DataMember( - Name = "override_all_guest_acs_entrances", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? OverrideAllGuestAcsEntrances { get; set; } - - [DataMember( - Name = "override_guest_acs_entrance_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? OverrideGuestAcsEntranceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestSaltoSpaceMetadata_model")] - public class CreateRequestSaltoSpaceMetadata - { - [JsonConstructorAttribute] - protected CreateRequestSaltoSpaceMetadata() { } - - public CreateRequestSaltoSpaceMetadata(bool? assignNewKey = default) - { - AssignNewKey = assignNewKey; - } - - /// - /// Indicates whether to assign a first, new card to a user. See also [Programming Salto Space Card-based Credentials](https://docs.seam.co/device-and-system-integration-guides/salto-proaccess-space-access-system/programming-salto-space-card-based-credentials). - /// - [DataMember(Name = "assign_new_key", IsRequired = false, EmitDefaultValue = false)] - public bool? AssignNewKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestVisionlineMetadata_model")] - public class CreateRequestVisionlineMetadata - { - [JsonConstructorAttribute] - protected CreateRequestVisionlineMetadata() { } - - public CreateRequestVisionlineMetadata( - bool? autoJoin = default, - CreateRequestVisionlineMetadata.CardFormatEnum? cardFormat = default, - CreateRequestVisionlineMetadata.CardFunctionTypeEnum? cardFunctionType = default, - List? joinerAcsCredentialIds = default, - bool? mustOverride = default - ) - { - AutoJoin = autoJoin; - CardFormat = cardFormat; - CardFunctionType = cardFunctionType; - JoinerAcsCredentialIds = joinerAcsCredentialIds; - Override = mustOverride; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum CardFormatEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "TLCode")] - TlCode = 1, - - [EnumMember(Value = "rfid48")] - Rfid48 = 2, - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum CardFunctionTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "guest")] - Guest = 1, - - [EnumMember(Value = "staff")] - Staff = 2, - } - - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - [DataMember(Name = "card_format", IsRequired = false, EmitDefaultValue = false)] - public CreateRequestVisionlineMetadata.CardFormatEnum? CardFormat { get; set; } - - [DataMember(Name = "card_function_type", IsRequired = false, EmitDefaultValue = false)] - public CreateRequestVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; set; } - - [DataMember( - Name = "joiner_acs_credential_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? JoinerAcsCredentialIds { get; set; } - - [DataMember(Name = "override", IsRequired = false, EmitDefaultValue = false)] - public bool? Override { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(AcsCredential acsCredential = default) - { - AcsCredential = acsCredential; - } - - /// - /// OK - /// - [DataMember(Name = "acs_credential", IsRequired = false, EmitDefaultValue = false)] - public AcsCredential AcsCredential { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [credential](https://docs.seam.co/low-level-apis/managing-credentials) for a specified [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they create and manage the underlying credentials for you, across access systems and standalone smart locks alike. Use this low-level endpoint only when you need direct control over an individual ACS credential. - /// - public AcsCredential Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/acs/credentials/create", requestOptions) - .EnsureData("/acs/credentials/create") - .AcsCredential; - } - - /// - /// Creates a new [credential](https://docs.seam.co/low-level-apis/managing-credentials) for a specified [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they create and manage the underlying credentials for you, across access systems and standalone smart locks alike. Use this low-level endpoint only when you need direct control over an individual ACS credential. - /// - public AcsCredential Create( - CreateRequest.AccessMethodEnum accessMethod = default, - string? acsSystemId = default, - string? acsUserId = default, - List? allowedAcsEntranceIds = default, - CreateRequestAssaAbloyVostioMetadata? assaAbloyVostioMetadata = default, - string? code = default, - string? credentialManagerAcsSystemId = default, - string? endsAt = default, - bool? isMultiPhoneSyncCredential = default, - CreateRequestSaltoSpaceMetadata? saltoSpaceMetadata = default, - string? startsAt = default, - string? userIdentityId = default, - CreateRequestVisionlineMetadata? visionlineMetadata = default - ) - { - return Create( - new CreateRequest( - accessMethod: accessMethod, - acsSystemId: acsSystemId, - acsUserId: acsUserId, - allowedAcsEntranceIds: allowedAcsEntranceIds, - assaAbloyVostioMetadata: assaAbloyVostioMetadata, - code: code, - credentialManagerAcsSystemId: credentialManagerAcsSystemId, - endsAt: endsAt, - isMultiPhoneSyncCredential: isMultiPhoneSyncCredential, - saltoSpaceMetadata: saltoSpaceMetadata, - startsAt: startsAt, - userIdentityId: userIdentityId, - visionlineMetadata: visionlineMetadata - ) - ); - } - - /// - /// Creates a new [credential](https://docs.seam.co/low-level-apis/managing-credentials) for a specified [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they create and manage the underlying credentials for you, across access systems and standalone smart locks alike. Use this low-level endpoint only when you need direct control over an individual ACS credential. - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync("/acs/credentials/create", requestOptions) - ) - .EnsureData("/acs/credentials/create") - .AcsCredential; - } - - /// - /// Creates a new [credential](https://docs.seam.co/low-level-apis/managing-credentials) for a specified [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they create and manage the underlying credentials for you, across access systems and standalone smart locks alike. Use this low-level endpoint only when you need direct control over an individual ACS credential. - /// - public async Task CreateAsync( - CreateRequest.AccessMethodEnum accessMethod = default, - string? acsSystemId = default, - string? acsUserId = default, - List? allowedAcsEntranceIds = default, - CreateRequestAssaAbloyVostioMetadata? assaAbloyVostioMetadata = default, - string? code = default, - string? credentialManagerAcsSystemId = default, - string? endsAt = default, - bool? isMultiPhoneSyncCredential = default, - CreateRequestSaltoSpaceMetadata? saltoSpaceMetadata = default, - string? startsAt = default, - string? userIdentityId = default, - CreateRequestVisionlineMetadata? visionlineMetadata = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - accessMethod: accessMethod, - acsSystemId: acsSystemId, - acsUserId: acsUserId, - allowedAcsEntranceIds: allowedAcsEntranceIds, - assaAbloyVostioMetadata: assaAbloyVostioMetadata, - code: code, - credentialManagerAcsSystemId: credentialManagerAcsSystemId, - endsAt: endsAt, - isMultiPhoneSyncCredential: isMultiPhoneSyncCredential, - saltoSpaceMetadata: saltoSpaceMetadata, - startsAt: startsAt, - userIdentityId: userIdentityId, - visionlineMetadata: visionlineMetadata - ) - ) - ); - } - - /// - /// Request parameters for Delete a Credential. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string acsCredentialId = default) - { - AcsCredentialId = acsCredentialId; - } - - /// - /// ID of the credential that you want to delete. - /// - [DataMember(Name = "acs_credential_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/acs/credentials/delete", requestOptions); - } - - /// - /// Deletes a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public void Delete(string acsCredentialId = default) - { - Delete(new DeleteRequest(acsCredentialId: acsCredentialId)); - } - - /// - /// Deletes a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/acs/credentials/delete", requestOptions); - } - - /// - /// Deletes a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task DeleteAsync(string acsCredentialId = default) - { - await DeleteAsync(new DeleteRequest(acsCredentialId: acsCredentialId)); - } - - /// - /// Request parameters for Get a Credential. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string acsCredentialId = default) - { - AcsCredentialId = acsCredentialId; - } - - /// - /// ID of the credential that you want to get. - /// - [DataMember(Name = "acs_credential_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(AcsCredential acsCredential = default) - { - AcsCredential = acsCredential; - } - - /// - /// OK - /// - [DataMember(Name = "acs_credential", IsRequired = false, EmitDefaultValue = false)] - public AcsCredential AcsCredential { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public AcsCredential Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/credentials/get", requestOptions) - .EnsureData("/acs/credentials/get") - .AcsCredential; - } - - /// - /// Returns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public AcsCredential Get(string acsCredentialId = default) - { - return Get(new GetRequest(acsCredentialId: acsCredentialId)); - } - - /// - /// Returns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/credentials/get", requestOptions)) - .EnsureData("/acs/credentials/get") - .AcsCredential; - } - - /// - /// Returns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task GetAsync(string acsCredentialId = default) - { - return (await GetAsync(new GetRequest(acsCredentialId: acsCredentialId))); - } - - /// - /// Request parameters for List Credentials. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? acsSystemId = default, - string? acsUserId = default, - string? createdBefore = default, - bool? isMultiPhoneSyncCredential = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentityId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - CreatedBefore = createdBefore; - IsMultiPhoneSyncCredential = isMultiPhoneSyncCredential; - Limit = limit; - PageCursor = pageCursor; - Search = search; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access system for which you want to retrieve all credentials. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user for which you want to retrieve all credentials. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// Date and time, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format, before which events to return were created. - /// - [DataMember(Name = "created_before", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedBefore { get; set; } - - /// - /// Indicates whether you want to retrieve only multi-phone sync credentials or non-multi-phone sync credentials. - /// - [DataMember( - Name = "is_multi_phone_sync_credential", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsMultiPhoneSyncCredential { get; set; } - - /// - /// Number of credentials to return. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned credentials to include all records that satisfy a partial match using `display_name`, `code`, `card_number`, `acs_user_id` or `acs_credential_id`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// ID of the user identity for which you want to retrieve all credentials. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List acsCredentials = default) - { - AcsCredentials = acsCredentials; - } - - /// - /// OK - /// - [DataMember(Name = "acs_credentials", IsRequired = false, EmitDefaultValue = false)] - public List AcsCredentials { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/credentials/list", requestOptions) - .EnsureData("/acs/credentials/list") - .AcsCredentials; - } - - /// - /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public List List( - string? acsSystemId = default, - string? acsUserId = default, - string? createdBefore = default, - bool? isMultiPhoneSyncCredential = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentityId = default - ) - { - return List( - new ListRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - createdBefore: createdBefore, - isMultiPhoneSyncCredential: isMultiPhoneSyncCredential, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/credentials/list", requestOptions)) - .EnsureData("/acs/credentials/list") - .AcsCredentials; - } - - /// - /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task> ListAsync( - string? acsSystemId = default, - string? acsUserId = default, - string? createdBefore = default, - bool? isMultiPhoneSyncCredential = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentityId = default - ) - { - return ( - await ListAsync( - new ListRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - createdBefore: createdBefore, - isMultiPhoneSyncCredential: isMultiPhoneSyncCredential, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentityId: userIdentityId - ) - ) - ); - } - - /// - /// Request parameters for List Accessible Entrances. - /// - [DataContract(Name = "listAccessibleEntrancesRequest_request")] - public class ListAccessibleEntrancesRequest - { - [JsonConstructorAttribute] - protected ListAccessibleEntrancesRequest() { } - - public ListAccessibleEntrancesRequest(string acsCredentialId = default) - { - AcsCredentialId = acsCredentialId; - } - - /// - /// ID of the credential for which you want to retrieve all entrances to which the credential grants access. - /// - [DataMember(Name = "acs_credential_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listAccessibleEntrancesResponse_response")] - public class ListAccessibleEntrancesResponse - { - [JsonConstructorAttribute] - protected ListAccessibleEntrancesResponse() { } - - public ListAccessibleEntrancesResponse(List acsEntrances = default) - { - AcsEntrances = acsEntrances; - } - - /// - /// OK - /// - [DataMember(Name = "acs_entrances", IsRequired = false, EmitDefaultValue = false)] - public List AcsEntrances { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [entrances](https://docs.seam.co/api/acs/entrances) to which a [credential](https://docs.seam.co/api/acs/credentials) grants access. - /// - public List ListAccessibleEntrances(ListAccessibleEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get( - "/acs/credentials/list_accessible_entrances", - requestOptions - ) - .EnsureData("/acs/credentials/list_accessible_entrances") - .AcsEntrances; - } - - /// - /// Returns a list of all [entrances](https://docs.seam.co/api/acs/entrances) to which a [credential](https://docs.seam.co/api/acs/credentials) grants access. - /// - public List ListAccessibleEntrances(string acsCredentialId = default) - { - return ListAccessibleEntrances( - new ListAccessibleEntrancesRequest(acsCredentialId: acsCredentialId) - ); - } - - /// - /// Returns a list of all [entrances](https://docs.seam.co/api/acs/entrances) to which a [credential](https://docs.seam.co/api/acs/credentials) grants access. - /// - public async Task> ListAccessibleEntrancesAsync( - ListAccessibleEntrancesRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/acs/credentials/list_accessible_entrances", - requestOptions - ) - ) - .EnsureData("/acs/credentials/list_accessible_entrances") - .AcsEntrances; - } - - /// - /// Returns a list of all [entrances](https://docs.seam.co/api/acs/entrances) to which a [credential](https://docs.seam.co/api/acs/credentials) grants access. - /// - public async Task> ListAccessibleEntrancesAsync( - string acsCredentialId = default - ) - { - return ( - await ListAccessibleEntrancesAsync( - new ListAccessibleEntrancesRequest(acsCredentialId: acsCredentialId) - ) - ); - } - - /// - /// Request parameters for Unassign a Credential from an ACS User. - /// - [DataContract(Name = "unassignRequest_request")] - public class UnassignRequest - { - [JsonConstructorAttribute] - protected UnassignRequest() { } - - public UnassignRequest( - string acsCredentialId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsCredentialId = acsCredentialId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the credential that you want to unassign from an access system user. - /// - [DataMember(Name = "acs_credential_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the access system user from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Unassigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public void Unassign(UnassignRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/acs/credentials/unassign", requestOptions); - } - - /// - /// Unassigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public void Unassign( - string acsCredentialId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - Unassign( - new UnassignRequest( - acsCredentialId: acsCredentialId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Unassigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task UnassignAsync(UnassignRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/acs/credentials/unassign", requestOptions); - } - - /// - /// Unassigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task UnassignAsync( - string acsCredentialId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await UnassignAsync( - new UnassignRequest( - acsCredentialId: acsCredentialId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Request parameters for Update a Credential. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string acsCredentialId = default, - string? code = default, - string? endsAt = default - ) - { - AcsCredentialId = acsCredentialId; - Code = code; - EndsAt = endsAt; - } - - /// - /// ID of the credential that you want to update. - /// - [DataMember(Name = "acs_credential_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// Replacement access (PIN) code for the credential that you want to update. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Replacement date and time at which the validity of the credential ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after the `starts_at` value that you set when creating the credential. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates the code and ends at date and time for a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/acs/credentials/update", requestOptions); - } - - /// - /// Updates the code and ends at date and time for a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public void Update( - string acsCredentialId = default, - string? code = default, - string? endsAt = default - ) - { - Update(new UpdateRequest(acsCredentialId: acsCredentialId, code: code, endsAt: endsAt)); - } - - /// - /// Updates the code and ends at date and time for a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/acs/credentials/update", requestOptions); - } - - /// - /// Updates the code and ends at date and time for a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task UpdateAsync( - string acsCredentialId = default, - string? code = default, - string? endsAt = default - ) - { - await UpdateAsync( - new UpdateRequest(acsCredentialId: acsCredentialId, code: code, endsAt: endsAt) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.CredentialsAcs CredentialsAcs => new(this); - } - - public partial interface ISeamClient - { - public Api.CredentialsAcs CredentialsAcs { get; } - } -} diff --git a/src/Seam/Api/Customers.cs b/src/Seam/Api/Customers.cs deleted file mode 100644 index 755dfd09..00000000 --- a/src/Seam/Api/Customers.cs +++ /dev/null @@ -1,5220 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class Customers - { - private ISeamClient _seam; - - public Customers(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create Customer Portal. - /// - [DataContract(Name = "createPortalRequest_request")] - public class CreatePortalRequest - { - [JsonConstructorAttribute] - protected CreatePortalRequest() { } - - public CreatePortalRequest( - List? customerResourcesFilters = - default, - string? customizationProfileId = default, - CreatePortalRequestDeepLink? deepLink = default, - bool? excludeLocalePicker = default, - CreatePortalRequestFeatures? features = default, - bool? isEmbedded = default, - CreatePortalRequestLandingPage? landingPage = default, - CreatePortalRequest.LocaleEnum? locale = default, - CreatePortalRequest.NavigationModeEnum? navigationMode = default, - bool? readOnly = default, - CreatePortalRequestCustomerData? customerData = default - ) - { - CustomerResourcesFilters = customerResourcesFilters; - CustomizationProfileId = customizationProfileId; - DeepLink = deepLink; - ExcludeLocalePicker = excludeLocalePicker; - Features = features; - IsEmbedded = isEmbedded; - LandingPage = landingPage; - Locale = locale; - NavigationMode = navigationMode; - ReadOnly = readOnly; - CustomerData = customerData; - } - - /// - /// The locale to use for the portal. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum LocaleEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "en-US")] - EnUs = 1, - - [EnumMember(Value = "pt-PT")] - PtPt = 2, - - [EnumMember(Value = "fr-FR")] - FrFr = 3, - - [EnumMember(Value = "it-IT")] - ItIt = 4, - - [EnumMember(Value = "es-ES")] - EsEs = 5, - - [EnumMember(Value = "de-DE")] - DeDe = 6, - - [EnumMember(Value = "nl-NL")] - NlNl = 7, - - [EnumMember(Value = "el-GR")] - ElGr = 8, - - [EnumMember(Value = "pl-PL")] - PlPl = 9, - - [EnumMember(Value = "ru-RU")] - RuRu = 10, - } - - /// - /// Navigation mode for the portal. 'restricted' tells frontend to hide navigation UI, typically used for embedded deep links. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum NavigationModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "full")] - Full = 1, - - [EnumMember(Value = "restricted")] - Restricted = 2, - } - - /// - /// Filter configuration for resources based on their custom_metadata. Each filter specifies a field, operation, and value to match against resource custom_metadata. - /// - [DataMember( - Name = "customer_resources_filters", - IsRequired = false, - EmitDefaultValue = false - )] - public List? CustomerResourcesFilters { get; set; } - - /// - /// The ID of the customization profile to use for the portal. - /// - [DataMember( - Name = "customization_profile_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomizationProfileId { get; set; } - - /// - /// Deep link target resource for initial redirect. When set, the portal will navigate directly to the specified resource. - /// - [DataMember(Name = "deep_link", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestDeepLink? DeepLink { get; set; } - - /// - /// Whether to exclude the option to select a locale within the portal UI. - /// - [DataMember( - Name = "exclude_locale_picker", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? ExcludeLocalePicker { get; set; } - - [DataMember(Name = "features", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestFeatures? Features { get; set; } - - /// - /// Whether the portal is embedded in another application. - /// - [DataMember(Name = "is_embedded", IsRequired = false, EmitDefaultValue = false)] - public bool? IsEmbedded { get; set; } - - /// - /// Configuration for the landing page when the portal loads. - /// - [DataMember(Name = "landing_page", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestLandingPage? LandingPage { get; set; } - - /// - /// The locale to use for the portal. - /// - [DataMember(Name = "locale", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequest.LocaleEnum? Locale { get; set; } - - /// - /// Navigation mode for the portal. 'restricted' tells frontend to hide navigation UI, typically used for embedded deep links. - /// - [DataMember(Name = "navigation_mode", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequest.NavigationModeEnum? NavigationMode { get; set; } - - /// - /// Whether the portal is read-only. When true, the customer can browse the portal but cannot perform any mutating action; write requests made with the portal's client session are rejected. - /// - [DataMember(Name = "read_only", IsRequired = false, EmitDefaultValue = false)] - public bool? ReadOnly { get; set; } - - [DataMember(Name = "customer_data", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestCustomerData? CustomerData { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerResourcesFilters_model")] - public class CreatePortalRequestCustomerResourcesFilters - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerResourcesFilters() { } - - public CreatePortalRequestCustomerResourcesFilters( - string? field = default, - CreatePortalRequestCustomerResourcesFilters.OperationEnum? operation = default, - string? value = default - ) - { - Field = field; - Operation = operation; - Value = value; - } - - /// - /// The comparison operation. Currently only '=' is supported. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum OperationEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "=")] - empty = 1, - } - - /// - /// The custom_metadata field name to filter on. - /// - [DataMember(Name = "field", IsRequired = false, EmitDefaultValue = false)] - public string? Field { get; set; } - - /// - /// The comparison operation. Currently only '=' is supported. - /// - [DataMember(Name = "operation", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestCustomerResourcesFilters.OperationEnum? Operation { get; set; } - - /// - /// The value to compare against. - /// - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public string? Value { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestDeepLink_model")] - public class CreatePortalRequestDeepLink - { - [JsonConstructorAttribute] - protected CreatePortalRequestDeepLink() { } - - public CreatePortalRequestDeepLink( - string? resourceKey = default, - CreatePortalRequestDeepLink.ResourceTypeEnum? resourceType = default, - string? resourceId = default - ) - { - ResourceKey = resourceKey; - ResourceType = resourceType; - ResourceId = resourceId; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ResourceTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "reservation")] - Reservation = 1, - - [EnumMember(Value = "space")] - Space = 2, - - [EnumMember(Value = "device")] - Device = 3, - } - - [DataMember(Name = "resource_key", IsRequired = false, EmitDefaultValue = false)] - public string? ResourceKey { get; set; } - - [DataMember(Name = "resource_type", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestDeepLink.ResourceTypeEnum? ResourceType { get; set; } - - [DataMember(Name = "resource_id", IsRequired = false, EmitDefaultValue = false)] - public string? ResourceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestFeatures_model")] - public class CreatePortalRequestFeatures - { - [JsonConstructorAttribute] - protected CreatePortalRequestFeatures() { } - - public CreatePortalRequestFeatures( - CreatePortalRequestFeaturesConfigure? configure = default, - CreatePortalRequestFeaturesConnect? connect = default, - CreatePortalRequestFeaturesManage? manage = default, - CreatePortalRequestFeaturesManageDevices? manageDevices = default, - CreatePortalRequestFeaturesOrganize? organize = default - ) - { - Configure = configure; - Connect = connect; - Manage = manage; - ManageDevices = manageDevices; - Organize = organize; - } - - /// - /// Configuration for the configure feature. - /// - [DataMember(Name = "configure", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestFeaturesConfigure? Configure { get; set; } - - /// - /// Configuration for the connect accounts feature. - /// - [DataMember(Name = "connect", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestFeaturesConnect? Connect { get; set; } - - /// - /// Configuration for the manage feature. - /// - [DataMember(Name = "manage", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestFeaturesManage? Manage { get; set; } - - /// - /// Configuration for the manage devices feature. - /// --- - /// deprecated: Use `manage` instead. - /// --- - /// - [DataMember(Name = "manage_devices", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestFeaturesManageDevices? ManageDevices { get; set; } - - /// - /// Configuration for the organize feature. - /// - [DataMember(Name = "organize", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestFeaturesOrganize? Organize { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestFeaturesConfigure_model")] - public class CreatePortalRequestFeaturesConfigure - { - [JsonConstructorAttribute] - protected CreatePortalRequestFeaturesConfigure() { } - - public CreatePortalRequestFeaturesConfigure( - bool? allowAccessAutomationRuleCustomization = default, - bool? allowClimateAutomationRuleCustomization = default, - bool? allowInstantKeyCustomization = default, - bool? exclude = default - ) - { - AllowAccessAutomationRuleCustomization = allowAccessAutomationRuleCustomization; - AllowClimateAutomationRuleCustomization = allowClimateAutomationRuleCustomization; - AllowInstantKeyCustomization = allowInstantKeyCustomization; - Exclude = exclude; - } - - /// - /// Indicates whether the customer can customize the access automation rules for their properties. - /// - [DataMember( - Name = "allow_access_automation_rule_customization", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AllowAccessAutomationRuleCustomization { get; set; } - - /// - /// Indicates whether the customer can customize the climate automation rules for their properties. - /// - [DataMember( - Name = "allow_climate_automation_rule_customization", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AllowClimateAutomationRuleCustomization { get; set; } - - /// - /// Indicates whether the customer can customize the Instant Key profile for their properties. - /// - [DataMember( - Name = "allow_instant_key_customization", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AllowInstantKeyCustomization { get; set; } - - /// - /// Whether to exclude this feature from the portal. - /// - [DataMember(Name = "exclude", IsRequired = false, EmitDefaultValue = false)] - public bool? Exclude { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestFeaturesConnect_model")] - public class CreatePortalRequestFeaturesConnect - { - [JsonConstructorAttribute] - protected CreatePortalRequestFeaturesConnect() { } - - public CreatePortalRequestFeaturesConnect( - List? acceptedProviders = default, - bool? exclude = default, - List? excludedProviders = default - ) - { - AcceptedProviders = acceptedProviders; - Exclude = exclude; - ExcludedProviders = excludedProviders; - } - - /// - /// List of provider keys to allow for the connect feature. These providers will be shown when the customer tries to connect an account. - /// - [DataMember(Name = "accepted_providers", IsRequired = false, EmitDefaultValue = false)] - public List? AcceptedProviders { get; set; } - - /// - /// Whether to exclude this feature from the portal. - /// - [DataMember(Name = "exclude", IsRequired = false, EmitDefaultValue = false)] - public bool? Exclude { get; set; } - - /// - /// List of provider keys to exclude from the connect feature. These providers will not be shown when the customer tries to connect an account. - /// - [DataMember(Name = "excluded_providers", IsRequired = false, EmitDefaultValue = false)] - public List? ExcludedProviders { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestFeaturesManage_model")] - public class CreatePortalRequestFeaturesManage - { - [JsonConstructorAttribute] - protected CreatePortalRequestFeaturesManage() { } - - public CreatePortalRequestFeaturesManage( - CreatePortalRequestFeaturesManageDeviceManagementConfirmation? deviceManagementConfirmation = - default, - CreatePortalRequestFeaturesManageEvents? events = default, - bool? exclude = default, - bool? excludeReservationManagement = default, - bool? excludeReservationTechnicalDetails = default, - bool? excludeStaffManagement = default - ) - { - DeviceManagementConfirmation = deviceManagementConfirmation; - Events = events; - Exclude = exclude; - ExcludeReservationManagement = excludeReservationManagement; - ExcludeReservationTechnicalDetails = excludeReservationTechnicalDetails; - ExcludeStaffManagement = excludeStaffManagement; - } - - /// - /// Custom copy for the confirmation modal shown before unmanaged devices are added to a space and begin being managed (and billed). Only takes effect when the MANAGE_DEVICES_CONFIRMATION_MODAL feature flag is enabled for the workspace. Any omitted string falls back to a localized default. - /// - [DataMember( - Name = "device_management_confirmation", - IsRequired = false, - EmitDefaultValue = false - )] - public CreatePortalRequestFeaturesManageDeviceManagementConfirmation? DeviceManagementConfirmation { get; set; } - - /// - /// Configuration for event type filtering in the manage feature. - /// - [DataMember(Name = "events", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestFeaturesManageEvents? Events { get; set; } - - /// - /// Whether to exclude this feature from the portal. - /// - [DataMember(Name = "exclude", IsRequired = false, EmitDefaultValue = false)] - public bool? Exclude { get; set; } - - /// - /// Indicates whether the customer can manage reservations for their properties. - /// - [DataMember( - Name = "exclude_reservation_management", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? ExcludeReservationManagement { get; set; } - - /// - /// Indicates whether to exclude technical details from reservation views. - /// - [DataMember( - Name = "exclude_reservation_technical_details", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? ExcludeReservationTechnicalDetails { get; set; } - - /// - /// Indicates whether the customer can manage staff for their properties. - /// - [DataMember( - Name = "exclude_staff_management", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? ExcludeStaffManagement { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestFeaturesManageDeviceManagementConfirmation_model")] - public class CreatePortalRequestFeaturesManageDeviceManagementConfirmation - { - [JsonConstructorAttribute] - protected CreatePortalRequestFeaturesManageDeviceManagementConfirmation() { } - - public CreatePortalRequestFeaturesManageDeviceManagementConfirmation( - string? body = default, - string? cancelButtonLabel = default, - string? confirmButtonLabel = default, - string? title = default - ) - { - Body = body; - CancelButtonLabel = cancelButtonLabel; - ConfirmButtonLabel = confirmButtonLabel; - Title = title; - } - - /// - /// Custom body text for the confirmation modal. May include the {count} token, which is replaced with the number of devices that will begin being managed. - /// - [DataMember(Name = "body", IsRequired = false, EmitDefaultValue = false)] - public string? Body { get; set; } - - /// - /// Custom label for the cancel button. - /// - [DataMember(Name = "cancel_button_label", IsRequired = false, EmitDefaultValue = false)] - public string? CancelButtonLabel { get; set; } - - /// - /// Custom label for the confirm button. - /// - [DataMember( - Name = "confirm_button_label", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConfirmButtonLabel { get; set; } - - /// - /// Custom title for the confirmation modal. - /// - [DataMember(Name = "title", IsRequired = false, EmitDefaultValue = false)] - public string? Title { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestFeaturesManageEvents_model")] - public class CreatePortalRequestFeaturesManageEvents - { - [JsonConstructorAttribute] - protected CreatePortalRequestFeaturesManageEvents() { } - - public CreatePortalRequestFeaturesManageEvents( - List? allowedEvents = default, - List? defaultEvents = default - ) - { - AllowedEvents = allowedEvents; - DefaultEvents = defaultEvents; - } - - /// - /// List of event types to show in the events filter. When set, only these event types will be available. Leave empty to show all events. - /// - [DataMember(Name = "allowed_events", IsRequired = false, EmitDefaultValue = false)] - public List? AllowedEvents { get; set; } - - /// - /// List of event types that are pre-selected in the events filter when the user first loads the events tab. - /// - [DataMember(Name = "default_events", IsRequired = false, EmitDefaultValue = false)] - public List? DefaultEvents { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestFeaturesManageDevices_model")] - public class CreatePortalRequestFeaturesManageDevices - { - [JsonConstructorAttribute] - protected CreatePortalRequestFeaturesManageDevices() { } - - public CreatePortalRequestFeaturesManageDevices(bool? exclude = default) - { - Exclude = exclude; - } - - /// - /// Whether to exclude this feature from the portal. - /// - [DataMember(Name = "exclude", IsRequired = false, EmitDefaultValue = false)] - public bool? Exclude { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestFeaturesOrganize_model")] - public class CreatePortalRequestFeaturesOrganize - { - [JsonConstructorAttribute] - protected CreatePortalRequestFeaturesOrganize() { } - - public CreatePortalRequestFeaturesOrganize(bool? exclude = default) - { - Exclude = exclude; - } - - /// - /// Whether to exclude this feature from the portal. - /// - [DataMember(Name = "exclude", IsRequired = false, EmitDefaultValue = false)] - public bool? Exclude { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestLandingPage_model")] - public class CreatePortalRequestLandingPage - { - [JsonConstructorAttribute] - protected CreatePortalRequestLandingPage() { } - - public CreatePortalRequestLandingPage( - CreatePortalRequestLandingPageManage? manage = default - ) - { - Manage = manage; - } - - [DataMember(Name = "manage", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestLandingPageManage? Manage { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestLandingPageManage_model")] - public class CreatePortalRequestLandingPageManage - { - [JsonConstructorAttribute] - protected CreatePortalRequestLandingPageManage() { } - - public CreatePortalRequestLandingPageManage( - string? spaceKey = default, - string? propertyKey = default, - string? roomKey = default, - string? commonAreaKey = default, - string? unitKey = default, - string? facilityKey = default, - string? buildingKey = default, - string? listingKey = default, - string? propertyListingKey = default, - string? siteKey = default, - string? reservationKey = default, - string? bookingKey = default, - string? accessGrantKey = default - ) - { - SpaceKey = spaceKey; - PropertyKey = propertyKey; - RoomKey = roomKey; - CommonAreaKey = commonAreaKey; - UnitKey = unitKey; - FacilityKey = facilityKey; - BuildingKey = buildingKey; - ListingKey = listingKey; - PropertyListingKey = propertyListingKey; - SiteKey = siteKey; - ReservationKey = reservationKey; - BookingKey = bookingKey; - AccessGrantKey = accessGrantKey; - } - - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - [DataMember(Name = "property_key", IsRequired = false, EmitDefaultValue = false)] - public string? PropertyKey { get; set; } - - [DataMember(Name = "room_key", IsRequired = false, EmitDefaultValue = false)] - public string? RoomKey { get; set; } - - [DataMember(Name = "common_area_key", IsRequired = false, EmitDefaultValue = false)] - public string? CommonAreaKey { get; set; } - - [DataMember(Name = "unit_key", IsRequired = false, EmitDefaultValue = false)] - public string? UnitKey { get; set; } - - [DataMember(Name = "facility_key", IsRequired = false, EmitDefaultValue = false)] - public string? FacilityKey { get; set; } - - [DataMember(Name = "building_key", IsRequired = false, EmitDefaultValue = false)] - public string? BuildingKey { get; set; } - - [DataMember(Name = "listing_key", IsRequired = false, EmitDefaultValue = false)] - public string? ListingKey { get; set; } - - [DataMember( - Name = "property_listing_key", - IsRequired = false, - EmitDefaultValue = false - )] - public string? PropertyListingKey { get; set; } - - [DataMember(Name = "site_key", IsRequired = false, EmitDefaultValue = false)] - public string? SiteKey { get; set; } - - [DataMember(Name = "reservation_key", IsRequired = false, EmitDefaultValue = false)] - public string? ReservationKey { get; set; } - - [DataMember(Name = "booking_key", IsRequired = false, EmitDefaultValue = false)] - public string? BookingKey { get; set; } - - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerData_model")] - public class CreatePortalRequestCustomerData - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerData() { } - - public CreatePortalRequestCustomerData( - List? accessGrants = default, - List? bookings = default, - List? buildings = default, - List? commonAreas = default, - string? customerKey = default, - List? facilities = default, - List? guests = default, - List? listings = default, - List? properties = default, - List? propertyListings = default, - List? reservations = default, - List? residents = default, - List? rooms = default, - List? sites = default, - List? spaces = default, - List? staffMembers = default, - List? tenants = default, - List? units = default, - List? userIdentities = default, - List? users = default - ) - { - AccessGrants = accessGrants; - Bookings = bookings; - Buildings = buildings; - CommonAreas = commonAreas; - CustomerKey = customerKey; - Facilities = facilities; - Guests = guests; - Listings = listings; - Properties = properties; - PropertyListings = propertyListings; - Reservations = reservations; - Residents = residents; - Rooms = rooms; - Sites = sites; - Spaces = spaces; - StaffMembers = staffMembers; - Tenants = tenants; - Units = units; - UserIdentities = userIdentities; - Users = users; - } - - /// - /// List of access grants. - /// - [DataMember(Name = "access_grants", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrants { get; set; } - - /// - /// List of bookings. - /// - [DataMember(Name = "bookings", IsRequired = false, EmitDefaultValue = false)] - public List? Bookings { get; set; } - - /// - /// List of buildings. - /// - [DataMember(Name = "buildings", IsRequired = false, EmitDefaultValue = false)] - public List? Buildings { get; set; } - - /// - /// List of shared common areas. - /// - [DataMember(Name = "common_areas", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreas { get; set; } - - /// - /// Your unique identifier for the customer. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// List of gym or fitness facilities. - /// - [DataMember(Name = "facilities", IsRequired = false, EmitDefaultValue = false)] - public List? Facilities { get; set; } - - /// - /// List of guests. - /// - [DataMember(Name = "guests", IsRequired = false, EmitDefaultValue = false)] - public List? Guests { get; set; } - - /// - /// List of property listings. - /// - [DataMember(Name = "listings", IsRequired = false, EmitDefaultValue = false)] - public List? Listings { get; set; } - - /// - /// List of short-term rental properties. - /// - [DataMember(Name = "properties", IsRequired = false, EmitDefaultValue = false)] - public List? Properties { get; set; } - - /// - /// List of property listings. - /// - [DataMember(Name = "property_listings", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyListings { get; set; } - - /// - /// List of reservations. - /// - [DataMember(Name = "reservations", IsRequired = false, EmitDefaultValue = false)] - public List? Reservations { get; set; } - - /// - /// List of residents. - /// - [DataMember(Name = "residents", IsRequired = false, EmitDefaultValue = false)] - public List? Residents { get; set; } - - /// - /// List of hotel or hospitality rooms. - /// - [DataMember(Name = "rooms", IsRequired = false, EmitDefaultValue = false)] - public List? Rooms { get; set; } - - /// - /// List of general sites or areas. - /// - [DataMember(Name = "sites", IsRequired = false, EmitDefaultValue = false)] - public List? Sites { get; set; } - - /// - /// List of general spaces or areas. - /// - [DataMember(Name = "spaces", IsRequired = false, EmitDefaultValue = false)] - public List? Spaces { get; set; } - - /// - /// List of staff members. - /// - [DataMember(Name = "staff_members", IsRequired = false, EmitDefaultValue = false)] - public List? StaffMembers { get; set; } - - /// - /// List of tenants. - /// - [DataMember(Name = "tenants", IsRequired = false, EmitDefaultValue = false)] - public List? Tenants { get; set; } - - /// - /// List of multi-family residential units. - /// - [DataMember(Name = "units", IsRequired = false, EmitDefaultValue = false)] - public List? Units { get; set; } - - /// - /// List of user identities. - /// - [DataMember(Name = "user_identities", IsRequired = false, EmitDefaultValue = false)] - public List? UserIdentities { get; set; } - - /// - /// List of users. - /// - [DataMember(Name = "users", IsRequired = false, EmitDefaultValue = false)] - public List? Users { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataAccessGrants_model")] - public class CreatePortalRequestCustomerDataAccessGrants - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataAccessGrants() { } - - public CreatePortalRequestCustomerDataAccessGrants( - string? accessGrantKey = default, - List? buildingKeys = default, - List? commonAreaKeys = default, - string? endsAt = default, - List? facilityKeys = default, - string? guestKey = default, - List? listingKeys = default, - string? name = default, - string? preferredCode = default, - List? propertyKeys = default, - string? residentKey = default, - List? roomKeys = default, - List? spaceKeys = default, - string? startsAt = default, - string? tenantKey = default, - List? unitKeys = default, - string? userIdentityKey = default, - string? userKey = default - ) - { - AccessGrantKey = accessGrantKey; - BuildingKeys = buildingKeys; - CommonAreaKeys = commonAreaKeys; - EndsAt = endsAt; - FacilityKeys = facilityKeys; - GuestKey = guestKey; - ListingKeys = listingKeys; - Name = name; - PreferredCode = preferredCode; - PropertyKeys = propertyKeys; - ResidentKey = residentKey; - RoomKeys = roomKeys; - SpaceKeys = spaceKeys; - StartsAt = startsAt; - TenantKey = tenantKey; - UnitKeys = unitKeys; - UserIdentityKey = userIdentityKey; - UserKey = userKey; - } - - /// - /// Your unique identifier for the access grant. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// Building keys associated with the access grant. - /// - [DataMember(Name = "building_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BuildingKeys { get; set; } - - /// - /// Common area keys associated with the access grant. - /// - [DataMember(Name = "common_area_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreaKeys { get; set; } - - /// - /// Ending date and time for the access grant. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Facility keys associated with the access grant. - /// - [DataMember(Name = "facility_keys", IsRequired = false, EmitDefaultValue = false)] - public List? FacilityKeys { get; set; } - - /// - /// Guest key associated with the access grant. - /// - [DataMember(Name = "guest_key", IsRequired = false, EmitDefaultValue = false)] - public string? GuestKey { get; set; } - - /// - /// Listing keys associated with the access grant. - /// - [DataMember(Name = "listing_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ListingKeys { get; set; } - - /// - /// Your name for this access grant resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Preferred PIN code to use when creating access for this reservation. - /// - [DataMember(Name = "preferred_code", IsRequired = false, EmitDefaultValue = false)] - public string? PreferredCode { get; set; } - - /// - /// Property keys associated with the access grant. - /// - [DataMember(Name = "property_keys", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyKeys { get; set; } - - /// - /// Resident key associated with the access grant. - /// - [DataMember(Name = "resident_key", IsRequired = false, EmitDefaultValue = false)] - public string? ResidentKey { get; set; } - - /// - /// Room keys associated with the access grant. - /// - [DataMember(Name = "room_keys", IsRequired = false, EmitDefaultValue = false)] - public List? RoomKeys { get; set; } - - /// - /// Space keys associated with the access grant. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// Starting date and time for the access grant. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Tenant key associated with the access grant. - /// - [DataMember(Name = "tenant_key", IsRequired = false, EmitDefaultValue = false)] - public string? TenantKey { get; set; } - - /// - /// Unit keys associated with the access grant. - /// - [DataMember(Name = "unit_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UnitKeys { get; set; } - - /// - /// User identity key associated with the access grant. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - /// - /// User key associated with the access grant. - /// - [DataMember(Name = "user_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataBookings_model")] - public class CreatePortalRequestCustomerDataBookings - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataBookings() { } - - public CreatePortalRequestCustomerDataBookings( - string? bookingKey = default, - List? buildingKeys = default, - List? commonAreaKeys = default, - string? endsAt = default, - List? facilityKeys = default, - string? guestKey = default, - List? listingKeys = default, - string? name = default, - string? preferredCode = default, - List? propertyKeys = default, - string? residentKey = default, - List? roomKeys = default, - List? spaceKeys = default, - string? startsAt = default, - string? tenantKey = default, - List? unitKeys = default, - string? userIdentityKey = default, - string? userKey = default - ) - { - BookingKey = bookingKey; - BuildingKeys = buildingKeys; - CommonAreaKeys = commonAreaKeys; - EndsAt = endsAt; - FacilityKeys = facilityKeys; - GuestKey = guestKey; - ListingKeys = listingKeys; - Name = name; - PreferredCode = preferredCode; - PropertyKeys = propertyKeys; - ResidentKey = residentKey; - RoomKeys = roomKeys; - SpaceKeys = spaceKeys; - StartsAt = startsAt; - TenantKey = tenantKey; - UnitKeys = unitKeys; - UserIdentityKey = userIdentityKey; - UserKey = userKey; - } - - /// - /// Your unique identifier for the booking. - /// - [DataMember(Name = "booking_key", IsRequired = false, EmitDefaultValue = false)] - public string? BookingKey { get; set; } - - /// - /// Building keys associated with the access grant. - /// - [DataMember(Name = "building_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BuildingKeys { get; set; } - - /// - /// Common area keys associated with the access grant. - /// - [DataMember(Name = "common_area_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreaKeys { get; set; } - - /// - /// Ending date and time for the access grant. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Facility keys associated with the access grant. - /// - [DataMember(Name = "facility_keys", IsRequired = false, EmitDefaultValue = false)] - public List? FacilityKeys { get; set; } - - /// - /// Guest key associated with the access grant. - /// - [DataMember(Name = "guest_key", IsRequired = false, EmitDefaultValue = false)] - public string? GuestKey { get; set; } - - /// - /// Listing keys associated with the access grant. - /// - [DataMember(Name = "listing_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ListingKeys { get; set; } - - /// - /// Your name for this access grant resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Preferred PIN code to use when creating access for this reservation. - /// - [DataMember(Name = "preferred_code", IsRequired = false, EmitDefaultValue = false)] - public string? PreferredCode { get; set; } - - /// - /// Property keys associated with the access grant. - /// - [DataMember(Name = "property_keys", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyKeys { get; set; } - - /// - /// Resident key associated with the access grant. - /// - [DataMember(Name = "resident_key", IsRequired = false, EmitDefaultValue = false)] - public string? ResidentKey { get; set; } - - /// - /// Room keys associated with the access grant. - /// - [DataMember(Name = "room_keys", IsRequired = false, EmitDefaultValue = false)] - public List? RoomKeys { get; set; } - - /// - /// Space keys associated with the access grant. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// Starting date and time for the access grant. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Tenant key associated with the access grant. - /// - [DataMember(Name = "tenant_key", IsRequired = false, EmitDefaultValue = false)] - public string? TenantKey { get; set; } - - /// - /// Unit keys associated with the access grant. - /// - [DataMember(Name = "unit_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UnitKeys { get; set; } - - /// - /// User identity key associated with the access grant. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - /// - /// User key associated with the access grant. - /// - [DataMember(Name = "user_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataBuildings_model")] - public class CreatePortalRequestCustomerDataBuildings - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataBuildings() { } - - public CreatePortalRequestCustomerDataBuildings( - string? buildingKey = default, - string? name = default - ) - { - BuildingKey = buildingKey; - Name = name; - } - - /// - /// Your unique identifier for the building. - /// - [DataMember(Name = "building_key", IsRequired = false, EmitDefaultValue = false)] - public string? BuildingKey { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataCommonAreas_model")] - public class CreatePortalRequestCustomerDataCommonAreas - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataCommonAreas() { } - - public CreatePortalRequestCustomerDataCommonAreas( - string? commonAreaKey = default, - string? name = default, - string? parentSiteKey = default - ) - { - CommonAreaKey = commonAreaKey; - Name = name; - ParentSiteKey = parentSiteKey; - } - - /// - /// Your unique identifier for the common area. - /// - [DataMember(Name = "common_area_key", IsRequired = false, EmitDefaultValue = false)] - public string? CommonAreaKey { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "parent_site_key", IsRequired = false, EmitDefaultValue = false)] - public string? ParentSiteKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataFacilities_model")] - public class CreatePortalRequestCustomerDataFacilities - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataFacilities() { } - - public CreatePortalRequestCustomerDataFacilities( - string? facilityKey = default, - string? name = default - ) - { - FacilityKey = facilityKey; - Name = name; - } - - /// - /// Your unique identifier for the facility. - /// - [DataMember(Name = "facility_key", IsRequired = false, EmitDefaultValue = false)] - public string? FacilityKey { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataGuests_model")] - public class CreatePortalRequestCustomerDataGuests - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataGuests() { } - - public CreatePortalRequestCustomerDataGuests( - string? emailAddress = default, - string? guestKey = default, - string? name = default, - string? phoneNumber = default - ) - { - EmailAddress = emailAddress; - GuestKey = guestKey; - Name = name; - PhoneNumber = phoneNumber; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your unique identifier for the guest. - /// - [DataMember(Name = "guest_key", IsRequired = false, EmitDefaultValue = false)] - public string? GuestKey { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataListings_model")] - public class CreatePortalRequestCustomerDataListings - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataListings() { } - - public CreatePortalRequestCustomerDataListings( - string? listingKey = default, - string? name = default - ) - { - ListingKey = listingKey; - Name = name; - } - - /// - /// Your unique identifier for the listing. - /// - [DataMember(Name = "listing_key", IsRequired = false, EmitDefaultValue = false)] - public string? ListingKey { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataProperties_model")] - public class CreatePortalRequestCustomerDataProperties - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataProperties() { } - - public CreatePortalRequestCustomerDataProperties( - string? name = default, - string? propertyKey = default - ) - { - Name = name; - PropertyKey = propertyKey; - } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the property. - /// - [DataMember(Name = "property_key", IsRequired = false, EmitDefaultValue = false)] - public string? PropertyKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataPropertyListings_model")] - public class CreatePortalRequestCustomerDataPropertyListings - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataPropertyListings() { } - - public CreatePortalRequestCustomerDataPropertyListings( - object? customMetadata = default, - string? name = default, - string? propertyListingKey = default - ) - { - CustomMetadata = customMetadata; - Name = name; - PropertyListingKey = propertyListingKey; - } - - /// - /// Set key:value pairs. Accepts string or Boolean values. Adding custom metadata to a property listing enables you to store custom information, like customer details or internal IDs from your application. Set a key to `null` or to an empty string to remove that key from the custom metadata. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadata { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the property listing. - /// - [DataMember( - Name = "property_listing_key", - IsRequired = false, - EmitDefaultValue = false - )] - public string? PropertyListingKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataReservations_model")] - public class CreatePortalRequestCustomerDataReservations - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataReservations() { } - - public CreatePortalRequestCustomerDataReservations( - List? buildingKeys = default, - List? commonAreaKeys = default, - object? customMetadata = default, - string? endsAt = default, - List? facilityKeys = default, - string? guestKey = default, - List? listingKeys = default, - string? name = default, - string? preferredCode = default, - List? propertyKeys = default, - string? reservationKey = default, - string? residentKey = default, - List? roomKeys = default, - List? spaceKeys = default, - string? startsAt = default, - string? tenantKey = default, - List? unitKeys = default, - string? userIdentityKey = default, - string? userKey = default - ) - { - BuildingKeys = buildingKeys; - CommonAreaKeys = commonAreaKeys; - CustomMetadata = customMetadata; - EndsAt = endsAt; - FacilityKeys = facilityKeys; - GuestKey = guestKey; - ListingKeys = listingKeys; - Name = name; - PreferredCode = preferredCode; - PropertyKeys = propertyKeys; - ReservationKey = reservationKey; - ResidentKey = residentKey; - RoomKeys = roomKeys; - SpaceKeys = spaceKeys; - StartsAt = startsAt; - TenantKey = tenantKey; - UnitKeys = unitKeys; - UserIdentityKey = userIdentityKey; - UserKey = userKey; - } - - /// - /// Building keys associated with the access grant. - /// - [DataMember(Name = "building_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BuildingKeys { get; set; } - - /// - /// Common area keys associated with the access grant. - /// - [DataMember(Name = "common_area_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreaKeys { get; set; } - - /// - /// Set key:value pairs for filtering reservations by custom criteria. Set a key to `null` or to an empty string to remove that key from the custom metadata. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadata { get; set; } - - /// - /// Ending date and time for the access grant. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Facility keys associated with the access grant. - /// - [DataMember(Name = "facility_keys", IsRequired = false, EmitDefaultValue = false)] - public List? FacilityKeys { get; set; } - - /// - /// Guest key associated with the access grant. - /// - [DataMember(Name = "guest_key", IsRequired = false, EmitDefaultValue = false)] - public string? GuestKey { get; set; } - - /// - /// Listing keys associated with the access grant. - /// - [DataMember(Name = "listing_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ListingKeys { get; set; } - - /// - /// Your name for this access grant resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Preferred PIN code to use when creating access for this reservation. - /// - [DataMember(Name = "preferred_code", IsRequired = false, EmitDefaultValue = false)] - public string? PreferredCode { get; set; } - - /// - /// Property keys associated with the access grant. - /// - [DataMember(Name = "property_keys", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyKeys { get; set; } - - /// - /// Your unique identifier for the reservation. - /// - [DataMember(Name = "reservation_key", IsRequired = false, EmitDefaultValue = false)] - public string? ReservationKey { get; set; } - - /// - /// Resident key associated with the access grant. - /// - [DataMember(Name = "resident_key", IsRequired = false, EmitDefaultValue = false)] - public string? ResidentKey { get; set; } - - /// - /// Room keys associated with the access grant. - /// - [DataMember(Name = "room_keys", IsRequired = false, EmitDefaultValue = false)] - public List? RoomKeys { get; set; } - - /// - /// Space keys associated with the access grant. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// Starting date and time for the access grant. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Tenant key associated with the access grant. - /// - [DataMember(Name = "tenant_key", IsRequired = false, EmitDefaultValue = false)] - public string? TenantKey { get; set; } - - /// - /// Unit keys associated with the access grant. - /// - [DataMember(Name = "unit_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UnitKeys { get; set; } - - /// - /// User identity key associated with the access grant. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - /// - /// User key associated with the access grant. - /// - [DataMember(Name = "user_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataResidents_model")] - public class CreatePortalRequestCustomerDataResidents - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataResidents() { } - - public CreatePortalRequestCustomerDataResidents( - string? emailAddress = default, - string? name = default, - string? phoneNumber = default, - string? residentKey = default - ) - { - EmailAddress = emailAddress; - Name = name; - PhoneNumber = phoneNumber; - ResidentKey = residentKey; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Your unique identifier for the resident. - /// - [DataMember(Name = "resident_key", IsRequired = false, EmitDefaultValue = false)] - public string? ResidentKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataRooms_model")] - public class CreatePortalRequestCustomerDataRooms - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataRooms() { } - - public CreatePortalRequestCustomerDataRooms( - string? name = default, - string? parentSiteKey = default, - string? roomKey = default - ) - { - Name = name; - ParentSiteKey = parentSiteKey; - RoomKey = roomKey; - } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "parent_site_key", IsRequired = false, EmitDefaultValue = false)] - public string? ParentSiteKey { get; set; } - - /// - /// Your unique identifier for the room. - /// - [DataMember(Name = "room_key", IsRequired = false, EmitDefaultValue = false)] - public string? RoomKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataSites_model")] - public class CreatePortalRequestCustomerDataSites - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataSites() { } - - public CreatePortalRequestCustomerDataSites( - string? name = default, - string? siteKey = default - ) - { - Name = name; - SiteKey = siteKey; - } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "site_key", IsRequired = false, EmitDefaultValue = false)] - public string? SiteKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataSpaces_model")] - public class CreatePortalRequestCustomerDataSpaces - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataSpaces() { } - - public CreatePortalRequestCustomerDataSpaces( - CreatePortalRequestCustomerDataSpacesCustomerData? customerData = default, - int? durationMinutes = default, - CreatePortalRequestCustomerDataSpacesGeolocation? geolocation = default, - string? name = default, - string? parentSiteKey = default, - string? spaceKey = default - ) - { - CustomerData = customerData; - DurationMinutes = durationMinutes; - Geolocation = geolocation; - Name = name; - ParentSiteKey = parentSiteKey; - SpaceKey = spaceKey; - } - - /// - /// Reservation/stay-related defaults for the space (time zone, default check-in/out times, address). - /// - [DataMember(Name = "customer_data", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestCustomerDataSpacesCustomerData? CustomerData { get; set; } - - /// - /// Default duration of this space in minutes, when the space represents a fixed-length bookable slot (e.g. an appointment type). Used to interpret reservations booked against this space. - /// - [DataMember(Name = "duration_minutes", IsRequired = false, EmitDefaultValue = false)] - public int? DurationMinutes { get; set; } - - /// - /// Geographic coordinates (latitude and longitude) of the space. - /// - [DataMember(Name = "geolocation", IsRequired = false, EmitDefaultValue = false)] - public CreatePortalRequestCustomerDataSpacesGeolocation? Geolocation { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "parent_site_key", IsRequired = false, EmitDefaultValue = false)] - public string? ParentSiteKey { get; set; } - - /// - /// Your unique identifier for the space. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataSpacesCustomerData_model")] - public class CreatePortalRequestCustomerDataSpacesCustomerData - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataSpacesCustomerData() { } - - public CreatePortalRequestCustomerDataSpacesCustomerData( - string? address = default, - string? defaultCheckinTime = default, - string? defaultCheckoutTime = default, - string? timeZone = default - ) - { - Address = address; - DefaultCheckinTime = defaultCheckinTime; - DefaultCheckoutTime = defaultCheckoutTime; - TimeZone = timeZone; - } - - /// - /// Postal address for the space. - /// - [DataMember(Name = "address", IsRequired = false, EmitDefaultValue = false)] - public string? Address { get; set; } - - /// - /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember( - Name = "default_checkin_time", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DefaultCheckinTime { get; set; } - - /// - /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember( - Name = "default_checkout_time", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DefaultCheckoutTime { get; set; } - - /// - /// IANA time zone for the space, e.g. America/Los_Angeles. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataSpacesGeolocation_model")] - public class CreatePortalRequestCustomerDataSpacesGeolocation - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataSpacesGeolocation() { } - - public CreatePortalRequestCustomerDataSpacesGeolocation( - float? latitude = default, - float? longitude = default - ) - { - Latitude = latitude; - Longitude = longitude; - } - - /// - /// Latitude of the space, in decimal degrees. - /// - [DataMember(Name = "latitude", IsRequired = false, EmitDefaultValue = false)] - public float? Latitude { get; set; } - - /// - /// Longitude of the space, in decimal degrees. - /// - [DataMember(Name = "longitude", IsRequired = false, EmitDefaultValue = false)] - public float? Longitude { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataStaffMembers_model")] - public class CreatePortalRequestCustomerDataStaffMembers - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataStaffMembers() { } - - public CreatePortalRequestCustomerDataStaffMembers( - List? buildingKeys = default, - List? commonAreaKeys = default, - string? emailAddress = default, - List? facilityKeys = default, - List? listingKeys = default, - string? name = default, - string? phoneNumber = default, - List? propertyKeys = default, - List? propertyListingKeys = default, - List? roomKeys = default, - List? siteKeys = default, - List? spaceKeys = default, - string? staffMemberKey = default, - List? unitKeys = default - ) - { - BuildingKeys = buildingKeys; - CommonAreaKeys = commonAreaKeys; - EmailAddress = emailAddress; - FacilityKeys = facilityKeys; - ListingKeys = listingKeys; - Name = name; - PhoneNumber = phoneNumber; - PropertyKeys = propertyKeys; - PropertyListingKeys = propertyListingKeys; - RoomKeys = roomKeys; - SiteKeys = siteKeys; - SpaceKeys = spaceKeys; - StaffMemberKey = staffMemberKey; - UnitKeys = unitKeys; - } - - /// - /// List of unique identifiers for the buildings the staff member is associated with. - /// - [DataMember(Name = "building_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BuildingKeys { get; set; } - - /// - /// List of unique identifiers for the common areas the staff member is associated with. - /// - [DataMember(Name = "common_area_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreaKeys { get; set; } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// List of unique identifiers for the facilities the staff member is associated with. - /// - [DataMember(Name = "facility_keys", IsRequired = false, EmitDefaultValue = false)] - public List? FacilityKeys { get; set; } - - /// - /// List of unique identifiers for the listings the staff member is associated with. - /// - [DataMember(Name = "listing_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ListingKeys { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// List of unique identifiers for the properties the staff member is associated with. - /// - [DataMember(Name = "property_keys", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyKeys { get; set; } - - /// - /// List of unique identifiers for the property listings the staff member is associated with. - /// - [DataMember( - Name = "property_listing_keys", - IsRequired = false, - EmitDefaultValue = false - )] - public List? PropertyListingKeys { get; set; } - - /// - /// List of unique identifiers for the rooms the staff member is associated with. - /// - [DataMember(Name = "room_keys", IsRequired = false, EmitDefaultValue = false)] - public List? RoomKeys { get; set; } - - /// - /// List of unique identifiers for the sites the staff member is associated with. - /// - [DataMember(Name = "site_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SiteKeys { get; set; } - - /// - /// List of unique identifiers for the spaces the staff member is associated with. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// Your unique identifier for the staff. - /// - [DataMember(Name = "staff_member_key", IsRequired = false, EmitDefaultValue = false)] - public string? StaffMemberKey { get; set; } - - /// - /// List of unique identifiers for the units the staff member is associated with. - /// - [DataMember(Name = "unit_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UnitKeys { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataTenants_model")] - public class CreatePortalRequestCustomerDataTenants - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataTenants() { } - - public CreatePortalRequestCustomerDataTenants( - string? emailAddress = default, - string? name = default, - string? phoneNumber = default, - string? tenantKey = default - ) - { - EmailAddress = emailAddress; - Name = name; - PhoneNumber = phoneNumber; - TenantKey = tenantKey; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Your unique identifier for the tenant. - /// - [DataMember(Name = "tenant_key", IsRequired = false, EmitDefaultValue = false)] - public string? TenantKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataUnits_model")] - public class CreatePortalRequestCustomerDataUnits - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataUnits() { } - - public CreatePortalRequestCustomerDataUnits( - string? name = default, - string? parentSiteKey = default, - string? unitKey = default - ) - { - Name = name; - ParentSiteKey = parentSiteKey; - UnitKey = unitKey; - } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "parent_site_key", IsRequired = false, EmitDefaultValue = false)] - public string? ParentSiteKey { get; set; } - - /// - /// Your unique identifier for the unit. - /// - [DataMember(Name = "unit_key", IsRequired = false, EmitDefaultValue = false)] - public string? UnitKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataUserIdentities_model")] - public class CreatePortalRequestCustomerDataUserIdentities - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataUserIdentities() { } - - public CreatePortalRequestCustomerDataUserIdentities( - string? emailAddress = default, - string? name = default, - string? phoneNumber = default, - string? userIdentityKey = default - ) - { - EmailAddress = emailAddress; - Name = name; - PhoneNumber = phoneNumber; - UserIdentityKey = userIdentityKey; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Your unique identifier for the user identity. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalRequestCustomerDataUsers_model")] - public class CreatePortalRequestCustomerDataUsers - { - [JsonConstructorAttribute] - protected CreatePortalRequestCustomerDataUsers() { } - - public CreatePortalRequestCustomerDataUsers( - string? emailAddress = default, - string? name = default, - string? phoneNumber = default, - string? userKey = default - ) - { - EmailAddress = emailAddress; - Name = name; - PhoneNumber = phoneNumber; - UserKey = userKey; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Your unique identifier for the user. - /// - [DataMember(Name = "user_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createPortalResponse_response")] - public class CreatePortalResponse - { - [JsonConstructorAttribute] - protected CreatePortalResponse() { } - - public CreatePortalResponse(CustomerPortal customerPortal = default) - { - CustomerPortal = customerPortal; - } - - /// - /// OK - /// - [DataMember(Name = "customer_portal", IsRequired = false, EmitDefaultValue = false)] - public CustomerPortal CustomerPortal { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new customer portal magic link with configurable features. - /// - public CustomerPortal CreatePortal(CreatePortalRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/customers/create_portal", requestOptions) - .EnsureData("/customers/create_portal") - .CustomerPortal; - } - - /// - /// Creates a new customer portal magic link with configurable features. - /// - public CustomerPortal CreatePortal( - List? customerResourcesFilters = default, - string? customizationProfileId = default, - CreatePortalRequestDeepLink? deepLink = default, - bool? excludeLocalePicker = default, - CreatePortalRequestFeatures? features = default, - bool? isEmbedded = default, - CreatePortalRequestLandingPage? landingPage = default, - CreatePortalRequest.LocaleEnum? locale = default, - CreatePortalRequest.NavigationModeEnum? navigationMode = default, - bool? readOnly = default, - CreatePortalRequestCustomerData? customerData = default - ) - { - return CreatePortal( - new CreatePortalRequest( - customerResourcesFilters: customerResourcesFilters, - customizationProfileId: customizationProfileId, - deepLink: deepLink, - excludeLocalePicker: excludeLocalePicker, - features: features, - isEmbedded: isEmbedded, - landingPage: landingPage, - locale: locale, - navigationMode: navigationMode, - readOnly: readOnly, - customerData: customerData - ) - ); - } - - /// - /// Creates a new customer portal magic link with configurable features. - /// - public async Task CreatePortalAsync(CreatePortalRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/customers/create_portal", - requestOptions - ) - ) - .EnsureData("/customers/create_portal") - .CustomerPortal; - } - - /// - /// Creates a new customer portal magic link with configurable features. - /// - public async Task CreatePortalAsync( - List? customerResourcesFilters = default, - string? customizationProfileId = default, - CreatePortalRequestDeepLink? deepLink = default, - bool? excludeLocalePicker = default, - CreatePortalRequestFeatures? features = default, - bool? isEmbedded = default, - CreatePortalRequestLandingPage? landingPage = default, - CreatePortalRequest.LocaleEnum? locale = default, - CreatePortalRequest.NavigationModeEnum? navigationMode = default, - bool? readOnly = default, - CreatePortalRequestCustomerData? customerData = default - ) - { - return ( - await CreatePortalAsync( - new CreatePortalRequest( - customerResourcesFilters: customerResourcesFilters, - customizationProfileId: customizationProfileId, - deepLink: deepLink, - excludeLocalePicker: excludeLocalePicker, - features: features, - isEmbedded: isEmbedded, - landingPage: landingPage, - locale: locale, - navigationMode: navigationMode, - readOnly: readOnly, - customerData: customerData - ) - ) - ); - } - - /// - /// Request parameters for Delete Customer Data. - /// - [DataContract(Name = "deleteDataRequest_request")] - public class DeleteDataRequest - { - [JsonConstructorAttribute] - protected DeleteDataRequest() { } - - public DeleteDataRequest( - List? accessGrantKeys = default, - List? bookingKeys = default, - List? buildingKeys = default, - List? commonAreaKeys = default, - List? customerKeys = default, - List? facilityKeys = default, - List? guestKeys = default, - List? listingKeys = default, - List? propertyKeys = default, - List? propertyListingKeys = default, - List? reservationKeys = default, - List? residentKeys = default, - List? roomKeys = default, - List? spaceKeys = default, - List? staffMemberKeys = default, - List? tenantKeys = default, - List? unitKeys = default, - List? userIdentityKeys = default, - List? userKeys = default - ) - { - AccessGrantKeys = accessGrantKeys; - BookingKeys = bookingKeys; - BuildingKeys = buildingKeys; - CommonAreaKeys = commonAreaKeys; - CustomerKeys = customerKeys; - FacilityKeys = facilityKeys; - GuestKeys = guestKeys; - ListingKeys = listingKeys; - PropertyKeys = propertyKeys; - PropertyListingKeys = propertyListingKeys; - ReservationKeys = reservationKeys; - ResidentKeys = residentKeys; - RoomKeys = roomKeys; - SpaceKeys = spaceKeys; - StaffMemberKeys = staffMemberKeys; - TenantKeys = tenantKeys; - UnitKeys = unitKeys; - UserIdentityKeys = userIdentityKeys; - UserKeys = userKeys; - } - - /// - /// List of access grant keys to delete. - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - /// - /// List of booking keys to delete. - /// - [DataMember(Name = "booking_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BookingKeys { get; set; } - - /// - /// List of building keys to delete. - /// - [DataMember(Name = "building_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BuildingKeys { get; set; } - - /// - /// List of common area keys to delete. - /// - [DataMember(Name = "common_area_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreaKeys { get; set; } - - /// - /// List of customer keys to delete all data for. - /// - [DataMember(Name = "customer_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CustomerKeys { get; set; } - - /// - /// List of facility keys to delete. - /// - [DataMember(Name = "facility_keys", IsRequired = false, EmitDefaultValue = false)] - public List? FacilityKeys { get; set; } - - /// - /// List of guest keys to delete. - /// - [DataMember(Name = "guest_keys", IsRequired = false, EmitDefaultValue = false)] - public List? GuestKeys { get; set; } - - /// - /// List of listing keys to delete. - /// - [DataMember(Name = "listing_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ListingKeys { get; set; } - - /// - /// List of property keys to delete. - /// - [DataMember(Name = "property_keys", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyKeys { get; set; } - - /// - /// List of property listing keys to delete. - /// - [DataMember( - Name = "property_listing_keys", - IsRequired = false, - EmitDefaultValue = false - )] - public List? PropertyListingKeys { get; set; } - - /// - /// List of reservation keys to delete. - /// - [DataMember(Name = "reservation_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ReservationKeys { get; set; } - - /// - /// List of resident keys to delete. - /// - [DataMember(Name = "resident_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ResidentKeys { get; set; } - - /// - /// List of room keys to delete. - /// - [DataMember(Name = "room_keys", IsRequired = false, EmitDefaultValue = false)] - public List? RoomKeys { get; set; } - - /// - /// List of space keys to delete. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// List of staff member keys to delete. - /// - [DataMember(Name = "staff_member_keys", IsRequired = false, EmitDefaultValue = false)] - public List? StaffMemberKeys { get; set; } - - /// - /// List of tenant keys to delete. - /// - [DataMember(Name = "tenant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? TenantKeys { get; set; } - - /// - /// List of unit keys to delete. - /// - [DataMember(Name = "unit_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UnitKeys { get; set; } - - /// - /// List of user identity keys to delete. - /// - [DataMember(Name = "user_identity_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UserIdentityKeys { get; set; } - - /// - /// List of user keys to delete. - /// - [DataMember(Name = "user_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UserKeys { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes customer data including resources like spaces, properties, rooms, users, etc. - /// This will delete the partner resources and any related Seam resources (user identities, access grants, spaces). - /// - public void DeleteData(DeleteDataRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/customers/delete_data", requestOptions); - } - - /// - /// Deletes customer data including resources like spaces, properties, rooms, users, etc. - /// This will delete the partner resources and any related Seam resources (user identities, access grants, spaces). - /// - public void DeleteData( - List? accessGrantKeys = default, - List? bookingKeys = default, - List? buildingKeys = default, - List? commonAreaKeys = default, - List? customerKeys = default, - List? facilityKeys = default, - List? guestKeys = default, - List? listingKeys = default, - List? propertyKeys = default, - List? propertyListingKeys = default, - List? reservationKeys = default, - List? residentKeys = default, - List? roomKeys = default, - List? spaceKeys = default, - List? staffMemberKeys = default, - List? tenantKeys = default, - List? unitKeys = default, - List? userIdentityKeys = default, - List? userKeys = default - ) - { - DeleteData( - new DeleteDataRequest( - accessGrantKeys: accessGrantKeys, - bookingKeys: bookingKeys, - buildingKeys: buildingKeys, - commonAreaKeys: commonAreaKeys, - customerKeys: customerKeys, - facilityKeys: facilityKeys, - guestKeys: guestKeys, - listingKeys: listingKeys, - propertyKeys: propertyKeys, - propertyListingKeys: propertyListingKeys, - reservationKeys: reservationKeys, - residentKeys: residentKeys, - roomKeys: roomKeys, - spaceKeys: spaceKeys, - staffMemberKeys: staffMemberKeys, - tenantKeys: tenantKeys, - unitKeys: unitKeys, - userIdentityKeys: userIdentityKeys, - userKeys: userKeys - ) - ); - } - - /// - /// Deletes customer data including resources like spaces, properties, rooms, users, etc. - /// This will delete the partner resources and any related Seam resources (user identities, access grants, spaces). - /// - public async Task DeleteDataAsync(DeleteDataRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/customers/delete_data", requestOptions); - } - - /// - /// Deletes customer data including resources like spaces, properties, rooms, users, etc. - /// This will delete the partner resources and any related Seam resources (user identities, access grants, spaces). - /// - public async Task DeleteDataAsync( - List? accessGrantKeys = default, - List? bookingKeys = default, - List? buildingKeys = default, - List? commonAreaKeys = default, - List? customerKeys = default, - List? facilityKeys = default, - List? guestKeys = default, - List? listingKeys = default, - List? propertyKeys = default, - List? propertyListingKeys = default, - List? reservationKeys = default, - List? residentKeys = default, - List? roomKeys = default, - List? spaceKeys = default, - List? staffMemberKeys = default, - List? tenantKeys = default, - List? unitKeys = default, - List? userIdentityKeys = default, - List? userKeys = default - ) - { - await DeleteDataAsync( - new DeleteDataRequest( - accessGrantKeys: accessGrantKeys, - bookingKeys: bookingKeys, - buildingKeys: buildingKeys, - commonAreaKeys: commonAreaKeys, - customerKeys: customerKeys, - facilityKeys: facilityKeys, - guestKeys: guestKeys, - listingKeys: listingKeys, - propertyKeys: propertyKeys, - propertyListingKeys: propertyListingKeys, - reservationKeys: reservationKeys, - residentKeys: residentKeys, - roomKeys: roomKeys, - spaceKeys: spaceKeys, - staffMemberKeys: staffMemberKeys, - tenantKeys: tenantKeys, - unitKeys: unitKeys, - userIdentityKeys: userIdentityKeys, - userKeys: userKeys - ) - ); - } - - /// - /// Request parameters for Push Customer Data. - /// - [DataContract(Name = "pushDataRequest_request")] - public class PushDataRequest - { - [JsonConstructorAttribute] - protected PushDataRequest() { } - - public PushDataRequest( - List? accessGrants = default, - List? bookings = default, - List? buildings = default, - List? commonAreas = default, - string customerKey = default, - List? facilities = default, - List? guests = default, - List? listings = default, - List? properties = default, - List? propertyListings = default, - List? reservations = default, - List? residents = default, - List? rooms = default, - List? sites = default, - List? spaces = default, - List? staffMembers = default, - List? tenants = default, - List? units = default, - List? userIdentities = default, - List? users = default - ) - { - AccessGrants = accessGrants; - Bookings = bookings; - Buildings = buildings; - CommonAreas = commonAreas; - CustomerKey = customerKey; - Facilities = facilities; - Guests = guests; - Listings = listings; - Properties = properties; - PropertyListings = propertyListings; - Reservations = reservations; - Residents = residents; - Rooms = rooms; - Sites = sites; - Spaces = spaces; - StaffMembers = staffMembers; - Tenants = tenants; - Units = units; - UserIdentities = userIdentities; - Users = users; - } - - /// - /// List of access grants. - /// - [DataMember(Name = "access_grants", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrants { get; set; } - - /// - /// List of bookings. - /// - [DataMember(Name = "bookings", IsRequired = false, EmitDefaultValue = false)] - public List? Bookings { get; set; } - - /// - /// List of buildings. - /// - [DataMember(Name = "buildings", IsRequired = false, EmitDefaultValue = false)] - public List? Buildings { get; set; } - - /// - /// List of shared common areas. - /// - [DataMember(Name = "common_areas", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreas { get; set; } - - /// - /// Your unique identifier for the customer. - /// - [DataMember(Name = "customer_key", IsRequired = true, EmitDefaultValue = false)] - public string CustomerKey { get; set; } - - /// - /// List of gym or fitness facilities. - /// - [DataMember(Name = "facilities", IsRequired = false, EmitDefaultValue = false)] - public List? Facilities { get; set; } - - /// - /// List of guests. - /// - [DataMember(Name = "guests", IsRequired = false, EmitDefaultValue = false)] - public List? Guests { get; set; } - - /// - /// List of property listings. - /// - [DataMember(Name = "listings", IsRequired = false, EmitDefaultValue = false)] - public List? Listings { get; set; } - - /// - /// List of short-term rental properties. - /// - [DataMember(Name = "properties", IsRequired = false, EmitDefaultValue = false)] - public List? Properties { get; set; } - - /// - /// List of property listings. - /// - [DataMember(Name = "property_listings", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyListings { get; set; } - - /// - /// List of reservations. - /// - [DataMember(Name = "reservations", IsRequired = false, EmitDefaultValue = false)] - public List? Reservations { get; set; } - - /// - /// List of residents. - /// - [DataMember(Name = "residents", IsRequired = false, EmitDefaultValue = false)] - public List? Residents { get; set; } - - /// - /// List of hotel or hospitality rooms. - /// - [DataMember(Name = "rooms", IsRequired = false, EmitDefaultValue = false)] - public List? Rooms { get; set; } - - /// - /// List of general sites or areas. - /// - [DataMember(Name = "sites", IsRequired = false, EmitDefaultValue = false)] - public List? Sites { get; set; } - - /// - /// List of general spaces or areas. - /// - [DataMember(Name = "spaces", IsRequired = false, EmitDefaultValue = false)] - public List? Spaces { get; set; } - - /// - /// List of staff members. - /// - [DataMember(Name = "staff_members", IsRequired = false, EmitDefaultValue = false)] - public List? StaffMembers { get; set; } - - /// - /// List of tenants. - /// - [DataMember(Name = "tenants", IsRequired = false, EmitDefaultValue = false)] - public List? Tenants { get; set; } - - /// - /// List of multi-family residential units. - /// - [DataMember(Name = "units", IsRequired = false, EmitDefaultValue = false)] - public List? Units { get; set; } - - /// - /// List of user identities. - /// - [DataMember(Name = "user_identities", IsRequired = false, EmitDefaultValue = false)] - public List? UserIdentities { get; set; } - - /// - /// List of users. - /// - [DataMember(Name = "users", IsRequired = false, EmitDefaultValue = false)] - public List? Users { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestAccessGrants_model")] - public class PushDataRequestAccessGrants - { - [JsonConstructorAttribute] - protected PushDataRequestAccessGrants() { } - - public PushDataRequestAccessGrants( - string? accessGrantKey = default, - List? buildingKeys = default, - List? commonAreaKeys = default, - string? endsAt = default, - List? facilityKeys = default, - string? guestKey = default, - List? listingKeys = default, - string? name = default, - string? preferredCode = default, - List? propertyKeys = default, - string? residentKey = default, - List? roomKeys = default, - List? spaceKeys = default, - string? startsAt = default, - string? tenantKey = default, - List? unitKeys = default, - string? userIdentityKey = default, - string? userKey = default - ) - { - AccessGrantKey = accessGrantKey; - BuildingKeys = buildingKeys; - CommonAreaKeys = commonAreaKeys; - EndsAt = endsAt; - FacilityKeys = facilityKeys; - GuestKey = guestKey; - ListingKeys = listingKeys; - Name = name; - PreferredCode = preferredCode; - PropertyKeys = propertyKeys; - ResidentKey = residentKey; - RoomKeys = roomKeys; - SpaceKeys = spaceKeys; - StartsAt = startsAt; - TenantKey = tenantKey; - UnitKeys = unitKeys; - UserIdentityKey = userIdentityKey; - UserKey = userKey; - } - - /// - /// Your unique identifier for the access grant. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// Building keys associated with the access grant. - /// - [DataMember(Name = "building_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BuildingKeys { get; set; } - - /// - /// Common area keys associated with the access grant. - /// - [DataMember(Name = "common_area_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreaKeys { get; set; } - - /// - /// Ending date and time for the access grant. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Facility keys associated with the access grant. - /// - [DataMember(Name = "facility_keys", IsRequired = false, EmitDefaultValue = false)] - public List? FacilityKeys { get; set; } - - /// - /// Guest key associated with the access grant. - /// - [DataMember(Name = "guest_key", IsRequired = false, EmitDefaultValue = false)] - public string? GuestKey { get; set; } - - /// - /// Listing keys associated with the access grant. - /// - [DataMember(Name = "listing_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ListingKeys { get; set; } - - /// - /// Your name for this access grant resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Preferred PIN code to use when creating access for this reservation. - /// - [DataMember(Name = "preferred_code", IsRequired = false, EmitDefaultValue = false)] - public string? PreferredCode { get; set; } - - /// - /// Property keys associated with the access grant. - /// - [DataMember(Name = "property_keys", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyKeys { get; set; } - - /// - /// Resident key associated with the access grant. - /// - [DataMember(Name = "resident_key", IsRequired = false, EmitDefaultValue = false)] - public string? ResidentKey { get; set; } - - /// - /// Room keys associated with the access grant. - /// - [DataMember(Name = "room_keys", IsRequired = false, EmitDefaultValue = false)] - public List? RoomKeys { get; set; } - - /// - /// Space keys associated with the access grant. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// Starting date and time for the access grant. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Tenant key associated with the access grant. - /// - [DataMember(Name = "tenant_key", IsRequired = false, EmitDefaultValue = false)] - public string? TenantKey { get; set; } - - /// - /// Unit keys associated with the access grant. - /// - [DataMember(Name = "unit_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UnitKeys { get; set; } - - /// - /// User identity key associated with the access grant. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - /// - /// User key associated with the access grant. - /// - [DataMember(Name = "user_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestBookings_model")] - public class PushDataRequestBookings - { - [JsonConstructorAttribute] - protected PushDataRequestBookings() { } - - public PushDataRequestBookings( - string? bookingKey = default, - List? buildingKeys = default, - List? commonAreaKeys = default, - string? endsAt = default, - List? facilityKeys = default, - string? guestKey = default, - List? listingKeys = default, - string? name = default, - string? preferredCode = default, - List? propertyKeys = default, - string? residentKey = default, - List? roomKeys = default, - List? spaceKeys = default, - string? startsAt = default, - string? tenantKey = default, - List? unitKeys = default, - string? userIdentityKey = default, - string? userKey = default - ) - { - BookingKey = bookingKey; - BuildingKeys = buildingKeys; - CommonAreaKeys = commonAreaKeys; - EndsAt = endsAt; - FacilityKeys = facilityKeys; - GuestKey = guestKey; - ListingKeys = listingKeys; - Name = name; - PreferredCode = preferredCode; - PropertyKeys = propertyKeys; - ResidentKey = residentKey; - RoomKeys = roomKeys; - SpaceKeys = spaceKeys; - StartsAt = startsAt; - TenantKey = tenantKey; - UnitKeys = unitKeys; - UserIdentityKey = userIdentityKey; - UserKey = userKey; - } - - /// - /// Your unique identifier for the booking. - /// - [DataMember(Name = "booking_key", IsRequired = false, EmitDefaultValue = false)] - public string? BookingKey { get; set; } - - /// - /// Building keys associated with the access grant. - /// - [DataMember(Name = "building_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BuildingKeys { get; set; } - - /// - /// Common area keys associated with the access grant. - /// - [DataMember(Name = "common_area_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreaKeys { get; set; } - - /// - /// Ending date and time for the access grant. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Facility keys associated with the access grant. - /// - [DataMember(Name = "facility_keys", IsRequired = false, EmitDefaultValue = false)] - public List? FacilityKeys { get; set; } - - /// - /// Guest key associated with the access grant. - /// - [DataMember(Name = "guest_key", IsRequired = false, EmitDefaultValue = false)] - public string? GuestKey { get; set; } - - /// - /// Listing keys associated with the access grant. - /// - [DataMember(Name = "listing_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ListingKeys { get; set; } - - /// - /// Your name for this access grant resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Preferred PIN code to use when creating access for this reservation. - /// - [DataMember(Name = "preferred_code", IsRequired = false, EmitDefaultValue = false)] - public string? PreferredCode { get; set; } - - /// - /// Property keys associated with the access grant. - /// - [DataMember(Name = "property_keys", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyKeys { get; set; } - - /// - /// Resident key associated with the access grant. - /// - [DataMember(Name = "resident_key", IsRequired = false, EmitDefaultValue = false)] - public string? ResidentKey { get; set; } - - /// - /// Room keys associated with the access grant. - /// - [DataMember(Name = "room_keys", IsRequired = false, EmitDefaultValue = false)] - public List? RoomKeys { get; set; } - - /// - /// Space keys associated with the access grant. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// Starting date and time for the access grant. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Tenant key associated with the access grant. - /// - [DataMember(Name = "tenant_key", IsRequired = false, EmitDefaultValue = false)] - public string? TenantKey { get; set; } - - /// - /// Unit keys associated with the access grant. - /// - [DataMember(Name = "unit_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UnitKeys { get; set; } - - /// - /// User identity key associated with the access grant. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - /// - /// User key associated with the access grant. - /// - [DataMember(Name = "user_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestBuildings_model")] - public class PushDataRequestBuildings - { - [JsonConstructorAttribute] - protected PushDataRequestBuildings() { } - - public PushDataRequestBuildings(string? buildingKey = default, string? name = default) - { - BuildingKey = buildingKey; - Name = name; - } - - /// - /// Your unique identifier for the building. - /// - [DataMember(Name = "building_key", IsRequired = false, EmitDefaultValue = false)] - public string? BuildingKey { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestCommonAreas_model")] - public class PushDataRequestCommonAreas - { - [JsonConstructorAttribute] - protected PushDataRequestCommonAreas() { } - - public PushDataRequestCommonAreas( - string? commonAreaKey = default, - string? name = default, - string? parentSiteKey = default - ) - { - CommonAreaKey = commonAreaKey; - Name = name; - ParentSiteKey = parentSiteKey; - } - - /// - /// Your unique identifier for the common area. - /// - [DataMember(Name = "common_area_key", IsRequired = false, EmitDefaultValue = false)] - public string? CommonAreaKey { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "parent_site_key", IsRequired = false, EmitDefaultValue = false)] - public string? ParentSiteKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestFacilities_model")] - public class PushDataRequestFacilities - { - [JsonConstructorAttribute] - protected PushDataRequestFacilities() { } - - public PushDataRequestFacilities(string? facilityKey = default, string? name = default) - { - FacilityKey = facilityKey; - Name = name; - } - - /// - /// Your unique identifier for the facility. - /// - [DataMember(Name = "facility_key", IsRequired = false, EmitDefaultValue = false)] - public string? FacilityKey { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestGuests_model")] - public class PushDataRequestGuests - { - [JsonConstructorAttribute] - protected PushDataRequestGuests() { } - - public PushDataRequestGuests( - string? emailAddress = default, - string? guestKey = default, - string? name = default, - string? phoneNumber = default - ) - { - EmailAddress = emailAddress; - GuestKey = guestKey; - Name = name; - PhoneNumber = phoneNumber; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your unique identifier for the guest. - /// - [DataMember(Name = "guest_key", IsRequired = false, EmitDefaultValue = false)] - public string? GuestKey { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestListings_model")] - public class PushDataRequestListings - { - [JsonConstructorAttribute] - protected PushDataRequestListings() { } - - public PushDataRequestListings(string? listingKey = default, string? name = default) - { - ListingKey = listingKey; - Name = name; - } - - /// - /// Your unique identifier for the listing. - /// - [DataMember(Name = "listing_key", IsRequired = false, EmitDefaultValue = false)] - public string? ListingKey { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestProperties_model")] - public class PushDataRequestProperties - { - [JsonConstructorAttribute] - protected PushDataRequestProperties() { } - - public PushDataRequestProperties(string? name = default, string? propertyKey = default) - { - Name = name; - PropertyKey = propertyKey; - } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the property. - /// - [DataMember(Name = "property_key", IsRequired = false, EmitDefaultValue = false)] - public string? PropertyKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestPropertyListings_model")] - public class PushDataRequestPropertyListings - { - [JsonConstructorAttribute] - protected PushDataRequestPropertyListings() { } - - public PushDataRequestPropertyListings( - object? customMetadata = default, - string? name = default, - string? propertyListingKey = default - ) - { - CustomMetadata = customMetadata; - Name = name; - PropertyListingKey = propertyListingKey; - } - - /// - /// Set key:value pairs. Accepts string or Boolean values. Adding custom metadata to a property listing enables you to store custom information, like customer details or internal IDs from your application. Set a key to `null` or to an empty string to remove that key from the custom metadata. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadata { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the property listing. - /// - [DataMember( - Name = "property_listing_key", - IsRequired = false, - EmitDefaultValue = false - )] - public string? PropertyListingKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestReservations_model")] - public class PushDataRequestReservations - { - [JsonConstructorAttribute] - protected PushDataRequestReservations() { } - - public PushDataRequestReservations( - List? buildingKeys = default, - List? commonAreaKeys = default, - object? customMetadata = default, - string? endsAt = default, - List? facilityKeys = default, - string? guestKey = default, - List? listingKeys = default, - string? name = default, - string? preferredCode = default, - List? propertyKeys = default, - string? reservationKey = default, - string? residentKey = default, - List? roomKeys = default, - List? spaceKeys = default, - string? startsAt = default, - string? tenantKey = default, - List? unitKeys = default, - string? userIdentityKey = default, - string? userKey = default - ) - { - BuildingKeys = buildingKeys; - CommonAreaKeys = commonAreaKeys; - CustomMetadata = customMetadata; - EndsAt = endsAt; - FacilityKeys = facilityKeys; - GuestKey = guestKey; - ListingKeys = listingKeys; - Name = name; - PreferredCode = preferredCode; - PropertyKeys = propertyKeys; - ReservationKey = reservationKey; - ResidentKey = residentKey; - RoomKeys = roomKeys; - SpaceKeys = spaceKeys; - StartsAt = startsAt; - TenantKey = tenantKey; - UnitKeys = unitKeys; - UserIdentityKey = userIdentityKey; - UserKey = userKey; - } - - /// - /// Building keys associated with the access grant. - /// - [DataMember(Name = "building_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BuildingKeys { get; set; } - - /// - /// Common area keys associated with the access grant. - /// - [DataMember(Name = "common_area_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreaKeys { get; set; } - - /// - /// Set key:value pairs for filtering reservations by custom criteria. Set a key to `null` or to an empty string to remove that key from the custom metadata. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadata { get; set; } - - /// - /// Ending date and time for the access grant. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Facility keys associated with the access grant. - /// - [DataMember(Name = "facility_keys", IsRequired = false, EmitDefaultValue = false)] - public List? FacilityKeys { get; set; } - - /// - /// Guest key associated with the access grant. - /// - [DataMember(Name = "guest_key", IsRequired = false, EmitDefaultValue = false)] - public string? GuestKey { get; set; } - - /// - /// Listing keys associated with the access grant. - /// - [DataMember(Name = "listing_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ListingKeys { get; set; } - - /// - /// Your name for this access grant resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Preferred PIN code to use when creating access for this reservation. - /// - [DataMember(Name = "preferred_code", IsRequired = false, EmitDefaultValue = false)] - public string? PreferredCode { get; set; } - - /// - /// Property keys associated with the access grant. - /// - [DataMember(Name = "property_keys", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyKeys { get; set; } - - /// - /// Your unique identifier for the reservation. - /// - [DataMember(Name = "reservation_key", IsRequired = false, EmitDefaultValue = false)] - public string? ReservationKey { get; set; } - - /// - /// Resident key associated with the access grant. - /// - [DataMember(Name = "resident_key", IsRequired = false, EmitDefaultValue = false)] - public string? ResidentKey { get; set; } - - /// - /// Room keys associated with the access grant. - /// - [DataMember(Name = "room_keys", IsRequired = false, EmitDefaultValue = false)] - public List? RoomKeys { get; set; } - - /// - /// Space keys associated with the access grant. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// Starting date and time for the access grant. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Tenant key associated with the access grant. - /// - [DataMember(Name = "tenant_key", IsRequired = false, EmitDefaultValue = false)] - public string? TenantKey { get; set; } - - /// - /// Unit keys associated with the access grant. - /// - [DataMember(Name = "unit_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UnitKeys { get; set; } - - /// - /// User identity key associated with the access grant. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - /// - /// User key associated with the access grant. - /// - [DataMember(Name = "user_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestResidents_model")] - public class PushDataRequestResidents - { - [JsonConstructorAttribute] - protected PushDataRequestResidents() { } - - public PushDataRequestResidents( - string? emailAddress = default, - string? name = default, - string? phoneNumber = default, - string? residentKey = default - ) - { - EmailAddress = emailAddress; - Name = name; - PhoneNumber = phoneNumber; - ResidentKey = residentKey; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Your unique identifier for the resident. - /// - [DataMember(Name = "resident_key", IsRequired = false, EmitDefaultValue = false)] - public string? ResidentKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestRooms_model")] - public class PushDataRequestRooms - { - [JsonConstructorAttribute] - protected PushDataRequestRooms() { } - - public PushDataRequestRooms( - string? name = default, - string? parentSiteKey = default, - string? roomKey = default - ) - { - Name = name; - ParentSiteKey = parentSiteKey; - RoomKey = roomKey; - } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "parent_site_key", IsRequired = false, EmitDefaultValue = false)] - public string? ParentSiteKey { get; set; } - - /// - /// Your unique identifier for the room. - /// - [DataMember(Name = "room_key", IsRequired = false, EmitDefaultValue = false)] - public string? RoomKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestSites_model")] - public class PushDataRequestSites - { - [JsonConstructorAttribute] - protected PushDataRequestSites() { } - - public PushDataRequestSites(string? name = default, string? siteKey = default) - { - Name = name; - SiteKey = siteKey; - } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "site_key", IsRequired = false, EmitDefaultValue = false)] - public string? SiteKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestSpaces_model")] - public class PushDataRequestSpaces - { - [JsonConstructorAttribute] - protected PushDataRequestSpaces() { } - - public PushDataRequestSpaces( - PushDataRequestSpacesCustomerData? customerData = default, - int? durationMinutes = default, - PushDataRequestSpacesGeolocation? geolocation = default, - string? name = default, - string? parentSiteKey = default, - string? spaceKey = default - ) - { - CustomerData = customerData; - DurationMinutes = durationMinutes; - Geolocation = geolocation; - Name = name; - ParentSiteKey = parentSiteKey; - SpaceKey = spaceKey; - } - - /// - /// Reservation/stay-related defaults for the space (time zone, default check-in/out times, address). - /// - [DataMember(Name = "customer_data", IsRequired = false, EmitDefaultValue = false)] - public PushDataRequestSpacesCustomerData? CustomerData { get; set; } - - /// - /// Default duration of this space in minutes, when the space represents a fixed-length bookable slot (e.g. an appointment type). Used to interpret reservations booked against this space. - /// - [DataMember(Name = "duration_minutes", IsRequired = false, EmitDefaultValue = false)] - public int? DurationMinutes { get; set; } - - /// - /// Geographic coordinates (latitude and longitude) of the space. - /// - [DataMember(Name = "geolocation", IsRequired = false, EmitDefaultValue = false)] - public PushDataRequestSpacesGeolocation? Geolocation { get; set; } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "parent_site_key", IsRequired = false, EmitDefaultValue = false)] - public string? ParentSiteKey { get; set; } - - /// - /// Your unique identifier for the space. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestSpacesCustomerData_model")] - public class PushDataRequestSpacesCustomerData - { - [JsonConstructorAttribute] - protected PushDataRequestSpacesCustomerData() { } - - public PushDataRequestSpacesCustomerData( - string? address = default, - string? defaultCheckinTime = default, - string? defaultCheckoutTime = default, - string? timeZone = default - ) - { - Address = address; - DefaultCheckinTime = defaultCheckinTime; - DefaultCheckoutTime = defaultCheckoutTime; - TimeZone = timeZone; - } - - /// - /// Postal address for the space. - /// - [DataMember(Name = "address", IsRequired = false, EmitDefaultValue = false)] - public string? Address { get; set; } - - /// - /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember( - Name = "default_checkin_time", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DefaultCheckinTime { get; set; } - - /// - /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember( - Name = "default_checkout_time", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DefaultCheckoutTime { get; set; } - - /// - /// IANA time zone for the space, e.g. America/Los_Angeles. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestSpacesGeolocation_model")] - public class PushDataRequestSpacesGeolocation - { - [JsonConstructorAttribute] - protected PushDataRequestSpacesGeolocation() { } - - public PushDataRequestSpacesGeolocation( - float? latitude = default, - float? longitude = default - ) - { - Latitude = latitude; - Longitude = longitude; - } - - /// - /// Latitude of the space, in decimal degrees. - /// - [DataMember(Name = "latitude", IsRequired = false, EmitDefaultValue = false)] - public float? Latitude { get; set; } - - /// - /// Longitude of the space, in decimal degrees. - /// - [DataMember(Name = "longitude", IsRequired = false, EmitDefaultValue = false)] - public float? Longitude { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestStaffMembers_model")] - public class PushDataRequestStaffMembers - { - [JsonConstructorAttribute] - protected PushDataRequestStaffMembers() { } - - public PushDataRequestStaffMembers( - List? buildingKeys = default, - List? commonAreaKeys = default, - string? emailAddress = default, - List? facilityKeys = default, - List? listingKeys = default, - string? name = default, - string? phoneNumber = default, - List? propertyKeys = default, - List? propertyListingKeys = default, - List? roomKeys = default, - List? siteKeys = default, - List? spaceKeys = default, - string? staffMemberKey = default, - List? unitKeys = default - ) - { - BuildingKeys = buildingKeys; - CommonAreaKeys = commonAreaKeys; - EmailAddress = emailAddress; - FacilityKeys = facilityKeys; - ListingKeys = listingKeys; - Name = name; - PhoneNumber = phoneNumber; - PropertyKeys = propertyKeys; - PropertyListingKeys = propertyListingKeys; - RoomKeys = roomKeys; - SiteKeys = siteKeys; - SpaceKeys = spaceKeys; - StaffMemberKey = staffMemberKey; - UnitKeys = unitKeys; - } - - /// - /// List of unique identifiers for the buildings the staff member is associated with. - /// - [DataMember(Name = "building_keys", IsRequired = false, EmitDefaultValue = false)] - public List? BuildingKeys { get; set; } - - /// - /// List of unique identifiers for the common areas the staff member is associated with. - /// - [DataMember(Name = "common_area_keys", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAreaKeys { get; set; } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// List of unique identifiers for the facilities the staff member is associated with. - /// - [DataMember(Name = "facility_keys", IsRequired = false, EmitDefaultValue = false)] - public List? FacilityKeys { get; set; } - - /// - /// List of unique identifiers for the listings the staff member is associated with. - /// - [DataMember(Name = "listing_keys", IsRequired = false, EmitDefaultValue = false)] - public List? ListingKeys { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// List of unique identifiers for the properties the staff member is associated with. - /// - [DataMember(Name = "property_keys", IsRequired = false, EmitDefaultValue = false)] - public List? PropertyKeys { get; set; } - - /// - /// List of unique identifiers for the property listings the staff member is associated with. - /// - [DataMember( - Name = "property_listing_keys", - IsRequired = false, - EmitDefaultValue = false - )] - public List? PropertyListingKeys { get; set; } - - /// - /// List of unique identifiers for the rooms the staff member is associated with. - /// - [DataMember(Name = "room_keys", IsRequired = false, EmitDefaultValue = false)] - public List? RoomKeys { get; set; } - - /// - /// List of unique identifiers for the sites the staff member is associated with. - /// - [DataMember(Name = "site_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SiteKeys { get; set; } - - /// - /// List of unique identifiers for the spaces the staff member is associated with. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - /// - /// Your unique identifier for the staff. - /// - [DataMember(Name = "staff_member_key", IsRequired = false, EmitDefaultValue = false)] - public string? StaffMemberKey { get; set; } - - /// - /// List of unique identifiers for the units the staff member is associated with. - /// - [DataMember(Name = "unit_keys", IsRequired = false, EmitDefaultValue = false)] - public List? UnitKeys { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestTenants_model")] - public class PushDataRequestTenants - { - [JsonConstructorAttribute] - protected PushDataRequestTenants() { } - - public PushDataRequestTenants( - string? emailAddress = default, - string? name = default, - string? phoneNumber = default, - string? tenantKey = default - ) - { - EmailAddress = emailAddress; - Name = name; - PhoneNumber = phoneNumber; - TenantKey = tenantKey; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Your unique identifier for the tenant. - /// - [DataMember(Name = "tenant_key", IsRequired = false, EmitDefaultValue = false)] - public string? TenantKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestUnits_model")] - public class PushDataRequestUnits - { - [JsonConstructorAttribute] - protected PushDataRequestUnits() { } - - public PushDataRequestUnits( - string? name = default, - string? parentSiteKey = default, - string? unitKey = default - ) - { - Name = name; - ParentSiteKey = parentSiteKey; - UnitKey = unitKey; - } - - /// - /// Your display name for this location resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Your unique identifier for the site. - /// - [DataMember(Name = "parent_site_key", IsRequired = false, EmitDefaultValue = false)] - public string? ParentSiteKey { get; set; } - - /// - /// Your unique identifier for the unit. - /// - [DataMember(Name = "unit_key", IsRequired = false, EmitDefaultValue = false)] - public string? UnitKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestUserIdentities_model")] - public class PushDataRequestUserIdentities - { - [JsonConstructorAttribute] - protected PushDataRequestUserIdentities() { } - - public PushDataRequestUserIdentities( - string? emailAddress = default, - string? name = default, - string? phoneNumber = default, - string? userIdentityKey = default - ) - { - EmailAddress = emailAddress; - Name = name; - PhoneNumber = phoneNumber; - UserIdentityKey = userIdentityKey; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Your unique identifier for the user identity. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "pushDataRequestUsers_model")] - public class PushDataRequestUsers - { - [JsonConstructorAttribute] - protected PushDataRequestUsers() { } - - public PushDataRequestUsers( - string? emailAddress = default, - string? name = default, - string? phoneNumber = default, - string? userKey = default - ) - { - EmailAddress = emailAddress; - Name = name; - PhoneNumber = phoneNumber; - UserKey = userKey; - } - - /// - /// Email address associated with the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Your display name for this user identity resource. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Phone number associated with the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Your unique identifier for the user. - /// - [DataMember(Name = "user_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Pushes customer data including resources like spaces, properties, rooms, users, etc. - /// - public void PushData(PushDataRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/customers/push_data", requestOptions); - } - - /// - /// Pushes customer data including resources like spaces, properties, rooms, users, etc. - /// - public void PushData( - List? accessGrants = default, - List? bookings = default, - List? buildings = default, - List? commonAreas = default, - string customerKey = default, - List? facilities = default, - List? guests = default, - List? listings = default, - List? properties = default, - List? propertyListings = default, - List? reservations = default, - List? residents = default, - List? rooms = default, - List? sites = default, - List? spaces = default, - List? staffMembers = default, - List? tenants = default, - List? units = default, - List? userIdentities = default, - List? users = default - ) - { - PushData( - new PushDataRequest( - accessGrants: accessGrants, - bookings: bookings, - buildings: buildings, - commonAreas: commonAreas, - customerKey: customerKey, - facilities: facilities, - guests: guests, - listings: listings, - properties: properties, - propertyListings: propertyListings, - reservations: reservations, - residents: residents, - rooms: rooms, - sites: sites, - spaces: spaces, - staffMembers: staffMembers, - tenants: tenants, - units: units, - userIdentities: userIdentities, - users: users - ) - ); - } - - /// - /// Pushes customer data including resources like spaces, properties, rooms, users, etc. - /// - public async Task PushDataAsync(PushDataRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/customers/push_data", requestOptions); - } - - /// - /// Pushes customer data including resources like spaces, properties, rooms, users, etc. - /// - public async Task PushDataAsync( - List? accessGrants = default, - List? bookings = default, - List? buildings = default, - List? commonAreas = default, - string customerKey = default, - List? facilities = default, - List? guests = default, - List? listings = default, - List? properties = default, - List? propertyListings = default, - List? reservations = default, - List? residents = default, - List? rooms = default, - List? sites = default, - List? spaces = default, - List? staffMembers = default, - List? tenants = default, - List? units = default, - List? userIdentities = default, - List? users = default - ) - { - await PushDataAsync( - new PushDataRequest( - accessGrants: accessGrants, - bookings: bookings, - buildings: buildings, - commonAreas: commonAreas, - customerKey: customerKey, - facilities: facilities, - guests: guests, - listings: listings, - properties: properties, - propertyListings: propertyListings, - reservations: reservations, - residents: residents, - rooms: rooms, - sites: sites, - spaces: spaces, - staffMembers: staffMembers, - tenants: tenants, - units: units, - userIdentities: userIdentities, - users: users - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.Customers Customers => new(this); - } - - public partial interface ISeamClient - { - public Api.Customers Customers { get; } - } -} diff --git a/src/Seam/Api/DailyProgramsThermostats.cs b/src/Seam/Api/DailyProgramsThermostats.cs deleted file mode 100644 index a1752068..00000000 --- a/src/Seam/Api/DailyProgramsThermostats.cs +++ /dev/null @@ -1,534 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class DailyProgramsThermostats - { - private ISeamClient _seam; - - public DailyProgramsThermostats(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create a Thermostat Daily Program. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - string deviceId = default, - string name = default, - List periods = default - ) - { - DeviceId = deviceId; - Name = name; - Periods = periods; - } - - /// - /// ID of the thermostat device for which you want to create a daily program. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Name of the thermostat daily program. - /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Array of thermostat daily program periods. - /// - [DataMember(Name = "periods", IsRequired = true, EmitDefaultValue = false)] - public List Periods { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestPeriods_model")] - public class CreateRequestPeriods - { - [JsonConstructorAttribute] - protected CreateRequestPeriods() { } - - public CreateRequestPeriods( - string? climatePresetKey = default, - string? startsAtTime = default - ) - { - ClimatePresetKey = climatePresetKey; - StartsAtTime = startsAtTime; - } - - /// - /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to activate at the `starts_at_time`. - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string? ClimatePresetKey { get; set; } - - /// - /// Time at which the thermostat daily program period starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at_time", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAtTime { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(ThermostatDailyProgram thermostatDailyProgram = default) - { - ThermostatDailyProgram = thermostatDailyProgram; - } - - /// - /// OK - /// - [DataMember( - Name = "thermostat_daily_program", - IsRequired = false, - EmitDefaultValue = false - )] - public ThermostatDailyProgram ThermostatDailyProgram { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new thermostat daily program. A daily program consists of a set of periods, where each period includes a start time and the key of a configured climate preset. Once you have defined a daily program, you can assign it to one or more days within a weekly program. - /// - public ThermostatDailyProgram Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/thermostats/daily_programs/create", requestOptions) - .EnsureData("/thermostats/daily_programs/create") - .ThermostatDailyProgram; - } - - /// - /// Creates a new thermostat daily program. A daily program consists of a set of periods, where each period includes a start time and the key of a configured climate preset. Once you have defined a daily program, you can assign it to one or more days within a weekly program. - /// - public ThermostatDailyProgram Create( - string deviceId = default, - string name = default, - List periods = default - ) - { - return Create(new CreateRequest(deviceId: deviceId, name: name, periods: periods)); - } - - /// - /// Creates a new thermostat daily program. A daily program consists of a set of periods, where each period includes a start time and the key of a configured climate preset. Once you have defined a daily program, you can assign it to one or more days within a weekly program. - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/thermostats/daily_programs/create", - requestOptions - ) - ) - .EnsureData("/thermostats/daily_programs/create") - .ThermostatDailyProgram; - } - - /// - /// Creates a new thermostat daily program. A daily program consists of a set of periods, where each period includes a start time and the key of a configured climate preset. Once you have defined a daily program, you can assign it to one or more days within a weekly program. - /// - public async Task CreateAsync( - string deviceId = default, - string name = default, - List periods = default - ) - { - return ( - await CreateAsync( - new CreateRequest(deviceId: deviceId, name: name, periods: periods) - ) - ); - } - - /// - /// Request parameters for Delete a Thermostat Daily Program. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string thermostatDailyProgramId = default) - { - ThermostatDailyProgramId = thermostatDailyProgramId; - } - - /// - /// ID of the thermostat daily program that you want to delete. - /// - [DataMember( - Name = "thermostat_daily_program_id", - IsRequired = true, - EmitDefaultValue = false - )] - public string ThermostatDailyProgramId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a thermostat daily program. - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/thermostats/daily_programs/delete", requestOptions); - } - - /// - /// Deletes a thermostat daily program. - /// - public void Delete(string thermostatDailyProgramId = default) - { - Delete(new DeleteRequest(thermostatDailyProgramId: thermostatDailyProgramId)); - } - - /// - /// Deletes a thermostat daily program. - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/thermostats/daily_programs/delete", requestOptions); - } - - /// - /// Deletes a thermostat daily program. - /// - public async Task DeleteAsync(string thermostatDailyProgramId = default) - { - await DeleteAsync( - new DeleteRequest(thermostatDailyProgramId: thermostatDailyProgramId) - ); - } - - /// - /// Request parameters for Update a Thermostat Daily Program. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string name = default, - List periods = default, - string thermostatDailyProgramId = default - ) - { - Name = name; - Periods = periods; - ThermostatDailyProgramId = thermostatDailyProgramId; - } - - /// - /// Name of the thermostat daily program that you want to update. - /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Array of thermostat daily program periods. The periods that you specify overwrite any existing periods for the daily program. - /// - [DataMember(Name = "periods", IsRequired = true, EmitDefaultValue = false)] - public List Periods { get; set; } - - /// - /// ID of the thermostat daily program that you want to update. - /// - [DataMember( - Name = "thermostat_daily_program_id", - IsRequired = true, - EmitDefaultValue = false - )] - public string ThermostatDailyProgramId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "updateRequestPeriods_model")] - public class UpdateRequestPeriods - { - [JsonConstructorAttribute] - protected UpdateRequestPeriods() { } - - public UpdateRequestPeriods( - string? climatePresetKey = default, - string? startsAtTime = default - ) - { - ClimatePresetKey = climatePresetKey; - StartsAtTime = startsAtTime; - } - - /// - /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to activate at the `starts_at_time`. - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string? ClimatePresetKey { get; set; } - - /// - /// Time at which the thermostat daily program period starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at_time", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAtTime { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "updateResponse_response")] - public class UpdateResponse - { - [JsonConstructorAttribute] - protected UpdateResponse() { } - - public UpdateResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a specified thermostat daily program. The periods that you specify overwrite any existing periods for the daily program. - /// - public ActionAttempt Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Patch("/thermostats/daily_programs/update", requestOptions) - .EnsureData("/thermostats/daily_programs/update") - .ActionAttempt; - } - - /// - /// Updates a specified thermostat daily program. The periods that you specify overwrite any existing periods for the daily program. - /// - public ActionAttempt Update( - string name = default, - List periods = default, - string thermostatDailyProgramId = default - ) - { - return Update( - new UpdateRequest( - name: name, - periods: periods, - thermostatDailyProgramId: thermostatDailyProgramId - ) - ); - } - - /// - /// Updates a specified thermostat daily program. The periods that you specify overwrite any existing periods for the daily program. - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PatchAsync( - "/thermostats/daily_programs/update", - requestOptions - ) - ) - .EnsureData("/thermostats/daily_programs/update") - .ActionAttempt; - } - - /// - /// Updates a specified thermostat daily program. The periods that you specify overwrite any existing periods for the daily program. - /// - public async Task UpdateAsync( - string name = default, - List periods = default, - string thermostatDailyProgramId = default - ) - { - return ( - await UpdateAsync( - new UpdateRequest( - name: name, - periods: periods, - thermostatDailyProgramId: thermostatDailyProgramId - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.DailyProgramsThermostats DailyProgramsThermostats => new(this); - } - - public partial interface ISeamClient - { - public Api.DailyProgramsThermostats DailyProgramsThermostats { get; } - } -} diff --git a/src/Seam/Api/EncodersAcs.cs b/src/Seam/Api/EncodersAcs.cs deleted file mode 100644 index 59bfb74f..00000000 --- a/src/Seam/Api/EncodersAcs.cs +++ /dev/null @@ -1,902 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class EncodersAcs - { - private ISeamClient _seam; - - public EncodersAcs(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Encode a Credential. - /// - [DataContract(Name = "encodeCredentialRequest_request")] - public class EncodeCredentialRequest - { - [JsonConstructorAttribute] - protected EncodeCredentialRequest() { } - - public EncodeCredentialRequest( - string? accessMethodId = default, - string? acsCredentialId = default, - string acsEncoderId = default - ) - { - AccessMethodId = accessMethodId; - AcsCredentialId = acsCredentialId; - AcsEncoderId = acsEncoderId; - } - - /// - /// ID of the `access_method` to encode onto a card. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessMethodId { get; set; } - - /// - /// ID of the `acs_credential` to encode onto a card. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialId { get; set; } - - /// - /// ID of the `acs_encoder` to use to encode the `acs_credential`. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "encodeCredentialResponse_response")] - public class EncodeCredentialResponse - { - [JsonConstructorAttribute] - protected EncodeCredentialResponse() { } - - public EncodeCredentialResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Encodes an existing [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). Either provide an `acs_credential_id` or an `access_method_id` - /// - public ActionAttempt EncodeCredential(EncodeCredentialRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/acs/encoders/encode_credential", requestOptions) - .EnsureData("/acs/encoders/encode_credential") - .ActionAttempt; - } - - /// - /// Encodes an existing [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). Either provide an `acs_credential_id` or an `access_method_id` - /// - public ActionAttempt EncodeCredential( - string? accessMethodId = default, - string? acsCredentialId = default, - string acsEncoderId = default - ) - { - return EncodeCredential( - new EncodeCredentialRequest( - accessMethodId: accessMethodId, - acsCredentialId: acsCredentialId, - acsEncoderId: acsEncoderId - ) - ); - } - - /// - /// Encodes an existing [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). Either provide an `acs_credential_id` or an `access_method_id` - /// - public async Task EncodeCredentialAsync(EncodeCredentialRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/acs/encoders/encode_credential", - requestOptions - ) - ) - .EnsureData("/acs/encoders/encode_credential") - .ActionAttempt; - } - - /// - /// Encodes an existing [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). Either provide an `acs_credential_id` or an `access_method_id` - /// - public async Task EncodeCredentialAsync( - string? accessMethodId = default, - string? acsCredentialId = default, - string acsEncoderId = default - ) - { - return ( - await EncodeCredentialAsync( - new EncodeCredentialRequest( - accessMethodId: accessMethodId, - acsCredentialId: acsCredentialId, - acsEncoderId: acsEncoderId - ) - ) - ); - } - - /// - /// Request parameters for Get an Encoder. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string acsEncoderId = default) - { - AcsEncoderId = acsEncoderId; - } - - /// - /// ID of the encoder that you want to get. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(AcsEncoder acsEncoder = default) - { - AcsEncoder = acsEncoder; - } - - /// - /// OK - /// - [DataMember(Name = "acs_encoder", IsRequired = false, EmitDefaultValue = false)] - public AcsEncoder AcsEncoder { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public AcsEncoder Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/encoders/get", requestOptions) - .EnsureData("/acs/encoders/get") - .AcsEncoder; - } - - /// - /// Returns a specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public AcsEncoder Get(string acsEncoderId = default) - { - return Get(new GetRequest(acsEncoderId: acsEncoderId)); - } - - /// - /// Returns a specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/encoders/get", requestOptions)) - .EnsureData("/acs/encoders/get") - .AcsEncoder; - } - - /// - /// Returns a specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public async Task GetAsync(string acsEncoderId = default) - { - return (await GetAsync(new GetRequest(acsEncoderId: acsEncoderId))); - } - - /// - /// Request parameters for List Encoders. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - List? acsEncoderIds = default, - string? acsSystemId = default, - List? acsSystemIds = default, - float? limit = default, - string? pageCursor = default - ) - { - AcsEncoderIds = acsEncoderIds; - AcsSystemId = acsSystemId; - AcsSystemIds = acsSystemIds; - Limit = limit; - PageCursor = pageCursor; - } - - /// - /// IDs of the encoders that you want to retrieve. - /// - [DataMember(Name = "acs_encoder_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AcsEncoderIds { get; set; } - - /// - /// ID of the access system for which you want to retrieve all encoders. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// IDs of the access systems for which you want to retrieve all encoders. - /// - [DataMember(Name = "acs_system_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AcsSystemIds { get; set; } - - /// - /// Number of encoders to return. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List acsEncoders = default) - { - AcsEncoders = acsEncoders; - } - - /// - /// OK - /// - [DataMember(Name = "acs_encoders", IsRequired = false, EmitDefaultValue = false)] - public List AcsEncoders { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [encoders](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/encoders/list", requestOptions) - .EnsureData("/acs/encoders/list") - .AcsEncoders; - } - - /// - /// Returns a list of all [encoders](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public List List( - List? acsEncoderIds = default, - string? acsSystemId = default, - List? acsSystemIds = default, - float? limit = default, - string? pageCursor = default - ) - { - return List( - new ListRequest( - acsEncoderIds: acsEncoderIds, - acsSystemId: acsSystemId, - acsSystemIds: acsSystemIds, - limit: limit, - pageCursor: pageCursor - ) - ); - } - - /// - /// Returns a list of all [encoders](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/encoders/list", requestOptions)) - .EnsureData("/acs/encoders/list") - .AcsEncoders; - } - - /// - /// Returns a list of all [encoders](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public async Task> ListAsync( - List? acsEncoderIds = default, - string? acsSystemId = default, - List? acsSystemIds = default, - float? limit = default, - string? pageCursor = default - ) - { - return ( - await ListAsync( - new ListRequest( - acsEncoderIds: acsEncoderIds, - acsSystemId: acsSystemId, - acsSystemIds: acsSystemIds, - limit: limit, - pageCursor: pageCursor - ) - ) - ); - } - - /// - /// Request parameters for Scan a Credential. - /// - [DataContract(Name = "scanCredentialRequest_request")] - public class ScanCredentialRequest - { - [JsonConstructorAttribute] - protected ScanCredentialRequest() { } - - public ScanCredentialRequest( - string acsEncoderId = default, - ScanCredentialRequestSaltoKsMetadata? saltoKsMetadata = default - ) - { - AcsEncoderId = acsEncoderId; - SaltoKsMetadata = saltoKsMetadata; - } - - /// - /// ID of the encoder to use for the scan. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - /// - /// Salto KS-specific metadata for the scan action. - /// - [DataMember(Name = "salto_ks_metadata", IsRequired = false, EmitDefaultValue = false)] - public ScanCredentialRequestSaltoKsMetadata? SaltoKsMetadata { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "scanCredentialRequestSaltoKsMetadata_model")] - public class ScanCredentialRequestSaltoKsMetadata - { - [JsonConstructorAttribute] - protected ScanCredentialRequestSaltoKsMetadata() { } - - public ScanCredentialRequestSaltoKsMetadata(bool? detectNewTags = default) - { - DetectNewTags = detectNewTags; - } - - /// - /// When true, activates tag registration mode on the encoder to detect new, unregistered tags. When false, only detects existing tags already registered in the system. Defaults to false. - /// - [DataMember(Name = "detect_new_tags", IsRequired = false, EmitDefaultValue = false)] - public bool? DetectNewTags { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "scanCredentialResponse_response")] - public class ScanCredentialResponse - { - [JsonConstructorAttribute] - protected ScanCredentialResponse() { } - - public ScanCredentialResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Scans an encoded [acs_credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public ActionAttempt ScanCredential(ScanCredentialRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/acs/encoders/scan_credential", requestOptions) - .EnsureData("/acs/encoders/scan_credential") - .ActionAttempt; - } - - /// - /// Scans an encoded [acs_credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public ActionAttempt ScanCredential( - string acsEncoderId = default, - ScanCredentialRequestSaltoKsMetadata? saltoKsMetadata = default - ) - { - return ScanCredential( - new ScanCredentialRequest( - acsEncoderId: acsEncoderId, - saltoKsMetadata: saltoKsMetadata - ) - ); - } - - /// - /// Scans an encoded [acs_credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public async Task ScanCredentialAsync(ScanCredentialRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/acs/encoders/scan_credential", - requestOptions - ) - ) - .EnsureData("/acs/encoders/scan_credential") - .ActionAttempt; - } - - /// - /// Scans an encoded [acs_credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - public async Task ScanCredentialAsync( - string acsEncoderId = default, - ScanCredentialRequestSaltoKsMetadata? saltoKsMetadata = default - ) - { - return ( - await ScanCredentialAsync( - new ScanCredentialRequest( - acsEncoderId: acsEncoderId, - saltoKsMetadata: saltoKsMetadata - ) - ) - ); - } - - /// - /// Request parameters for Scan to Assign a Credential. - /// - [DataContract(Name = "scanToAssignCredentialRequest_request")] - public class ScanToAssignCredentialRequest - { - [JsonConstructorAttribute] - protected ScanToAssignCredentialRequest() { } - - public ScanToAssignCredentialRequest( - string acsEncoderId = default, - string? acsUserId = default, - ScanToAssignCredentialRequestSaltoKsMetadata? saltoKsMetadata = default, - string? userIdentityId = default - ) - { - AcsEncoderId = acsEncoderId; - AcsUserId = acsUserId; - SaltoKsMetadata = saltoKsMetadata; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the `acs_encoder` to use to scan the credential. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - /// - /// ID of the `acs_user` to assign the scanned credential to. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// Salto KS-specific metadata for the scan action. - /// - [DataMember(Name = "salto_ks_metadata", IsRequired = false, EmitDefaultValue = false)] - public ScanToAssignCredentialRequestSaltoKsMetadata? SaltoKsMetadata { get; set; } - - /// - /// ID of the `user_identity` to assign the scanned credential to. If the ACS system contains an ACS user linked to this user identity, it is used. Otherwise, one is created. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "scanToAssignCredentialRequestSaltoKsMetadata_model")] - public class ScanToAssignCredentialRequestSaltoKsMetadata - { - [JsonConstructorAttribute] - protected ScanToAssignCredentialRequestSaltoKsMetadata() { } - - public ScanToAssignCredentialRequestSaltoKsMetadata(bool? detectNewTags = default) - { - DetectNewTags = detectNewTags; - } - - /// - /// When true, activates tag registration mode on the encoder to detect new, unregistered tags. When false, only detects existing tags already registered in the system. Defaults to false. - /// - [DataMember(Name = "detect_new_tags", IsRequired = false, EmitDefaultValue = false)] - public bool? DetectNewTags { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "scanToAssignCredentialResponse_response")] - public class ScanToAssignCredentialResponse - { - [JsonConstructorAttribute] - protected ScanToAssignCredentialResponse() { } - - public ScanToAssignCredentialResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Scans a physical card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) and assigns the scanned credential to an ACS user. Provide either an `acs_user_id` or a `user_identity_id`. - /// - public ActionAttempt ScanToAssignCredential(ScanToAssignCredentialRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post( - "/acs/encoders/scan_to_assign_credential", - requestOptions - ) - .EnsureData("/acs/encoders/scan_to_assign_credential") - .ActionAttempt; - } - - /// - /// Scans a physical card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) and assigns the scanned credential to an ACS user. Provide either an `acs_user_id` or a `user_identity_id`. - /// - public ActionAttempt ScanToAssignCredential( - string acsEncoderId = default, - string? acsUserId = default, - ScanToAssignCredentialRequestSaltoKsMetadata? saltoKsMetadata = default, - string? userIdentityId = default - ) - { - return ScanToAssignCredential( - new ScanToAssignCredentialRequest( - acsEncoderId: acsEncoderId, - acsUserId: acsUserId, - saltoKsMetadata: saltoKsMetadata, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Scans a physical card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) and assigns the scanned credential to an ACS user. Provide either an `acs_user_id` or a `user_identity_id`. - /// - public async Task ScanToAssignCredentialAsync( - ScanToAssignCredentialRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/acs/encoders/scan_to_assign_credential", - requestOptions - ) - ) - .EnsureData("/acs/encoders/scan_to_assign_credential") - .ActionAttempt; - } - - /// - /// Scans a physical card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) and assigns the scanned credential to an ACS user. Provide either an `acs_user_id` or a `user_identity_id`. - /// - public async Task ScanToAssignCredentialAsync( - string acsEncoderId = default, - string? acsUserId = default, - ScanToAssignCredentialRequestSaltoKsMetadata? saltoKsMetadata = default, - string? userIdentityId = default - ) - { - return ( - await ScanToAssignCredentialAsync( - new ScanToAssignCredentialRequest( - acsEncoderId: acsEncoderId, - acsUserId: acsUserId, - saltoKsMetadata: saltoKsMetadata, - userIdentityId: userIdentityId - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.EncodersAcs EncodersAcs => new(this); - } - - public partial interface ISeamClient - { - public Api.EncodersAcs EncodersAcs { get; } - } -} diff --git a/src/Seam/Api/EntrancesAcs.cs b/src/Seam/Api/EntrancesAcs.cs deleted file mode 100644 index 1f9bac64..00000000 --- a/src/Seam/Api/EntrancesAcs.cs +++ /dev/null @@ -1,833 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class EntrancesAcs - { - private ISeamClient _seam; - - public EntrancesAcs(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Get an Entrance. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string acsEntranceId = default) - { - AcsEntranceId = acsEntranceId; - } - - /// - /// ID of the entrance that you want to get. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(AcsEntrance acsEntrance = default) - { - AcsEntrance = acsEntrance; - } - - /// - /// OK - /// - [DataMember(Name = "acs_entrance", IsRequired = false, EmitDefaultValue = false)] - public AcsEntrance AcsEntrance { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public AcsEntrance Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/entrances/get", requestOptions) - .EnsureData("/acs/entrances/get") - .AcsEntrance; - } - - /// - /// Returns a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public AcsEntrance Get(string acsEntranceId = default) - { - return Get(new GetRequest(acsEntranceId: acsEntranceId)); - } - - /// - /// Returns a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/entrances/get", requestOptions)) - .EnsureData("/acs/entrances/get") - .AcsEntrance; - } - - /// - /// Returns a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public async Task GetAsync(string acsEntranceId = default) - { - return (await GetAsync(new GetRequest(acsEntranceId: acsEntranceId))); - } - - /// - /// Request parameters for Grant an ACS User Access to an Entrance. - /// - [DataContract(Name = "grantAccessRequest_request")] - public class GrantAccessRequest - { - [JsonConstructorAttribute] - protected GrantAccessRequest() { } - - public GrantAccessRequest( - string acsEntranceId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsEntranceId = acsEntranceId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the entrance to which you want to grant an access system user access. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - /// - /// ID of the access system user to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Grants a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) access to a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public void GrantAccess(GrantAccessRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/acs/entrances/grant_access", requestOptions); - } - - /// - /// Grants a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) access to a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public void GrantAccess( - string acsEntranceId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - GrantAccess( - new GrantAccessRequest( - acsEntranceId: acsEntranceId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Grants a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) access to a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public async Task GrantAccessAsync(GrantAccessRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/acs/entrances/grant_access", requestOptions); - } - - /// - /// Grants a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) access to a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public async Task GrantAccessAsync( - string acsEntranceId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await GrantAccessAsync( - new GrantAccessRequest( - acsEntranceId: acsEntranceId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Request parameters for List Entrances. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? accessMethodId = default, - string? acsCredentialId = default, - List? acsEntranceIds = default, - string? acsSystemId = default, - string? connectedAccountId = default, - string? customerKey = default, - int? limit = default, - string? locationId = default, - string? pageCursor = default, - string? search = default, - string? spaceId = default - ) - { - AccessMethodId = accessMethodId; - AcsCredentialId = acsCredentialId; - AcsEntranceIds = acsEntranceIds; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CustomerKey = customerKey; - Limit = limit; - LocationId = locationId; - PageCursor = pageCursor; - Search = search; - SpaceId = spaceId; - } - - /// - /// ID of the access method for which you want to retrieve all entrances to which it grants access. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessMethodId { get; set; } - - /// - /// ID of the credential for which you want to retrieve all entrances. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialId { get; set; } - - /// - /// IDs of the entrances for which you want to retrieve all entrances. - /// - [DataMember(Name = "acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AcsEntranceIds { get; set; } - - /// - /// ID of the access system for which you want to retrieve all entrances. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the connected account for which you want to retrieve all entrances. - /// - [DataMember( - Name = "connected_account_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectedAccountId { get; set; } - - /// - /// Customer key for which you want to list entrances. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Maximum number of records to return per page. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public int? Limit { get; set; } - - [Obsolete("Use `space_id`.")] - [DataMember(Name = "location_id", IsRequired = false, EmitDefaultValue = false)] - public string? LocationId { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned entrances to include all records that satisfy a partial match using `display_name`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// ID of the space for which you want to list entrances. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List acsEntrances = default) - { - AcsEntrances = acsEntrances; - } - - /// - /// OK - /// - [DataMember(Name = "acs_entrances", IsRequired = false, EmitDefaultValue = false)] - public List AcsEntrances { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [access system entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/entrances/list", requestOptions) - .EnsureData("/acs/entrances/list") - .AcsEntrances; - } - - /// - /// Returns a list of all [access system entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public List List( - string? accessMethodId = default, - string? acsCredentialId = default, - List? acsEntranceIds = default, - string? acsSystemId = default, - string? connectedAccountId = default, - string? customerKey = default, - int? limit = default, - string? locationId = default, - string? pageCursor = default, - string? search = default, - string? spaceId = default - ) - { - return List( - new ListRequest( - accessMethodId: accessMethodId, - acsCredentialId: acsCredentialId, - acsEntranceIds: acsEntranceIds, - acsSystemId: acsSystemId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - limit: limit, - locationId: locationId, - pageCursor: pageCursor, - search: search, - spaceId: spaceId - ) - ); - } - - /// - /// Returns a list of all [access system entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/entrances/list", requestOptions)) - .EnsureData("/acs/entrances/list") - .AcsEntrances; - } - - /// - /// Returns a list of all [access system entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public async Task> ListAsync( - string? accessMethodId = default, - string? acsCredentialId = default, - List? acsEntranceIds = default, - string? acsSystemId = default, - string? connectedAccountId = default, - string? customerKey = default, - int? limit = default, - string? locationId = default, - string? pageCursor = default, - string? search = default, - string? spaceId = default - ) - { - return ( - await ListAsync( - new ListRequest( - accessMethodId: accessMethodId, - acsCredentialId: acsCredentialId, - acsEntranceIds: acsEntranceIds, - acsSystemId: acsSystemId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - limit: limit, - locationId: locationId, - pageCursor: pageCursor, - search: search, - spaceId: spaceId - ) - ) - ); - } - - /// - /// Request parameters for List Credentials with Access to an Entrance. - /// - [DataContract(Name = "listCredentialsWithAccessRequest_request")] - public class ListCredentialsWithAccessRequest - { - [JsonConstructorAttribute] - protected ListCredentialsWithAccessRequest() { } - - public ListCredentialsWithAccessRequest( - string acsEntranceId = default, - List? includeIf = default - ) - { - AcsEntranceId = acsEntranceId; - IncludeIf = includeIf; - } - - /// - /// Conditions that credentials must meet to be included in the returned list. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum IncludeIfEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "visionline_metadata.is_valid")] - VisionlineMetadataIsValid = 1, - } - - /// - /// ID of the entrance for which you want to list all credentials that grant access. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - /// - /// Conditions that credentials must meet to be included in the returned list. - /// - [DataMember(Name = "include_if", IsRequired = false, EmitDefaultValue = false)] - public List? IncludeIf { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listCredentialsWithAccessResponse_response")] - public class ListCredentialsWithAccessResponse - { - [JsonConstructorAttribute] - protected ListCredentialsWithAccessResponse() { } - - public ListCredentialsWithAccessResponse(List acsCredentials = default) - { - AcsCredentials = acsCredentials; - } - - /// - /// OK - /// - [DataMember(Name = "acs_credentials", IsRequired = false, EmitDefaultValue = false)] - public List AcsCredentials { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) with access to a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public List ListCredentialsWithAccess( - ListCredentialsWithAccessRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get( - "/acs/entrances/list_credentials_with_access", - requestOptions - ) - .EnsureData("/acs/entrances/list_credentials_with_access") - .AcsCredentials; - } - - /// - /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) with access to a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public List ListCredentialsWithAccess( - string acsEntranceId = default, - List? includeIf = default - ) - { - return ListCredentialsWithAccess( - new ListCredentialsWithAccessRequest( - acsEntranceId: acsEntranceId, - includeIf: includeIf - ) - ); - } - - /// - /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) with access to a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public async Task> ListCredentialsWithAccessAsync( - ListCredentialsWithAccessRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/acs/entrances/list_credentials_with_access", - requestOptions - ) - ) - .EnsureData("/acs/entrances/list_credentials_with_access") - .AcsCredentials; - } - - /// - /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) with access to a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - public async Task> ListCredentialsWithAccessAsync( - string acsEntranceId = default, - List? includeIf = default - ) - { - return ( - await ListCredentialsWithAccessAsync( - new ListCredentialsWithAccessRequest( - acsEntranceId: acsEntranceId, - includeIf: includeIf - ) - ) - ); - } - - /// - /// Request parameters for Unlock an Entrance. - /// - [DataContract(Name = "unlockRequest_request")] - public class UnlockRequest - { - [JsonConstructorAttribute] - protected UnlockRequest() { } - - public UnlockRequest(string acsCredentialId = default, string acsEntranceId = default) - { - AcsCredentialId = acsCredentialId; - AcsEntranceId = acsEntranceId; - } - - /// - /// ID of the cloud_key credential to use for the unlock operation. - /// - [DataMember(Name = "acs_credential_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the entrance to unlock. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "unlockResponse_response")] - public class UnlockResponse - { - [JsonConstructorAttribute] - protected UnlockResponse() { } - - public UnlockResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using a cloud_key credential. Returns an action attempt that tracks the progress of the unlock operation. - /// - public ActionAttempt Unlock(UnlockRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/acs/entrances/unlock", requestOptions) - .EnsureData("/acs/entrances/unlock") - .ActionAttempt; - } - - /// - /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using a cloud_key credential. Returns an action attempt that tracks the progress of the unlock operation. - /// - public ActionAttempt Unlock( - string acsCredentialId = default, - string acsEntranceId = default - ) - { - return Unlock( - new UnlockRequest(acsCredentialId: acsCredentialId, acsEntranceId: acsEntranceId) - ); - } - - /// - /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using a cloud_key credential. Returns an action attempt that tracks the progress of the unlock operation. - /// - public async Task UnlockAsync(UnlockRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/acs/entrances/unlock", requestOptions)) - .EnsureData("/acs/entrances/unlock") - .ActionAttempt; - } - - /// - /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using a cloud_key credential. Returns an action attempt that tracks the progress of the unlock operation. - /// - public async Task UnlockAsync( - string acsCredentialId = default, - string acsEntranceId = default - ) - { - return ( - await UnlockAsync( - new UnlockRequest( - acsCredentialId: acsCredentialId, - acsEntranceId: acsEntranceId - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.EntrancesAcs EntrancesAcs => new(this); - } - - public partial interface ISeamClient - { - public Api.EntrancesAcs EntrancesAcs { get; } - } -} diff --git a/src/Seam/Api/InstantKeys.cs b/src/Seam/Api/InstantKeys.cs deleted file mode 100644 index c64a564e..00000000 --- a/src/Seam/Api/InstantKeys.cs +++ /dev/null @@ -1,360 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class InstantKeys - { - private ISeamClient _seam; - - public InstantKeys(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Delete an Instant Key. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string instantKeyId = default) - { - InstantKeyId = instantKeyId; - } - - /// - /// ID of the Instant Key that you want to delete. - /// - [DataMember(Name = "instant_key_id", IsRequired = true, EmitDefaultValue = false)] - public string InstantKeyId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a specified [Instant Key](https://docs.seam.co/capability-guides/instant-keys). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/instant_keys/delete", requestOptions); - } - - /// - /// Deletes a specified [Instant Key](https://docs.seam.co/capability-guides/instant-keys). - /// - public void Delete(string instantKeyId = default) - { - Delete(new DeleteRequest(instantKeyId: instantKeyId)); - } - - /// - /// Deletes a specified [Instant Key](https://docs.seam.co/capability-guides/instant-keys). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/instant_keys/delete", requestOptions); - } - - /// - /// Deletes a specified [Instant Key](https://docs.seam.co/capability-guides/instant-keys). - /// - public async Task DeleteAsync(string instantKeyId = default) - { - await DeleteAsync(new DeleteRequest(instantKeyId: instantKeyId)); - } - - /// - /// Request parameters for Get an Instant Key. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string? instantKeyId = default, string? instantKeyUrl = default) - { - InstantKeyId = instantKeyId; - InstantKeyUrl = instantKeyUrl; - } - - /// - /// ID of the instant key to get. - /// - [DataMember(Name = "instant_key_id", IsRequired = false, EmitDefaultValue = false)] - public string? InstantKeyId { get; set; } - - /// - /// URL of the instant key to get. - /// - [DataMember(Name = "instant_key_url", IsRequired = false, EmitDefaultValue = false)] - public string? InstantKeyUrl { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(InstantKey instantKey = default) - { - InstantKey = instantKey; - } - - /// - /// OK - /// - [DataMember(Name = "instant_key", IsRequired = false, EmitDefaultValue = false)] - public InstantKey InstantKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets an [instant key](https://docs.seam.co/capability-guides/instant-keys). - /// - public InstantKey Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/instant_keys/get", requestOptions) - .EnsureData("/instant_keys/get") - .InstantKey; - } - - /// - /// Gets an [instant key](https://docs.seam.co/capability-guides/instant-keys). - /// - public InstantKey Get(string? instantKeyId = default, string? instantKeyUrl = default) - { - return Get(new GetRequest(instantKeyId: instantKeyId, instantKeyUrl: instantKeyUrl)); - } - - /// - /// Gets an [instant key](https://docs.seam.co/capability-guides/instant-keys). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/instant_keys/get", requestOptions)) - .EnsureData("/instant_keys/get") - .InstantKey; - } - - /// - /// Gets an [instant key](https://docs.seam.co/capability-guides/instant-keys). - /// - public async Task GetAsync( - string? instantKeyId = default, - string? instantKeyUrl = default - ) - { - return ( - await GetAsync( - new GetRequest(instantKeyId: instantKeyId, instantKeyUrl: instantKeyUrl) - ) - ); - } - - /// - /// Request parameters for List Instant Keys. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest(string? userIdentityId = default) - { - UserIdentityId = userIdentityId; - } - - /// - /// ID of the user identity by which you want to filter the list of Instant Keys. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List instantKeys = default) - { - InstantKeys = instantKeys; - } - - /// - /// OK - /// - [DataMember(Name = "instant_keys", IsRequired = false, EmitDefaultValue = false)] - public List InstantKeys { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [instant keys](https://docs.seam.co/capability-guides/instant-keys). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/instant_keys/list", requestOptions) - .EnsureData("/instant_keys/list") - .InstantKeys; - } - - /// - /// Returns a list of all [instant keys](https://docs.seam.co/capability-guides/instant-keys). - /// - public List List(string? userIdentityId = default) - { - return List(new ListRequest(userIdentityId: userIdentityId)); - } - - /// - /// Returns a list of all [instant keys](https://docs.seam.co/capability-guides/instant-keys). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/instant_keys/list", requestOptions)) - .EnsureData("/instant_keys/list") - .InstantKeys; - } - - /// - /// Returns a list of all [instant keys](https://docs.seam.co/capability-guides/instant-keys). - /// - public async Task> ListAsync(string? userIdentityId = default) - { - return (await ListAsync(new ListRequest(userIdentityId: userIdentityId))); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.InstantKeys InstantKeys => new(this); - } - - public partial interface ISeamClient - { - public Api.InstantKeys InstantKeys { get; } - } -} diff --git a/src/Seam/Api/Locks.cs b/src/Seam/Api/Locks.cs deleted file mode 100644 index 0b701d67..00000000 --- a/src/Seam/Api/Locks.cs +++ /dev/null @@ -1,1080 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class Locks - { - private ISeamClient _seam; - - public Locks(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Configure Auto-Lock. - /// - [DataContract(Name = "configureAutoLockRequest_request")] - public class ConfigureAutoLockRequest - { - [JsonConstructorAttribute] - protected ConfigureAutoLockRequest() { } - - public ConfigureAutoLockRequest( - float? autoLockDelaySeconds = default, - bool autoLockEnabled = default, - string deviceId = default - ) - { - AutoLockDelaySeconds = autoLockDelaySeconds; - AutoLockEnabled = autoLockEnabled; - DeviceId = deviceId; - } - - /// - /// Delay in seconds before the lock automatically locks. Required when enabling auto-lock. Must be between 1 and 60. - /// - [DataMember( - Name = "auto_lock_delay_seconds", - IsRequired = false, - EmitDefaultValue = false - )] - public float? AutoLockDelaySeconds { get; set; } - - /// - /// Whether to enable or disable auto-lock. - /// - [DataMember(Name = "auto_lock_enabled", IsRequired = true, EmitDefaultValue = false)] - public bool AutoLockEnabled { get; set; } - - /// - /// ID of the lock for which you want to configure the auto-lock. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "configureAutoLockResponse_response")] - public class ConfigureAutoLockResponse - { - [JsonConstructorAttribute] - protected ConfigureAutoLockResponse() { } - - public ConfigureAutoLockResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Configures the auto-lock setting for a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). - /// - public ActionAttempt ConfigureAutoLock(ConfigureAutoLockRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/locks/configure_auto_lock", requestOptions) - .EnsureData("/locks/configure_auto_lock") - .ActionAttempt; - } - - /// - /// Configures the auto-lock setting for a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). - /// - public ActionAttempt ConfigureAutoLock( - float? autoLockDelaySeconds = default, - bool autoLockEnabled = default, - string deviceId = default - ) - { - return ConfigureAutoLock( - new ConfigureAutoLockRequest( - autoLockDelaySeconds: autoLockDelaySeconds, - autoLockEnabled: autoLockEnabled, - deviceId: deviceId - ) - ); - } - - /// - /// Configures the auto-lock setting for a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). - /// - public async Task ConfigureAutoLockAsync(ConfigureAutoLockRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/locks/configure_auto_lock", - requestOptions - ) - ) - .EnsureData("/locks/configure_auto_lock") - .ActionAttempt; - } - - /// - /// Configures the auto-lock setting for a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). - /// - public async Task ConfigureAutoLockAsync( - float? autoLockDelaySeconds = default, - bool autoLockEnabled = default, - string deviceId = default - ) - { - return ( - await ConfigureAutoLockAsync( - new ConfigureAutoLockRequest( - autoLockDelaySeconds: autoLockDelaySeconds, - autoLockEnabled: autoLockEnabled, - deviceId: deviceId - ) - ) - ); - } - - /// - /// Request parameters for Get a Lock. - /// - [Obsolete("Use `/devices/get` instead.")] - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string? deviceId = default, string? name = default) - { - DeviceId = deviceId; - Name = name; - } - - /// - /// ID of the lock that you want to get. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Name of the lock that you want to get. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(Device device = default) - { - Device = device; - } - - /// - /// OK - /// - [DataMember(Name = "device", IsRequired = false, EmitDefaultValue = false)] - public Device Device { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). - /// - [Obsolete("Use `/devices/get` instead.")] - public Device Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/locks/get", requestOptions) - .EnsureData("/locks/get") - .Device; - } - - /// - /// Returns a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). - /// - [Obsolete("Use `/devices/get` instead.")] - public Device Get(string? deviceId = default, string? name = default) - { - return Get(new GetRequest(deviceId: deviceId, name: name)); - } - - /// - /// Returns a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). - /// - [Obsolete("Use `/devices/get` instead.")] - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/locks/get", requestOptions)) - .EnsureData("/locks/get") - .Device; - } - - /// - /// Returns a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). - /// - [Obsolete("Use `/devices/get` instead.")] - public async Task GetAsync(string? deviceId = default, string? name = default) - { - return (await GetAsync(new GetRequest(deviceId: deviceId, name: name))); - } - - /// - /// Request parameters for List Locks. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - ListRequest.ManufacturerEnum? manufacturer = default - ) - { - ConnectWebviewId = connectWebviewId; - ConnectedAccountId = connectedAccountId; - CustomerKey = customerKey; - DeviceType = deviceType; - DeviceTypes = deviceTypes; - Manufacturer = manufacturer; - } - - /// - /// Device type of the locks that you want to list. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "akuvox_lock")] - AkuvoxLock = 1, - - [EnumMember(Value = "august_lock")] - AugustLock = 2, - - [EnumMember(Value = "brivo_access_point")] - BrivoAccessPoint = 3, - - [EnumMember(Value = "butterflymx_panel")] - ButterflymxPanel = 4, - - [EnumMember(Value = "avigilon_alta_entry")] - AvigilonAltaEntry = 5, - - [EnumMember(Value = "doorking_lock")] - DoorkingLock = 6, - - [EnumMember(Value = "genie_door")] - GenieDoor = 7, - - [EnumMember(Value = "igloo_lock")] - IglooLock = 8, - - [EnumMember(Value = "linear_lock")] - LinearLock = 9, - - [EnumMember(Value = "lockly_lock")] - LocklyLock = 10, - - [EnumMember(Value = "kwikset_lock")] - KwiksetLock = 11, - - [EnumMember(Value = "nuki_lock")] - NukiLock = 12, - - [EnumMember(Value = "salto_lock")] - SaltoLock = 13, - - [EnumMember(Value = "schlage_lock")] - SchlageLock = 14, - - [EnumMember(Value = "smartthings_lock")] - SmartthingsLock = 15, - - [EnumMember(Value = "wyze_lock")] - WyzeLock = 16, - - [EnumMember(Value = "yale_lock")] - YaleLock = 17, - - [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, - - [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, - - [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, - - [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, - - [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, - - [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, - - [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, - - [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, - - [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, - - [EnumMember(Value = "yacan_lock")] - YacanLock = 27, - - [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, - - [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, - - [EnumMember(Value = "kisi_lock")] - KisiLock = 30, - - [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, - } - - /// - /// Device types of the locks that you want to list. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypesEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "akuvox_lock")] - AkuvoxLock = 1, - - [EnumMember(Value = "august_lock")] - AugustLock = 2, - - [EnumMember(Value = "brivo_access_point")] - BrivoAccessPoint = 3, - - [EnumMember(Value = "butterflymx_panel")] - ButterflymxPanel = 4, - - [EnumMember(Value = "avigilon_alta_entry")] - AvigilonAltaEntry = 5, - - [EnumMember(Value = "doorking_lock")] - DoorkingLock = 6, - - [EnumMember(Value = "genie_door")] - GenieDoor = 7, - - [EnumMember(Value = "igloo_lock")] - IglooLock = 8, - - [EnumMember(Value = "linear_lock")] - LinearLock = 9, - - [EnumMember(Value = "lockly_lock")] - LocklyLock = 10, - - [EnumMember(Value = "kwikset_lock")] - KwiksetLock = 11, - - [EnumMember(Value = "nuki_lock")] - NukiLock = 12, - - [EnumMember(Value = "salto_lock")] - SaltoLock = 13, - - [EnumMember(Value = "schlage_lock")] - SchlageLock = 14, - - [EnumMember(Value = "smartthings_lock")] - SmartthingsLock = 15, - - [EnumMember(Value = "wyze_lock")] - WyzeLock = 16, - - [EnumMember(Value = "yale_lock")] - YaleLock = 17, - - [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, - - [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, - - [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, - - [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, - - [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, - - [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, - - [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, - - [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, - - [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, - - [EnumMember(Value = "yacan_lock")] - YacanLock = 27, - - [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, - - [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, - - [EnumMember(Value = "kisi_lock")] - KisiLock = 30, - - [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, - } - - /// - /// Manufacturer of the locks that you want to list. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ManufacturerEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "akuvox")] - Akuvox = 1, - - [EnumMember(Value = "august")] - August = 2, - - [EnumMember(Value = "brivo")] - Brivo = 3, - - [EnumMember(Value = "butterflymx")] - Butterflymx = 4, - - [EnumMember(Value = "avigilon_alta")] - AvigilonAlta = 5, - - [EnumMember(Value = "doorking")] - Doorking = 6, - - [EnumMember(Value = "genie")] - Genie = 7, - - [EnumMember(Value = "igloo")] - Igloo = 8, - - [EnumMember(Value = "linear")] - Linear = 9, - - [EnumMember(Value = "lockly")] - Lockly = 10, - - [EnumMember(Value = "kwikset")] - Kwikset = 11, - - [EnumMember(Value = "nuki")] - Nuki = 12, - - [EnumMember(Value = "salto")] - Salto = 13, - - [EnumMember(Value = "schlage")] - Schlage = 14, - - [EnumMember(Value = "seam")] - Seam = 15, - - [EnumMember(Value = "wyze")] - Wyze = 16, - - [EnumMember(Value = "yale")] - Yale = 17, - - [EnumMember(Value = "two_n")] - TwoN = 18, - - [EnumMember(Value = "controlbyweb")] - Controlbyweb = 19, - - [EnumMember(Value = "ttlock")] - Ttlock = 20, - - [EnumMember(Value = "igloohome")] - Igloohome = 21, - - [EnumMember(Value = "four_suites")] - FourSuites = 22, - - [EnumMember(Value = "dormakaba_oracode")] - DormakabaOracode = 23, - - [EnumMember(Value = "tedee")] - Tedee = 24, - - [EnumMember(Value = "keyincode")] - Keyincode = 25, - - [EnumMember(Value = "akiles")] - Akiles = 26, - - [EnumMember(Value = "aqara")] - Aqara = 27, - - [EnumMember(Value = "korelock")] - Korelock = 28, - - [EnumMember(Value = "smartthings")] - Smartthings = 29, - - [EnumMember(Value = "ultraloq")] - Ultraloq = 30, - - [EnumMember(Value = "omnitec")] - Omnitec = 31, - - [EnumMember(Value = "kisi")] - Kisi = 32, - - [EnumMember(Value = "yacan")] - Yacan = 33, - } - - /// - /// ID of the Connect Webview for which you want to list devices. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectWebviewId { get; set; } - - /// - /// ID of the connected account for which you want to list devices. - /// - [DataMember( - Name = "connected_account_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectedAccountId { get; set; } - - /// - /// Customer key for which you want to list devices. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Device type of the locks that you want to list. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.DeviceTypeEnum? DeviceType { get; set; } - - /// - /// Device types of the locks that you want to list. - /// - [DataMember(Name = "device_types", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceTypes { get; set; } - - /// - /// Manufacturer of the locks that you want to list. - /// - [DataMember(Name = "manufacturer", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.ManufacturerEnum? Manufacturer { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List devices = default) - { - Devices = devices; - } - - /// - /// OK - /// - [DataMember(Name = "devices", IsRequired = false, EmitDefaultValue = false)] - public List Devices { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [locks](https://docs.seam.co/low-level-apis/smart-locks). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/locks/list", requestOptions) - .EnsureData("/locks/list") - .Devices; - } - - /// - /// Returns a list of all [locks](https://docs.seam.co/low-level-apis/smart-locks). - /// - public List List( - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - ListRequest.ManufacturerEnum? manufacturer = default - ) - { - return List( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - deviceType: deviceType, - deviceTypes: deviceTypes, - manufacturer: manufacturer - ) - ); - } - - /// - /// Returns a list of all [locks](https://docs.seam.co/low-level-apis/smart-locks). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/locks/list", requestOptions)) - .EnsureData("/locks/list") - .Devices; - } - - /// - /// Returns a list of all [locks](https://docs.seam.co/low-level-apis/smart-locks). - /// - public async Task> ListAsync( - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - ListRequest.ManufacturerEnum? manufacturer = default - ) - { - return ( - await ListAsync( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - deviceType: deviceType, - deviceTypes: deviceTypes, - manufacturer: manufacturer - ) - ) - ); - } - - /// - /// Request parameters for Lock a Lock. - /// - [DataContract(Name = "lockDoorRequest_request")] - public class LockDoorRequest - { - [JsonConstructorAttribute] - protected LockDoorRequest() { } - - public LockDoorRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the lock that you want to lock. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "lockDoorResponse_response")] - public class LockDoorResponse - { - [JsonConstructorAttribute] - protected LockDoorResponse() { } - - public LockDoorResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Locks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). - /// - public ActionAttempt LockDoor(LockDoorRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/locks/lock_door", requestOptions) - .EnsureData("/locks/lock_door") - .ActionAttempt; - } - - /// - /// Locks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). - /// - public ActionAttempt LockDoor(string deviceId = default) - { - return LockDoor(new LockDoorRequest(deviceId: deviceId)); - } - - /// - /// Locks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). - /// - public async Task LockDoorAsync(LockDoorRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/locks/lock_door", requestOptions)) - .EnsureData("/locks/lock_door") - .ActionAttempt; - } - - /// - /// Locks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). - /// - public async Task LockDoorAsync(string deviceId = default) - { - return (await LockDoorAsync(new LockDoorRequest(deviceId: deviceId))); - } - - /// - /// Request parameters for Unlock a Lock. - /// - [DataContract(Name = "unlockDoorRequest_request")] - public class UnlockDoorRequest - { - [JsonConstructorAttribute] - protected UnlockDoorRequest() { } - - public UnlockDoorRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the lock that you want to unlock. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "unlockDoorResponse_response")] - public class UnlockDoorResponse - { - [JsonConstructorAttribute] - protected UnlockDoorResponse() { } - - public UnlockDoorResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Unlocks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). - /// - public ActionAttempt UnlockDoor(UnlockDoorRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/locks/unlock_door", requestOptions) - .EnsureData("/locks/unlock_door") - .ActionAttempt; - } - - /// - /// Unlocks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). - /// - public ActionAttempt UnlockDoor(string deviceId = default) - { - return UnlockDoor(new UnlockDoorRequest(deviceId: deviceId)); - } - - /// - /// Unlocks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). - /// - public async Task UnlockDoorAsync(UnlockDoorRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/locks/unlock_door", requestOptions)) - .EnsureData("/locks/unlock_door") - .ActionAttempt; - } - - /// - /// Unlocks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). - /// - public async Task UnlockDoorAsync(string deviceId = default) - { - return (await UnlockDoorAsync(new UnlockDoorRequest(deviceId: deviceId))); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.Locks Locks => new(this); - } - - public partial interface ISeamClient - { - public Api.Locks Locks { get; } - } -} diff --git a/src/Seam/Api/NoiseSensors.cs b/src/Seam/Api/NoiseSensors.cs deleted file mode 100644 index ce85bf8e..00000000 --- a/src/Seam/Api/NoiseSensors.cs +++ /dev/null @@ -1,280 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class NoiseSensors - { - private ISeamClient _seam; - - public NoiseSensors(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for List Noise Sensors. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - ListRequest.ManufacturerEnum? manufacturer = default - ) - { - ConnectWebviewId = connectWebviewId; - ConnectedAccountId = connectedAccountId; - CustomerKey = customerKey; - DeviceType = deviceType; - DeviceTypes = deviceTypes; - Manufacturer = manufacturer; - } - - /// - /// Device type of the noise sensors that you want to list. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 1, - - [EnumMember(Value = "minut_sensor")] - MinutSensor = 2, - } - - /// - /// Device types of the noise sensors that you want to list. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypesEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 1, - - [EnumMember(Value = "minut_sensor")] - MinutSensor = 2, - } - - /// - /// Manufacturers of the noise sensors that you want to list. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ManufacturerEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "minut")] - Minut = 1, - - [EnumMember(Value = "noiseaware")] - Noiseaware = 2, - } - - /// - /// ID of the Connect Webview for which you want to list devices. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectWebviewId { get; set; } - - /// - /// ID of the connected account for which you want to list devices. - /// - [DataMember( - Name = "connected_account_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectedAccountId { get; set; } - - /// - /// Customer key for which you want to list devices. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Device type of the noise sensors that you want to list. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.DeviceTypeEnum? DeviceType { get; set; } - - /// - /// Device types of the noise sensors that you want to list. - /// - [DataMember(Name = "device_types", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceTypes { get; set; } - - /// - /// Manufacturers of the noise sensors that you want to list. - /// - [DataMember(Name = "manufacturer", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.ManufacturerEnum? Manufacturer { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List devices = default) - { - Devices = devices; - } - - /// - /// OK - /// - [DataMember(Name = "devices", IsRequired = false, EmitDefaultValue = false)] - public List Devices { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [noise sensors](https://docs.seam.co/capability-guides/noise-sensors). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/noise_sensors/list", requestOptions) - .EnsureData("/noise_sensors/list") - .Devices; - } - - /// - /// Returns a list of all [noise sensors](https://docs.seam.co/capability-guides/noise-sensors). - /// - public List List( - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - ListRequest.ManufacturerEnum? manufacturer = default - ) - { - return List( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - deviceType: deviceType, - deviceTypes: deviceTypes, - manufacturer: manufacturer - ) - ); - } - - /// - /// Returns a list of all [noise sensors](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/noise_sensors/list", requestOptions)) - .EnsureData("/noise_sensors/list") - .Devices; - } - - /// - /// Returns a list of all [noise sensors](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task> ListAsync( - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - ListRequest.ManufacturerEnum? manufacturer = default - ) - { - return ( - await ListAsync( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - deviceType: deviceType, - deviceTypes: deviceTypes, - manufacturer: manufacturer - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.NoiseSensors NoiseSensors => new(this); - } - - public partial interface ISeamClient - { - public Api.NoiseSensors NoiseSensors { get; } - } -} diff --git a/src/Seam/Api/NoiseThresholdsNoiseSensors.cs b/src/Seam/Api/NoiseThresholdsNoiseSensors.cs deleted file mode 100644 index d84d23f3..00000000 --- a/src/Seam/Api/NoiseThresholdsNoiseSensors.cs +++ /dev/null @@ -1,737 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class NoiseThresholdsNoiseSensors - { - private ISeamClient _seam; - - public NoiseThresholdsNoiseSensors(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create a Noise Threshold. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - string deviceId = default, - string endsDailyAt = default, - string? name = default, - float? noiseThresholdDecibels = default, - float? noiseThresholdNrs = default, - string startsDailyAt = default - ) - { - DeviceId = deviceId; - EndsDailyAt = endsDailyAt; - Name = name; - NoiseThresholdDecibels = noiseThresholdDecibels; - NoiseThresholdNrs = noiseThresholdNrs; - StartsDailyAt = startsDailyAt; - } - - /// - /// ID of the device for which you want to create a noise threshold. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Time at which the new noise threshold should become inactive daily. - /// - [DataMember(Name = "ends_daily_at", IsRequired = true, EmitDefaultValue = false)] - public string EndsDailyAt { get; set; } - - /// - /// Name of the new noise threshold. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Noise level in decibels for the new noise threshold. - /// - [DataMember( - Name = "noise_threshold_decibels", - IsRequired = false, - EmitDefaultValue = false - )] - public float? NoiseThresholdDecibels { get; set; } - - /// - /// Noise level in Noiseaware Noise Risk Score (NRS) for the new noise threshold. This parameter is only relevant for [Noiseaware sensors](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors). - /// - [DataMember(Name = "noise_threshold_nrs", IsRequired = false, EmitDefaultValue = false)] - public float? NoiseThresholdNrs { get; set; } - - /// - /// Time at which the new noise threshold should become active daily. - /// - [DataMember(Name = "starts_daily_at", IsRequired = true, EmitDefaultValue = false)] - public string StartsDailyAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(NoiseThreshold noiseThreshold = default) - { - NoiseThreshold = noiseThreshold; - } - - /// - /// OK - /// - [DataMember(Name = "noise_threshold", IsRequired = false, EmitDefaultValue = false)] - public NoiseThreshold NoiseThreshold { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. - /// - public NoiseThreshold Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/noise_sensors/noise_thresholds/create", requestOptions) - .EnsureData("/noise_sensors/noise_thresholds/create") - .NoiseThreshold; - } - - /// - /// Creates a new [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. - /// - public NoiseThreshold Create( - string deviceId = default, - string endsDailyAt = default, - string? name = default, - float? noiseThresholdDecibels = default, - float? noiseThresholdNrs = default, - string startsDailyAt = default - ) - { - return Create( - new CreateRequest( - deviceId: deviceId, - endsDailyAt: endsDailyAt, - name: name, - noiseThresholdDecibels: noiseThresholdDecibels, - noiseThresholdNrs: noiseThresholdNrs, - startsDailyAt: startsDailyAt - ) - ); - } - - /// - /// Creates a new [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/noise_sensors/noise_thresholds/create", - requestOptions - ) - ) - .EnsureData("/noise_sensors/noise_thresholds/create") - .NoiseThreshold; - } - - /// - /// Creates a new [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. - /// - public async Task CreateAsync( - string deviceId = default, - string endsDailyAt = default, - string? name = default, - float? noiseThresholdDecibels = default, - float? noiseThresholdNrs = default, - string startsDailyAt = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - deviceId: deviceId, - endsDailyAt: endsDailyAt, - name: name, - noiseThresholdDecibels: noiseThresholdDecibels, - noiseThresholdNrs: noiseThresholdNrs, - startsDailyAt: startsDailyAt - ) - ) - ); - } - - /// - /// Request parameters for Delete a Noise Threshold. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string deviceId = default, string noiseThresholdId = default) - { - DeviceId = deviceId; - NoiseThresholdId = noiseThresholdId; - } - - /// - /// ID of the device that contains the noise threshold that you want to delete. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// ID of the noise threshold that you want to delete. - /// - [DataMember(Name = "noise_threshold_id", IsRequired = true, EmitDefaultValue = false)] - public string NoiseThresholdId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) from a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/noise_sensors/noise_thresholds/delete", requestOptions); - } - - /// - /// Deletes a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) from a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public void Delete(string deviceId = default, string noiseThresholdId = default) - { - Delete(new DeleteRequest(deviceId: deviceId, noiseThresholdId: noiseThresholdId)); - } - - /// - /// Deletes a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) from a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync( - "/noise_sensors/noise_thresholds/delete", - requestOptions - ); - } - - /// - /// Deletes a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) from a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task DeleteAsync(string deviceId = default, string noiseThresholdId = default) - { - await DeleteAsync( - new DeleteRequest(deviceId: deviceId, noiseThresholdId: noiseThresholdId) - ); - } - - /// - /// Request parameters for Get a Noise Threshold. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string noiseThresholdId = default) - { - NoiseThresholdId = noiseThresholdId; - } - - /// - /// ID of the noise threshold that you want to get. - /// - [DataMember(Name = "noise_threshold_id", IsRequired = true, EmitDefaultValue = false)] - public string NoiseThresholdId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(NoiseThreshold noiseThreshold = default) - { - NoiseThreshold = noiseThreshold; - } - - /// - /// OK - /// - [DataMember(Name = "noise_threshold", IsRequired = false, EmitDefaultValue = false)] - public NoiseThreshold NoiseThreshold { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public NoiseThreshold Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/noise_sensors/noise_thresholds/get", requestOptions) - .EnsureData("/noise_sensors/noise_thresholds/get") - .NoiseThreshold; - } - - /// - /// Returns a specified [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public NoiseThreshold Get(string noiseThresholdId = default) - { - return Get(new GetRequest(noiseThresholdId: noiseThresholdId)); - } - - /// - /// Returns a specified [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/noise_sensors/noise_thresholds/get", - requestOptions - ) - ) - .EnsureData("/noise_sensors/noise_thresholds/get") - .NoiseThreshold; - } - - /// - /// Returns a specified [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task GetAsync(string noiseThresholdId = default) - { - return (await GetAsync(new GetRequest(noiseThresholdId: noiseThresholdId))); - } - - /// - /// Request parameters for List Noise Thresholds. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the device for which you want to list noise thresholds. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List noiseThresholds = default) - { - NoiseThresholds = noiseThresholds; - } - - /// - /// OK - /// - [DataMember(Name = "noise_thresholds", IsRequired = false, EmitDefaultValue = false)] - public List NoiseThresholds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [noise thresholds](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/noise_sensors/noise_thresholds/list", requestOptions) - .EnsureData("/noise_sensors/noise_thresholds/list") - .NoiseThresholds; - } - - /// - /// Returns a list of all [noise thresholds](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public List List(string deviceId = default) - { - return List(new ListRequest(deviceId: deviceId)); - } - - /// - /// Returns a list of all [noise thresholds](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/noise_sensors/noise_thresholds/list", - requestOptions - ) - ) - .EnsureData("/noise_sensors/noise_thresholds/list") - .NoiseThresholds; - } - - /// - /// Returns a list of all [noise thresholds](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task> ListAsync(string deviceId = default) - { - return (await ListAsync(new ListRequest(deviceId: deviceId))); - } - - /// - /// Request parameters for Update a Noise Threshold. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string deviceId = default, - string? endsDailyAt = default, - string? name = default, - float? noiseThresholdDecibels = default, - string noiseThresholdId = default, - float? noiseThresholdNrs = default, - string? startsDailyAt = default - ) - { - DeviceId = deviceId; - EndsDailyAt = endsDailyAt; - Name = name; - NoiseThresholdDecibels = noiseThresholdDecibels; - NoiseThresholdId = noiseThresholdId; - NoiseThresholdNrs = noiseThresholdNrs; - StartsDailyAt = startsDailyAt; - } - - /// - /// ID of the device that contains the noise threshold that you want to update. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Time at which the noise threshold should become inactive daily. - /// - [DataMember(Name = "ends_daily_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsDailyAt { get; set; } - - /// - /// Name of the noise threshold that you want to update. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Noise level in decibels for the noise threshold. - /// - [DataMember( - Name = "noise_threshold_decibels", - IsRequired = false, - EmitDefaultValue = false - )] - public float? NoiseThresholdDecibels { get; set; } - - /// - /// ID of the noise threshold that you want to update. - /// - [DataMember(Name = "noise_threshold_id", IsRequired = true, EmitDefaultValue = false)] - public string NoiseThresholdId { get; set; } - - /// - /// Noise level in Noiseaware Noise Risk Score (NRS) for the noise threshold. This parameter is only relevant for [Noiseaware sensors](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors). - /// - [DataMember(Name = "noise_threshold_nrs", IsRequired = false, EmitDefaultValue = false)] - public float? NoiseThresholdNrs { get; set; } - - /// - /// Time at which the noise threshold should become active daily. - /// - [DataMember(Name = "starts_daily_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsDailyAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/noise_sensors/noise_thresholds/update", requestOptions); - } - - /// - /// Updates a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public void Update( - string deviceId = default, - string? endsDailyAt = default, - string? name = default, - float? noiseThresholdDecibels = default, - string noiseThresholdId = default, - float? noiseThresholdNrs = default, - string? startsDailyAt = default - ) - { - Update( - new UpdateRequest( - deviceId: deviceId, - endsDailyAt: endsDailyAt, - name: name, - noiseThresholdDecibels: noiseThresholdDecibels, - noiseThresholdId: noiseThresholdId, - noiseThresholdNrs: noiseThresholdNrs, - startsDailyAt: startsDailyAt - ) - ); - } - - /// - /// Updates a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/noise_sensors/noise_thresholds/update", requestOptions); - } - - /// - /// Updates a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). - /// - public async Task UpdateAsync( - string deviceId = default, - string? endsDailyAt = default, - string? name = default, - float? noiseThresholdDecibels = default, - string noiseThresholdId = default, - float? noiseThresholdNrs = default, - string? startsDailyAt = default - ) - { - await UpdateAsync( - new UpdateRequest( - deviceId: deviceId, - endsDailyAt: endsDailyAt, - name: name, - noiseThresholdDecibels: noiseThresholdDecibels, - noiseThresholdId: noiseThresholdId, - noiseThresholdNrs: noiseThresholdNrs, - startsDailyAt: startsDailyAt - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.NoiseThresholdsNoiseSensors NoiseThresholdsNoiseSensors => new(this); - } - - public partial interface ISeamClient - { - public Api.NoiseThresholdsNoiseSensors NoiseThresholdsNoiseSensors { get; } - } -} diff --git a/src/Seam/Api/Phones.cs b/src/Seam/Api/Phones.cs deleted file mode 100644 index 215784be..00000000 --- a/src/Seam/Api/Phones.cs +++ /dev/null @@ -1,378 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class Phones - { - private ISeamClient _seam; - - public Phones(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Deactivate a Phone. - /// - [DataContract(Name = "deactivateRequest_request")] - public class DeactivateRequest - { - [JsonConstructorAttribute] - protected DeactivateRequest() { } - - public DeactivateRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// Device ID of the phone that you want to deactivate. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see [App User Lost Phone Process](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity#app-user-lost-phone-process). - /// - public void Deactivate(DeactivateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/phones/deactivate", requestOptions); - } - - /// - /// Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see [App User Lost Phone Process](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity#app-user-lost-phone-process). - /// - public void Deactivate(string deviceId = default) - { - Deactivate(new DeactivateRequest(deviceId: deviceId)); - } - - /// - /// Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see [App User Lost Phone Process](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity#app-user-lost-phone-process). - /// - public async Task DeactivateAsync(DeactivateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/phones/deactivate", requestOptions); - } - - /// - /// Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see [App User Lost Phone Process](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity#app-user-lost-phone-process). - /// - public async Task DeactivateAsync(string deviceId = default) - { - await DeactivateAsync(new DeactivateRequest(deviceId: deviceId)); - } - - /// - /// Request parameters for Get a Phone. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// Device ID of the phone that you want to get. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(Phone phone = default) - { - Phone = phone; - } - - /// - /// OK - /// - [DataMember(Name = "phone", IsRequired = false, EmitDefaultValue = false)] - public Phone Phone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [phone](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). - /// - public Phone Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/phones/get", requestOptions) - .EnsureData("/phones/get") - .Phone; - } - - /// - /// Returns a specified [phone](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). - /// - public Phone Get(string deviceId = default) - { - return Get(new GetRequest(deviceId: deviceId)); - } - - /// - /// Returns a specified [phone](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/phones/get", requestOptions)) - .EnsureData("/phones/get") - .Phone; - } - - /// - /// Returns a specified [phone](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). - /// - public async Task GetAsync(string deviceId = default) - { - return (await GetAsync(new GetRequest(deviceId: deviceId))); - } - - /// - /// Request parameters for List Phones. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? acsCredentialId = default, - string? ownerUserIdentityId = default - ) - { - AcsCredentialId = acsCredentialId; - OwnerUserIdentityId = ownerUserIdentityId; - } - - /// - /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) by which you want to filter the list of returned phones. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialId { get; set; } - - /// - /// ID of the user identity that represents the owner by which you want to filter the list of returned phones. - /// - [DataMember( - Name = "owner_user_identity_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? OwnerUserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List phones = default) - { - Phones = phones; - } - - /// - /// OK - /// - [DataMember(Name = "phones", IsRequired = false, EmitDefaultValue = false)] - public List Phones { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [phones](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). To filter the list of returned phones by a specific owner user identity or credential, include the `owner_user_identity_id` or `acs_credential_id`, respectively, in the request body. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/phones/list", requestOptions) - .EnsureData("/phones/list") - .Phones; - } - - /// - /// Returns a list of all [phones](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). To filter the list of returned phones by a specific owner user identity or credential, include the `owner_user_identity_id` or `acs_credential_id`, respectively, in the request body. - /// - public List List( - string? acsCredentialId = default, - string? ownerUserIdentityId = default - ) - { - return List( - new ListRequest( - acsCredentialId: acsCredentialId, - ownerUserIdentityId: ownerUserIdentityId - ) - ); - } - - /// - /// Returns a list of all [phones](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). To filter the list of returned phones by a specific owner user identity or credential, include the `owner_user_identity_id` or `acs_credential_id`, respectively, in the request body. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/phones/list", requestOptions)) - .EnsureData("/phones/list") - .Phones; - } - - /// - /// Returns a list of all [phones](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). To filter the list of returned phones by a specific owner user identity or credential, include the `owner_user_identity_id` or `acs_credential_id`, respectively, in the request body. - /// - public async Task> ListAsync( - string? acsCredentialId = default, - string? ownerUserIdentityId = default - ) - { - return ( - await ListAsync( - new ListRequest( - acsCredentialId: acsCredentialId, - ownerUserIdentityId: ownerUserIdentityId - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.Phones Phones => new(this); - } - - public partial interface ISeamClient - { - public Api.Phones Phones { get; } - } -} diff --git a/src/Seam/Api/SchedulesThermostats.cs b/src/Seam/Api/SchedulesThermostats.cs deleted file mode 100644 index b16702ab..00000000 --- a/src/Seam/Api/SchedulesThermostats.cs +++ /dev/null @@ -1,762 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SchedulesThermostats - { - private ISeamClient _seam; - - public SchedulesThermostats(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create a Thermostat Schedule. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - string climatePresetKey = default, - string deviceId = default, - string endsAt = default, - bool? isOverrideAllowed = default, - int? maxOverridePeriodMinutes = default, - string? name = default, - string startsAt = default - ) - { - ClimatePresetKey = climatePresetKey; - DeviceId = deviceId; - EndsAt = endsAt; - IsOverrideAllowed = isOverrideAllowed; - MaxOverridePeriodMinutes = maxOverridePeriodMinutes; - Name = name; - StartsAt = startsAt; - } - - /// - /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the new thermostat schedule. - /// - [DataMember(Name = "climate_preset_key", IsRequired = true, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// ID of the thermostat device for which you want to create a schedule. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Date and time at which the new thermostat schedule ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "ends_at", IsRequired = true, EmitDefaultValue = false)] - public string EndsAt { get; set; } - - /// - /// Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the new schedule is active. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [DataMember(Name = "is_override_allowed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOverrideAllowed { get; set; } - - /// - /// Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [DataMember( - Name = "max_override_period_minutes", - IsRequired = false, - EmitDefaultValue = false - )] - public int? MaxOverridePeriodMinutes { get; set; } - - /// - /// Name of the thermostat schedule. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Date and time at which the new thermostat schedule starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = true, EmitDefaultValue = false)] - public string StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(ThermostatSchedule thermostatSchedule = default) - { - ThermostatSchedule = thermostatSchedule; - } - - /// - /// OK - /// - [DataMember(Name = "thermostat_schedule", IsRequired = false, EmitDefaultValue = false)] - public ThermostatSchedule ThermostatSchedule { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public ThermostatSchedule Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/thermostats/schedules/create", requestOptions) - .EnsureData("/thermostats/schedules/create") - .ThermostatSchedule; - } - - /// - /// Creates a new [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public ThermostatSchedule Create( - string climatePresetKey = default, - string deviceId = default, - string endsAt = default, - bool? isOverrideAllowed = default, - int? maxOverridePeriodMinutes = default, - string? name = default, - string startsAt = default - ) - { - return Create( - new CreateRequest( - climatePresetKey: climatePresetKey, - deviceId: deviceId, - endsAt: endsAt, - isOverrideAllowed: isOverrideAllowed, - maxOverridePeriodMinutes: maxOverridePeriodMinutes, - name: name, - startsAt: startsAt - ) - ); - } - - /// - /// Creates a new [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/thermostats/schedules/create", - requestOptions - ) - ) - .EnsureData("/thermostats/schedules/create") - .ThermostatSchedule; - } - - /// - /// Creates a new [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task CreateAsync( - string climatePresetKey = default, - string deviceId = default, - string endsAt = default, - bool? isOverrideAllowed = default, - int? maxOverridePeriodMinutes = default, - string? name = default, - string startsAt = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - climatePresetKey: climatePresetKey, - deviceId: deviceId, - endsAt: endsAt, - isOverrideAllowed: isOverrideAllowed, - maxOverridePeriodMinutes: maxOverridePeriodMinutes, - name: name, - startsAt: startsAt - ) - ) - ); - } - - /// - /// Request parameters for Delete a Thermostat Schedule. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string thermostatScheduleId = default) - { - ThermostatScheduleId = thermostatScheduleId; - } - - /// - /// ID of the thermostat schedule that you want to delete. - /// - [DataMember( - Name = "thermostat_schedule_id", - IsRequired = true, - EmitDefaultValue = false - )] - public string ThermostatScheduleId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/thermostats/schedules/delete", requestOptions); - } - - /// - /// Deletes a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void Delete(string thermostatScheduleId = default) - { - Delete(new DeleteRequest(thermostatScheduleId: thermostatScheduleId)); - } - - /// - /// Deletes a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/thermostats/schedules/delete", requestOptions); - } - - /// - /// Deletes a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task DeleteAsync(string thermostatScheduleId = default) - { - await DeleteAsync(new DeleteRequest(thermostatScheduleId: thermostatScheduleId)); - } - - /// - /// Request parameters for Get a Thermostat Schedule. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string thermostatScheduleId = default) - { - ThermostatScheduleId = thermostatScheduleId; - } - - /// - /// ID of the thermostat schedule that you want to get. - /// - [DataMember( - Name = "thermostat_schedule_id", - IsRequired = true, - EmitDefaultValue = false - )] - public string ThermostatScheduleId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(ThermostatSchedule thermostatSchedule = default) - { - ThermostatSchedule = thermostatSchedule; - } - - /// - /// OK - /// - [DataMember(Name = "thermostat_schedule", IsRequired = false, EmitDefaultValue = false)] - public ThermostatSchedule ThermostatSchedule { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - public ThermostatSchedule Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/thermostats/schedules/get", requestOptions) - .EnsureData("/thermostats/schedules/get") - .ThermostatSchedule; - } - - /// - /// Returns a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - public ThermostatSchedule Get(string thermostatScheduleId = default) - { - return Get(new GetRequest(thermostatScheduleId: thermostatScheduleId)); - } - - /// - /// Returns a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/thermostats/schedules/get", requestOptions)) - .EnsureData("/thermostats/schedules/get") - .ThermostatSchedule; - } - - /// - /// Returns a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - public async Task GetAsync(string thermostatScheduleId = default) - { - return (await GetAsync(new GetRequest(thermostatScheduleId: thermostatScheduleId))); - } - - /// - /// Request parameters for List Thermostat Schedules. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest(string deviceId = default, string? userIdentifierKey = default) - { - DeviceId = deviceId; - UserIdentifierKey = userIdentifierKey; - } - - /// - /// ID of the thermostat device for which you want to list schedules. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// User identifier key by which to filter the list of returned thermostat schedules. - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List thermostatSchedules = default) - { - ThermostatSchedules = thermostatSchedules; - } - - /// - /// OK - /// - [DataMember( - Name = "thermostat_schedules", - IsRequired = false, - EmitDefaultValue = false - )] - public List ThermostatSchedules { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [thermostat schedules](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/thermostats/schedules/list", requestOptions) - .EnsureData("/thermostats/schedules/list") - .ThermostatSchedules; - } - - /// - /// Returns a list of all [thermostat schedules](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public List List( - string deviceId = default, - string? userIdentifierKey = default - ) - { - return List(new ListRequest(deviceId: deviceId, userIdentifierKey: userIdentifierKey)); - } - - /// - /// Returns a list of all [thermostat schedules](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync("/thermostats/schedules/list", requestOptions) - ) - .EnsureData("/thermostats/schedules/list") - .ThermostatSchedules; - } - - /// - /// Returns a list of all [thermostat schedules](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task> ListAsync( - string deviceId = default, - string? userIdentifierKey = default - ) - { - return ( - await ListAsync( - new ListRequest(deviceId: deviceId, userIdentifierKey: userIdentifierKey) - ) - ); - } - - /// - /// Request parameters for Update a Thermostat Schedule. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string? climatePresetKey = default, - string? endsAt = default, - bool? isOverrideAllowed = default, - int? maxOverridePeriodMinutes = default, - string? name = default, - string? startsAt = default, - string thermostatScheduleId = default - ) - { - ClimatePresetKey = climatePresetKey; - EndsAt = endsAt; - IsOverrideAllowed = isOverrideAllowed; - MaxOverridePeriodMinutes = maxOverridePeriodMinutes; - Name = name; - StartsAt = startsAt; - ThermostatScheduleId = thermostatScheduleId; - } - - /// - /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the thermostat schedule. - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string? ClimatePresetKey { get; set; } - - /// - /// Date and time at which the thermostat schedule ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the schedule is active. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [DataMember(Name = "is_override_allowed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOverrideAllowed { get; set; } - - /// - /// Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [DataMember( - Name = "max_override_period_minutes", - IsRequired = false, - EmitDefaultValue = false - )] - public int? MaxOverridePeriodMinutes { get; set; } - - /// - /// Name of the thermostat schedule. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Date and time at which the thermostat schedule starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// ID of the thermostat schedule that you want to update. - /// - [DataMember( - Name = "thermostat_schedule_id", - IsRequired = true, - EmitDefaultValue = false - )] - public string ThermostatScheduleId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/thermostats/schedules/update", requestOptions); - } - - /// - /// Updates a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - public void Update( - string? climatePresetKey = default, - string? endsAt = default, - bool? isOverrideAllowed = default, - int? maxOverridePeriodMinutes = default, - string? name = default, - string? startsAt = default, - string thermostatScheduleId = default - ) - { - Update( - new UpdateRequest( - climatePresetKey: climatePresetKey, - endsAt: endsAt, - isOverrideAllowed: isOverrideAllowed, - maxOverridePeriodMinutes: maxOverridePeriodMinutes, - name: name, - startsAt: startsAt, - thermostatScheduleId: thermostatScheduleId - ) - ); - } - - /// - /// Updates a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/thermostats/schedules/update", requestOptions); - } - - /// - /// Updates a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - public async Task UpdateAsync( - string? climatePresetKey = default, - string? endsAt = default, - bool? isOverrideAllowed = default, - int? maxOverridePeriodMinutes = default, - string? name = default, - string? startsAt = default, - string thermostatScheduleId = default - ) - { - await UpdateAsync( - new UpdateRequest( - climatePresetKey: climatePresetKey, - endsAt: endsAt, - isOverrideAllowed: isOverrideAllowed, - maxOverridePeriodMinutes: maxOverridePeriodMinutes, - name: name, - startsAt: startsAt, - thermostatScheduleId: thermostatScheduleId - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SchedulesThermostats SchedulesThermostats => new(this); - } - - public partial interface ISeamClient - { - public Api.SchedulesThermostats SchedulesThermostats { get; } - } -} diff --git a/src/Seam/Api/SimulateAccessCodes.cs b/src/Seam/Api/SimulateAccessCodes.cs deleted file mode 100644 index 69e82178..00000000 --- a/src/Seam/Api/SimulateAccessCodes.cs +++ /dev/null @@ -1,196 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SimulateAccessCodes - { - private ISeamClient _seam; - - public SimulateAccessCodes(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Simulate Creating an Unmanaged Access Code. - /// - [DataContract(Name = "createUnmanagedAccessCodeRequest_request")] - public class CreateUnmanagedAccessCodeRequest - { - [JsonConstructorAttribute] - protected CreateUnmanagedAccessCodeRequest() { } - - public CreateUnmanagedAccessCodeRequest( - string code = default, - string deviceId = default, - string name = default - ) - { - Code = code; - DeviceId = deviceId; - Name = name; - } - - /// - /// Code of the simulated unmanaged access code. - /// - [DataMember(Name = "code", IsRequired = true, EmitDefaultValue = false)] - public string Code { get; set; } - - /// - /// ID of the device for which you want to simulate the creation of an unmanaged access code. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Name of the simulated unmanaged access code. - /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] - public string Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createUnmanagedAccessCodeResponse_response")] - public class CreateUnmanagedAccessCodeResponse - { - [JsonConstructorAttribute] - protected CreateUnmanagedAccessCodeResponse() { } - - public CreateUnmanagedAccessCodeResponse(UnmanagedAccessCode accessCode = default) - { - AccessCode = accessCode; - } - - /// - /// OK - /// - [DataMember(Name = "access_code", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessCode AccessCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates the creation of an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public UnmanagedAccessCode CreateUnmanagedAccessCode( - CreateUnmanagedAccessCodeRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post( - "/access_codes/simulate/create_unmanaged_access_code", - requestOptions - ) - .EnsureData("/access_codes/simulate/create_unmanaged_access_code") - .AccessCode; - } - - /// - /// Simulates the creation of an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public UnmanagedAccessCode CreateUnmanagedAccessCode( - string code = default, - string deviceId = default, - string name = default - ) - { - return CreateUnmanagedAccessCode( - new CreateUnmanagedAccessCodeRequest(code: code, deviceId: deviceId, name: name) - ); - } - - /// - /// Simulates the creation of an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task CreateUnmanagedAccessCodeAsync( - CreateUnmanagedAccessCodeRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/access_codes/simulate/create_unmanaged_access_code", - requestOptions - ) - ) - .EnsureData("/access_codes/simulate/create_unmanaged_access_code") - .AccessCode; - } - - /// - /// Simulates the creation of an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task CreateUnmanagedAccessCodeAsync( - string code = default, - string deviceId = default, - string name = default - ) - { - return ( - await CreateUnmanagedAccessCodeAsync( - new CreateUnmanagedAccessCodeRequest(code: code, deviceId: deviceId, name: name) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SimulateAccessCodes SimulateAccessCodes => new(this); - } - - public partial interface ISeamClient - { - public Api.SimulateAccessCodes SimulateAccessCodes { get; } - } -} diff --git a/src/Seam/Api/SimulateConnectedAccounts.cs b/src/Seam/Api/SimulateConnectedAccounts.cs deleted file mode 100644 index 6c562cfb..00000000 --- a/src/Seam/Api/SimulateConnectedAccounts.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SimulateConnectedAccounts - { - private ISeamClient _seam; - - public SimulateConnectedAccounts(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Simulate Connected Account Disconnection. - /// - [DataContract(Name = "disconnectRequest_request")] - public class DisconnectRequest - { - [JsonConstructorAttribute] - protected DisconnectRequest() { } - - public DisconnectRequest(string connectedAccountId = default) - { - ConnectedAccountId = connectedAccountId; - } - - /// - /// ID of the connected account you want to simulate as disconnected. - /// - [DataMember(Name = "connected_account_id", IsRequired = true, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates a connected account becoming disconnected from Seam. Only applicable for [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void Disconnect(DisconnectRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/connected_accounts/simulate/disconnect", requestOptions); - } - - /// - /// Simulates a connected account becoming disconnected from Seam. Only applicable for [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void Disconnect(string connectedAccountId = default) - { - Disconnect(new DisconnectRequest(connectedAccountId: connectedAccountId)); - } - - /// - /// Simulates a connected account becoming disconnected from Seam. Only applicable for [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task DisconnectAsync(DisconnectRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/connected_accounts/simulate/disconnect", - requestOptions - ); - } - - /// - /// Simulates a connected account becoming disconnected from Seam. Only applicable for [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task DisconnectAsync(string connectedAccountId = default) - { - await DisconnectAsync(new DisconnectRequest(connectedAccountId: connectedAccountId)); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SimulateConnectedAccounts SimulateConnectedAccounts => new(this); - } - - public partial interface ISeamClient - { - public Api.SimulateConnectedAccounts SimulateConnectedAccounts { get; } - } -} diff --git a/src/Seam/Api/SimulateDevices.cs b/src/Seam/Api/SimulateDevices.cs deleted file mode 100644 index 7fd87cf4..00000000 --- a/src/Seam/Api/SimulateDevices.cs +++ /dev/null @@ -1,529 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SimulateDevices - { - private ISeamClient _seam; - - public SimulateDevices(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Simulate Device Connection. - /// - [DataContract(Name = "connectRequest_request")] - public class ConnectRequest - { - [JsonConstructorAttribute] - protected ConnectRequest() { } - - public ConnectRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the device that you want to simulate connecting to Seam. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates connecting a device to Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public void Connect(ConnectRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/devices/simulate/connect", requestOptions); - } - - /// - /// Simulates connecting a device to Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public void Connect(string deviceId = default) - { - Connect(new ConnectRequest(deviceId: deviceId)); - } - - /// - /// Simulates connecting a device to Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public async Task ConnectAsync(ConnectRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/devices/simulate/connect", requestOptions); - } - - /// - /// Simulates connecting a device to Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public async Task ConnectAsync(string deviceId = default) - { - await ConnectAsync(new ConnectRequest(deviceId: deviceId)); - } - - /// - /// Request parameters for Simulate Hub Connection. - /// - [DataContract(Name = "connectToHubRequest_request")] - public class ConnectToHubRequest - { - [JsonConstructorAttribute] - protected ConnectToHubRequest() { } - - public ConnectToHubRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the device whose hub you want to reconnect. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates bringing the Wi‑Fi hub (bridge) back online for a device. - /// Only applicable for sandbox workspaces and currently - /// implemented for August and TTLock locks. - /// This will clear the `hub_disconnected` error on the device. - /// - public void ConnectToHub(ConnectToHubRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/devices/simulate/connect_to_hub", requestOptions); - } - - /// - /// Simulates bringing the Wi‑Fi hub (bridge) back online for a device. - /// Only applicable for sandbox workspaces and currently - /// implemented for August and TTLock locks. - /// This will clear the `hub_disconnected` error on the device. - /// - public void ConnectToHub(string deviceId = default) - { - ConnectToHub(new ConnectToHubRequest(deviceId: deviceId)); - } - - /// - /// Simulates bringing the Wi‑Fi hub (bridge) back online for a device. - /// Only applicable for sandbox workspaces and currently - /// implemented for August and TTLock locks. - /// This will clear the `hub_disconnected` error on the device. - /// - public async Task ConnectToHubAsync(ConnectToHubRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/devices/simulate/connect_to_hub", requestOptions); - } - - /// - /// Simulates bringing the Wi‑Fi hub (bridge) back online for a device. - /// Only applicable for sandbox workspaces and currently - /// implemented for August and TTLock locks. - /// This will clear the `hub_disconnected` error on the device. - /// - public async Task ConnectToHubAsync(string deviceId = default) - { - await ConnectToHubAsync(new ConnectToHubRequest(deviceId: deviceId)); - } - - /// - /// Request parameters for Simulate Device Disconnection. - /// - [DataContract(Name = "disconnectRequest_request")] - public class DisconnectRequest - { - [JsonConstructorAttribute] - protected DisconnectRequest() { } - - public DisconnectRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the device that you want to simulate disconnecting from Seam. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates disconnecting a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public void Disconnect(DisconnectRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/devices/simulate/disconnect", requestOptions); - } - - /// - /// Simulates disconnecting a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public void Disconnect(string deviceId = default) - { - Disconnect(new DisconnectRequest(deviceId: deviceId)); - } - - /// - /// Simulates disconnecting a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public async Task DisconnectAsync(DisconnectRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/devices/simulate/disconnect", requestOptions); - } - - /// - /// Simulates disconnecting a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public async Task DisconnectAsync(string deviceId = default) - { - await DisconnectAsync(new DisconnectRequest(deviceId: deviceId)); - } - - /// - /// Request parameters for Simulate Hub Disconnection. - /// - [DataContract(Name = "disconnectFromHubRequest_request")] - public class DisconnectFromHubRequest - { - [JsonConstructorAttribute] - protected DisconnectFromHubRequest() { } - - public DisconnectFromHubRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the device whose hub you want to disconnect. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates taking the Wi‑Fi hub (bridge) offline for a device. - /// Only applicable for sandbox workspaces and currently - /// implemented for August, TTLock, and IglooHome devices. - /// This will set the `hub_disconnected` error on the device, or mark the - /// IglooHome bridge offline in sandbox. - /// - public void DisconnectFromHub(DisconnectFromHubRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/devices/simulate/disconnect_from_hub", requestOptions); - } - - /// - /// Simulates taking the Wi‑Fi hub (bridge) offline for a device. - /// Only applicable for sandbox workspaces and currently - /// implemented for August, TTLock, and IglooHome devices. - /// This will set the `hub_disconnected` error on the device, or mark the - /// IglooHome bridge offline in sandbox. - /// - public void DisconnectFromHub(string deviceId = default) - { - DisconnectFromHub(new DisconnectFromHubRequest(deviceId: deviceId)); - } - - /// - /// Simulates taking the Wi‑Fi hub (bridge) offline for a device. - /// Only applicable for sandbox workspaces and currently - /// implemented for August, TTLock, and IglooHome devices. - /// This will set the `hub_disconnected` error on the device, or mark the - /// IglooHome bridge offline in sandbox. - /// - public async Task DisconnectFromHubAsync(DisconnectFromHubRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/devices/simulate/disconnect_from_hub", requestOptions); - } - - /// - /// Simulates taking the Wi‑Fi hub (bridge) offline for a device. - /// Only applicable for sandbox workspaces and currently - /// implemented for August, TTLock, and IglooHome devices. - /// This will set the `hub_disconnected` error on the device, or mark the - /// IglooHome bridge offline in sandbox. - /// - public async Task DisconnectFromHubAsync(string deviceId = default) - { - await DisconnectFromHubAsync(new DisconnectFromHubRequest(deviceId: deviceId)); - } - - /// - /// Request parameters for Simulate Paid Subscription. - /// - [DataContract(Name = "paidSubscriptionRequest_request")] - public class PaidSubscriptionRequest - { - [JsonConstructorAttribute] - protected PaidSubscriptionRequest() { } - - public PaidSubscriptionRequest(string deviceId = default, bool isExpired = default) - { - DeviceId = deviceId; - IsExpired = isExpired; - } - - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - [DataMember(Name = "is_expired", IsRequired = true, EmitDefaultValue = false)] - public bool IsExpired { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only). - /// Send `is_expired: true` to simulate an expired subscription, or `false` to simulate an active subscription. - /// The actual device error is created/cleared by the poller after this state change. - /// - public void PaidSubscription(PaidSubscriptionRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/devices/simulate/paid_subscription", requestOptions); - } - - /// - /// Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only). - /// Send `is_expired: true` to simulate an expired subscription, or `false` to simulate an active subscription. - /// The actual device error is created/cleared by the poller after this state change. - /// - public void PaidSubscription(string deviceId = default, bool isExpired = default) - { - PaidSubscription(new PaidSubscriptionRequest(deviceId: deviceId, isExpired: isExpired)); - } - - /// - /// Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only). - /// Send `is_expired: true` to simulate an expired subscription, or `false` to simulate an active subscription. - /// The actual device error is created/cleared by the poller after this state change. - /// - public async Task PaidSubscriptionAsync(PaidSubscriptionRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/devices/simulate/paid_subscription", requestOptions); - } - - /// - /// Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only). - /// Send `is_expired: true` to simulate an expired subscription, or `false` to simulate an active subscription. - /// The actual device error is created/cleared by the poller after this state change. - /// - public async Task PaidSubscriptionAsync(string deviceId = default, bool isExpired = default) - { - await PaidSubscriptionAsync( - new PaidSubscriptionRequest(deviceId: deviceId, isExpired: isExpired) - ); - } - - /// - /// Request parameters for Simulate Device Removal. - /// - [DataContract(Name = "removeRequest_request")] - public class RemoveRequest - { - [JsonConstructorAttribute] - protected RemoveRequest() { } - - public RemoveRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the device that you want to simulate removing from Seam. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates removing a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public void Remove(RemoveRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/devices/simulate/remove", requestOptions); - } - - /// - /// Simulates removing a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public void Remove(string deviceId = default) - { - Remove(new RemoveRequest(deviceId: deviceId)); - } - - /// - /// Simulates removing a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public async Task RemoveAsync(RemoveRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/devices/simulate/remove", requestOptions); - } - - /// - /// Simulates removing a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). - /// - public async Task RemoveAsync(string deviceId = default) - { - await RemoveAsync(new RemoveRequest(deviceId: deviceId)); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SimulateDevices SimulateDevices => new(this); - } - - public partial interface ISeamClient - { - public Api.SimulateDevices SimulateDevices { get; } - } -} diff --git a/src/Seam/Api/SimulateEncodersAcs.cs b/src/Seam/Api/SimulateEncodersAcs.cs deleted file mode 100644 index efe13606..00000000 --- a/src/Seam/Api/SimulateEncodersAcs.cs +++ /dev/null @@ -1,583 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SimulateEncodersAcs - { - private ISeamClient _seam; - - public SimulateEncodersAcs(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Simulate that the Next Credential Encoding Will Fail. - /// - [DataContract(Name = "nextCredentialEncodeWillFailRequest_request")] - public class NextCredentialEncodeWillFailRequest - { - [JsonConstructorAttribute] - protected NextCredentialEncodeWillFailRequest() { } - - public NextCredentialEncodeWillFailRequest( - string acsEncoderId = default, - NextCredentialEncodeWillFailRequest.ErrorCodeEnum? errorCode = default, - string? acsCredentialId = default - ) - { - AcsEncoderId = acsEncoderId; - ErrorCode = errorCode; - AcsCredentialId = acsCredentialId; - } - - /// - /// Code of the error to simulate. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ErrorCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "no_credential_on_encoder")] - NoCredentialOnEncoder = 1, - - [EnumMember(Value = "encoding_interrupted")] - EncodingInterrupted = 2, - - [EnumMember(Value = "uncategorized_error")] - UncategorizedError = 3, - - [EnumMember(Value = "action_attempt_expired")] - ActionAttemptExpired = 4, - } - - /// - /// ID of the `acs_encoder` that will be used in the next request to encode the `acs_credential`. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - /// - /// Code of the error to simulate. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public NextCredentialEncodeWillFailRequest.ErrorCodeEnum? ErrorCode { get; set; } - - /// - /// ID of the `acs_credential` that will fail to be encoded onto a card in the next request. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void NextCredentialEncodeWillFail(NextCredentialEncodeWillFailRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post( - "/acs/encoders/simulate/next_credential_encode_will_fail", - requestOptions - ); - } - - /// - /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void NextCredentialEncodeWillFail( - string acsEncoderId = default, - NextCredentialEncodeWillFailRequest.ErrorCodeEnum? errorCode = default, - string? acsCredentialId = default - ) - { - NextCredentialEncodeWillFail( - new NextCredentialEncodeWillFailRequest( - acsEncoderId: acsEncoderId, - errorCode: errorCode, - acsCredentialId: acsCredentialId - ) - ); - } - - /// - /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task NextCredentialEncodeWillFailAsync( - NextCredentialEncodeWillFailRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/acs/encoders/simulate/next_credential_encode_will_fail", - requestOptions - ); - } - - /// - /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task NextCredentialEncodeWillFailAsync( - string acsEncoderId = default, - NextCredentialEncodeWillFailRequest.ErrorCodeEnum? errorCode = default, - string? acsCredentialId = default - ) - { - await NextCredentialEncodeWillFailAsync( - new NextCredentialEncodeWillFailRequest( - acsEncoderId: acsEncoderId, - errorCode: errorCode, - acsCredentialId: acsCredentialId - ) - ); - } - - /// - /// Request parameters for Simulate that the Next Credential Encoding Will Succeed. - /// - [DataContract(Name = "nextCredentialEncodeWillSucceedRequest_request")] - public class NextCredentialEncodeWillSucceedRequest - { - [JsonConstructorAttribute] - protected NextCredentialEncodeWillSucceedRequest() { } - - public NextCredentialEncodeWillSucceedRequest( - string acsEncoderId = default, - NextCredentialEncodeWillSucceedRequest.ScenarioEnum? scenario = default - ) - { - AcsEncoderId = acsEncoderId; - Scenario = scenario; - } - - /// - /// Scenario to simulate. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ScenarioEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "credential_is_issued")] - CredentialIsIssued = 1, - } - - /// - /// ID of the `acs_encoder` that will be used in the next request to encode the `acs_credential`. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - /// - /// Scenario to simulate. - /// - [DataMember(Name = "scenario", IsRequired = false, EmitDefaultValue = false)] - public NextCredentialEncodeWillSucceedRequest.ScenarioEnum? Scenario { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void NextCredentialEncodeWillSucceed(NextCredentialEncodeWillSucceedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post( - "/acs/encoders/simulate/next_credential_encode_will_succeed", - requestOptions - ); - } - - /// - /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void NextCredentialEncodeWillSucceed( - string acsEncoderId = default, - NextCredentialEncodeWillSucceedRequest.ScenarioEnum? scenario = default - ) - { - NextCredentialEncodeWillSucceed( - new NextCredentialEncodeWillSucceedRequest( - acsEncoderId: acsEncoderId, - scenario: scenario - ) - ); - } - - /// - /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task NextCredentialEncodeWillSucceedAsync( - NextCredentialEncodeWillSucceedRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/acs/encoders/simulate/next_credential_encode_will_succeed", - requestOptions - ); - } - - /// - /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task NextCredentialEncodeWillSucceedAsync( - string acsEncoderId = default, - NextCredentialEncodeWillSucceedRequest.ScenarioEnum? scenario = default - ) - { - await NextCredentialEncodeWillSucceedAsync( - new NextCredentialEncodeWillSucceedRequest( - acsEncoderId: acsEncoderId, - scenario: scenario - ) - ); - } - - /// - /// Request parameters for Simulate that the Next Credential Scan Will Fail. - /// - [DataContract(Name = "nextCredentialScanWillFailRequest_request")] - public class NextCredentialScanWillFailRequest - { - [JsonConstructorAttribute] - protected NextCredentialScanWillFailRequest() { } - - public NextCredentialScanWillFailRequest( - string acsEncoderId = default, - NextCredentialScanWillFailRequest.ErrorCodeEnum? errorCode = default, - string? acsCredentialIdOnSeam = default - ) - { - AcsEncoderId = acsEncoderId; - ErrorCode = errorCode; - AcsCredentialIdOnSeam = acsCredentialIdOnSeam; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ErrorCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "no_credential_on_encoder")] - NoCredentialOnEncoder = 1, - - [EnumMember(Value = "uncategorized_error")] - UncategorizedError = 2, - - [EnumMember(Value = "action_attempt_expired")] - ActionAttemptExpired = 3, - } - - /// - /// ID of the `acs_encoder` that will fail to scan the `acs_credential` in the next request. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public NextCredentialScanWillFailRequest.ErrorCodeEnum? ErrorCode { get; set; } - - [DataMember( - Name = "acs_credential_id_on_seam", - IsRequired = false, - EmitDefaultValue = false - )] - public string? AcsCredentialIdOnSeam { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void NextCredentialScanWillFail(NextCredentialScanWillFailRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post( - "/acs/encoders/simulate/next_credential_scan_will_fail", - requestOptions - ); - } - - /// - /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void NextCredentialScanWillFail( - string acsEncoderId = default, - NextCredentialScanWillFailRequest.ErrorCodeEnum? errorCode = default, - string? acsCredentialIdOnSeam = default - ) - { - NextCredentialScanWillFail( - new NextCredentialScanWillFailRequest( - acsEncoderId: acsEncoderId, - errorCode: errorCode, - acsCredentialIdOnSeam: acsCredentialIdOnSeam - ) - ); - } - - /// - /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task NextCredentialScanWillFailAsync(NextCredentialScanWillFailRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/acs/encoders/simulate/next_credential_scan_will_fail", - requestOptions - ); - } - - /// - /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task NextCredentialScanWillFailAsync( - string acsEncoderId = default, - NextCredentialScanWillFailRequest.ErrorCodeEnum? errorCode = default, - string? acsCredentialIdOnSeam = default - ) - { - await NextCredentialScanWillFailAsync( - new NextCredentialScanWillFailRequest( - acsEncoderId: acsEncoderId, - errorCode: errorCode, - acsCredentialIdOnSeam: acsCredentialIdOnSeam - ) - ); - } - - /// - /// Request parameters for Simulate that the Next Credential Scan Will Succeed. - /// - [DataContract(Name = "nextCredentialScanWillSucceedRequest_request")] - public class NextCredentialScanWillSucceedRequest - { - [JsonConstructorAttribute] - protected NextCredentialScanWillSucceedRequest() { } - - public NextCredentialScanWillSucceedRequest( - string? acsCredentialIdOnSeam = default, - string acsEncoderId = default, - NextCredentialScanWillSucceedRequest.ScenarioEnum? scenario = default - ) - { - AcsCredentialIdOnSeam = acsCredentialIdOnSeam; - AcsEncoderId = acsEncoderId; - Scenario = scenario; - } - - /// - /// Scenario to simulate. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ScenarioEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "credential_exists_on_seam")] - CredentialExistsOnSeam = 1, - - [EnumMember(Value = "credential_on_encoder_needs_update")] - CredentialOnEncoderNeedsUpdate = 2, - - [EnumMember(Value = "credential_does_not_exist_on_seam")] - CredentialDoesNotExistOnSeam = 3, - - [EnumMember(Value = "credential_on_encoder_is_empty")] - CredentialOnEncoderIsEmpty = 4, - } - - /// - /// ID of the Seam `acs_credential` that matches the `acs_credential` on the encoder in this simulation. - /// - [DataMember( - Name = "acs_credential_id_on_seam", - IsRequired = false, - EmitDefaultValue = false - )] - public string? AcsCredentialIdOnSeam { get; set; } - - /// - /// ID of the `acs_encoder` that will be used in the next request to scan the `acs_credential`. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - /// - /// Scenario to simulate. - /// - [DataMember(Name = "scenario", IsRequired = false, EmitDefaultValue = false)] - public NextCredentialScanWillSucceedRequest.ScenarioEnum? Scenario { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void NextCredentialScanWillSucceed(NextCredentialScanWillSucceedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post( - "/acs/encoders/simulate/next_credential_scan_will_succeed", - requestOptions - ); - } - - /// - /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void NextCredentialScanWillSucceed( - string? acsCredentialIdOnSeam = default, - string acsEncoderId = default, - NextCredentialScanWillSucceedRequest.ScenarioEnum? scenario = default - ) - { - NextCredentialScanWillSucceed( - new NextCredentialScanWillSucceedRequest( - acsCredentialIdOnSeam: acsCredentialIdOnSeam, - acsEncoderId: acsEncoderId, - scenario: scenario - ) - ); - } - - /// - /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task NextCredentialScanWillSucceedAsync( - NextCredentialScanWillSucceedRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/acs/encoders/simulate/next_credential_scan_will_succeed", - requestOptions - ); - } - - /// - /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task NextCredentialScanWillSucceedAsync( - string? acsCredentialIdOnSeam = default, - string acsEncoderId = default, - NextCredentialScanWillSucceedRequest.ScenarioEnum? scenario = default - ) - { - await NextCredentialScanWillSucceedAsync( - new NextCredentialScanWillSucceedRequest( - acsCredentialIdOnSeam: acsCredentialIdOnSeam, - acsEncoderId: acsEncoderId, - scenario: scenario - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SimulateEncodersAcs SimulateEncodersAcs => new(this); - } - - public partial interface ISeamClient - { - public Api.SimulateEncodersAcs SimulateEncodersAcs { get; } - } -} diff --git a/src/Seam/Api/SimulateLocks.cs b/src/Seam/Api/SimulateLocks.cs deleted file mode 100644 index 6178d28c..00000000 --- a/src/Seam/Api/SimulateLocks.cs +++ /dev/null @@ -1,301 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SimulateLocks - { - private ISeamClient _seam; - - public SimulateLocks(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Simulate a Keypad Code Entry. - /// - [DataContract(Name = "keypadCodeEntryRequest_request")] - public class KeypadCodeEntryRequest - { - [JsonConstructorAttribute] - protected KeypadCodeEntryRequest() { } - - public KeypadCodeEntryRequest(string code = default, string deviceId = default) - { - Code = code; - DeviceId = deviceId; - } - - /// - /// Code that you want to simulate entering on a keypad. - /// - [DataMember(Name = "code", IsRequired = true, EmitDefaultValue = false)] - public string Code { get; set; } - - /// - /// ID of the device for which you want to simulate a keypad code entry. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "keypadCodeEntryResponse_response")] - public class KeypadCodeEntryResponse - { - [JsonConstructorAttribute] - protected KeypadCodeEntryResponse() { } - - public KeypadCodeEntryResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates the entry of a code on a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public ActionAttempt KeypadCodeEntry(KeypadCodeEntryRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/locks/simulate/keypad_code_entry", requestOptions) - .EnsureData("/locks/simulate/keypad_code_entry") - .ActionAttempt; - } - - /// - /// Simulates the entry of a code on a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public ActionAttempt KeypadCodeEntry(string code = default, string deviceId = default) - { - return KeypadCodeEntry(new KeypadCodeEntryRequest(code: code, deviceId: deviceId)); - } - - /// - /// Simulates the entry of a code on a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task KeypadCodeEntryAsync(KeypadCodeEntryRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/locks/simulate/keypad_code_entry", - requestOptions - ) - ) - .EnsureData("/locks/simulate/keypad_code_entry") - .ActionAttempt; - } - - /// - /// Simulates the entry of a code on a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task KeypadCodeEntryAsync( - string code = default, - string deviceId = default - ) - { - return ( - await KeypadCodeEntryAsync( - new KeypadCodeEntryRequest(code: code, deviceId: deviceId) - ) - ); - } - - /// - /// Request parameters for Simulate a Manual Lock Action Using a Keypad. - /// - [DataContract(Name = "manualLockViaKeypadRequest_request")] - public class ManualLockViaKeypadRequest - { - [JsonConstructorAttribute] - protected ManualLockViaKeypadRequest() { } - - public ManualLockViaKeypadRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the device for which you want to simulate a manual lock action using a keypad. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "manualLockViaKeypadResponse_response")] - public class ManualLockViaKeypadResponse - { - [JsonConstructorAttribute] - protected ManualLockViaKeypadResponse() { } - - public ManualLockViaKeypadResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates a manual lock action using a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public ActionAttempt ManualLockViaKeypad(ManualLockViaKeypadRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post( - "/locks/simulate/manual_lock_via_keypad", - requestOptions - ) - .EnsureData("/locks/simulate/manual_lock_via_keypad") - .ActionAttempt; - } - - /// - /// Simulates a manual lock action using a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public ActionAttempt ManualLockViaKeypad(string deviceId = default) - { - return ManualLockViaKeypad(new ManualLockViaKeypadRequest(deviceId: deviceId)); - } - - /// - /// Simulates a manual lock action using a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task ManualLockViaKeypadAsync( - ManualLockViaKeypadRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/locks/simulate/manual_lock_via_keypad", - requestOptions - ) - ) - .EnsureData("/locks/simulate/manual_lock_via_keypad") - .ActionAttempt; - } - - /// - /// Simulates a manual lock action using a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task ManualLockViaKeypadAsync(string deviceId = default) - { - return ( - await ManualLockViaKeypadAsync(new ManualLockViaKeypadRequest(deviceId: deviceId)) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SimulateLocks SimulateLocks => new(this); - } - - public partial interface ISeamClient - { - public Api.SimulateLocks SimulateLocks { get; } - } -} diff --git a/src/Seam/Api/SimulateNoiseSensors.cs b/src/Seam/Api/SimulateNoiseSensors.cs deleted file mode 100644 index 63303c99..00000000 --- a/src/Seam/Api/SimulateNoiseSensors.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SimulateNoiseSensors - { - private ISeamClient _seam; - - public SimulateNoiseSensors(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Simulate Triggering a Noise Threshold. - /// - [DataContract(Name = "triggerNoiseThresholdRequest_request")] - public class TriggerNoiseThresholdRequest - { - [JsonConstructorAttribute] - protected TriggerNoiseThresholdRequest() { } - - public TriggerNoiseThresholdRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the device for which you want to simulate the triggering of a noise threshold. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates the triggering of a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void TriggerNoiseThreshold(TriggerNoiseThresholdRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/noise_sensors/simulate/trigger_noise_threshold", requestOptions); - } - - /// - /// Simulates the triggering of a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public void TriggerNoiseThreshold(string deviceId = default) - { - TriggerNoiseThreshold(new TriggerNoiseThresholdRequest(deviceId: deviceId)); - } - - /// - /// Simulates the triggering of a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task TriggerNoiseThresholdAsync(TriggerNoiseThresholdRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/noise_sensors/simulate/trigger_noise_threshold", - requestOptions - ); - } - - /// - /// Simulates the triggering of a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - public async Task TriggerNoiseThresholdAsync(string deviceId = default) - { - await TriggerNoiseThresholdAsync(new TriggerNoiseThresholdRequest(deviceId: deviceId)); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SimulateNoiseSensors SimulateNoiseSensors => new(this); - } - - public partial interface ISeamClient - { - public Api.SimulateNoiseSensors SimulateNoiseSensors { get; } - } -} diff --git a/src/Seam/Api/SimulatePhones.cs b/src/Seam/Api/SimulatePhones.cs deleted file mode 100644 index 3c19dba5..00000000 --- a/src/Seam/Api/SimulatePhones.cs +++ /dev/null @@ -1,379 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SimulatePhones - { - private ISeamClient _seam; - - public SimulatePhones(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create a Sandbox Phone. - /// - [DataContract(Name = "createSandboxPhoneRequest_request")] - public class CreateSandboxPhoneRequest - { - [JsonConstructorAttribute] - protected CreateSandboxPhoneRequest() { } - - public CreateSandboxPhoneRequest( - CreateSandboxPhoneRequestAssaAbloyMetadata? assaAbloyMetadata = default, - string? customSdkInstallationId = default, - CreateSandboxPhoneRequestPhoneMetadata? phoneMetadata = default, - string userIdentityId = default - ) - { - AssaAbloyMetadata = assaAbloyMetadata; - CustomSdkInstallationId = customSdkInstallationId; - PhoneMetadata = phoneMetadata; - UserIdentityId = userIdentityId; - } - - /// - /// ASSA ABLOY metadata that you want to associate with the simulated phone. - /// - [DataMember(Name = "assa_abloy_metadata", IsRequired = false, EmitDefaultValue = false)] - public CreateSandboxPhoneRequestAssaAbloyMetadata? AssaAbloyMetadata { get; set; } - - /// - /// ID of the custom SDK installation that you want to use for the simulated phone. - /// - [DataMember( - Name = "custom_sdk_installation_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomSdkInstallationId { get; set; } - - /// - /// Metadata that you want to associate with the simulated phone. - /// - [DataMember(Name = "phone_metadata", IsRequired = false, EmitDefaultValue = false)] - public CreateSandboxPhoneRequestPhoneMetadata? PhoneMetadata { get; set; } - - /// - /// ID of the user identity that you want to associate with the simulated phone. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createSandboxPhoneRequestAssaAbloyMetadata_model")] - public class CreateSandboxPhoneRequestAssaAbloyMetadata - { - [JsonConstructorAttribute] - protected CreateSandboxPhoneRequestAssaAbloyMetadata() { } - - public CreateSandboxPhoneRequestAssaAbloyMetadata( - string? applicationVersion = default, - bool? bleCapability = default, - bool? hceCapability = default, - bool? nfcCapability = default, - string? seosAppletVersion = default, - float? seosTsmEndpointId = default - ) - { - ApplicationVersion = applicationVersion; - BleCapability = bleCapability; - HceCapability = hceCapability; - NfcCapability = nfcCapability; - SeosAppletVersion = seosAppletVersion; - SeosTsmEndpointId = seosTsmEndpointId; - } - - /// - /// Application version that you want to use for the simulated phone. - /// - [DataMember(Name = "application_version", IsRequired = false, EmitDefaultValue = false)] - public string? ApplicationVersion { get; set; } - - /// - /// Indicates whether the simulated phone should have Bluetooth low energy (BLE) capability. - /// - [DataMember(Name = "ble_capability", IsRequired = false, EmitDefaultValue = false)] - public bool? BleCapability { get; set; } - - /// - /// Indicates whether the simulated phone should have host card emulation (HCE) capability. - /// - [DataMember(Name = "hce_capability", IsRequired = false, EmitDefaultValue = false)] - public bool? HceCapability { get; set; } - - /// - /// Indicates whether the simulated phone should have near-field communication (NFC) capability. - /// - [DataMember(Name = "nfc_capability", IsRequired = false, EmitDefaultValue = false)] - public bool? NfcCapability { get; set; } - - /// - /// SEOS applet version that you want to use for the simulated phone. - /// - [DataMember(Name = "seos_applet_version", IsRequired = false, EmitDefaultValue = false)] - public string? SeosAppletVersion { get; set; } - - /// - /// ID of the SEOS trusted service manager (TSM) endpoint that you want to use for the simulated phone. - /// - [DataMember( - Name = "seos_tsm_endpoint_id", - IsRequired = false, - EmitDefaultValue = false - )] - public float? SeosTsmEndpointId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createSandboxPhoneRequestPhoneMetadata_model")] - public class CreateSandboxPhoneRequestPhoneMetadata - { - [JsonConstructorAttribute] - protected CreateSandboxPhoneRequestPhoneMetadata() { } - - public CreateSandboxPhoneRequestPhoneMetadata( - string? deviceManufacturer = default, - string? deviceModel = default, - CreateSandboxPhoneRequestPhoneMetadata.OperatingSystemEnum? operatingSystem = - default, - string? osVersion = default - ) - { - DeviceManufacturer = deviceManufacturer; - DeviceModel = deviceModel; - OperatingSystem = operatingSystem; - OsVersion = osVersion; - } - - /// - /// Mobile operating system that you want to use for the simulated phone. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum OperatingSystemEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "android")] - Android = 1, - - [EnumMember(Value = "ios")] - Ios = 2, - } - - /// - /// Manufacturer that you want to use for the simulated phone. - /// - [DataMember(Name = "device_manufacturer", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceManufacturer { get; set; } - - /// - /// Device model that you want to use for the simulated phone. - /// - [DataMember(Name = "device_model", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceModel { get; set; } - - /// - /// Mobile operating system that you want to use for the simulated phone. - /// - [DataMember(Name = "operating_system", IsRequired = false, EmitDefaultValue = false)] - public CreateSandboxPhoneRequestPhoneMetadata.OperatingSystemEnum? OperatingSystem { get; set; } - - /// - /// Mobile operating system version that you want to use for the simulated phone. - /// - [DataMember(Name = "os_version", IsRequired = false, EmitDefaultValue = false)] - public string? OsVersion { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createSandboxPhoneResponse_response")] - public class CreateSandboxPhoneResponse - { - [JsonConstructorAttribute] - protected CreateSandboxPhoneResponse() { } - - public CreateSandboxPhoneResponse(Phone phone = default) - { - Phone = phone; - } - - /// - /// OK - /// - [DataMember(Name = "phone", IsRequired = false, EmitDefaultValue = false)] - public Phone Phone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new simulated phone in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Creating a Simulated Phone for a User Identity](https://docs.seam.co/capability-guides/mobile-access/developing-in-a-sandbox-workspace#creating-a-simulated-phone-for-a-user-identity). - /// - public Phone CreateSandboxPhone(CreateSandboxPhoneRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post( - "/phones/simulate/create_sandbox_phone", - requestOptions - ) - .EnsureData("/phones/simulate/create_sandbox_phone") - .Phone; - } - - /// - /// Creates a new simulated phone in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Creating a Simulated Phone for a User Identity](https://docs.seam.co/capability-guides/mobile-access/developing-in-a-sandbox-workspace#creating-a-simulated-phone-for-a-user-identity). - /// - public Phone CreateSandboxPhone( - CreateSandboxPhoneRequestAssaAbloyMetadata? assaAbloyMetadata = default, - string? customSdkInstallationId = default, - CreateSandboxPhoneRequestPhoneMetadata? phoneMetadata = default, - string userIdentityId = default - ) - { - return CreateSandboxPhone( - new CreateSandboxPhoneRequest( - assaAbloyMetadata: assaAbloyMetadata, - customSdkInstallationId: customSdkInstallationId, - phoneMetadata: phoneMetadata, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Creates a new simulated phone in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Creating a Simulated Phone for a User Identity](https://docs.seam.co/capability-guides/mobile-access/developing-in-a-sandbox-workspace#creating-a-simulated-phone-for-a-user-identity). - /// - public async Task CreateSandboxPhoneAsync(CreateSandboxPhoneRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/phones/simulate/create_sandbox_phone", - requestOptions - ) - ) - .EnsureData("/phones/simulate/create_sandbox_phone") - .Phone; - } - - /// - /// Creates a new simulated phone in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Creating a Simulated Phone for a User Identity](https://docs.seam.co/capability-guides/mobile-access/developing-in-a-sandbox-workspace#creating-a-simulated-phone-for-a-user-identity). - /// - public async Task CreateSandboxPhoneAsync( - CreateSandboxPhoneRequestAssaAbloyMetadata? assaAbloyMetadata = default, - string? customSdkInstallationId = default, - CreateSandboxPhoneRequestPhoneMetadata? phoneMetadata = default, - string userIdentityId = default - ) - { - return ( - await CreateSandboxPhoneAsync( - new CreateSandboxPhoneRequest( - assaAbloyMetadata: assaAbloyMetadata, - customSdkInstallationId: customSdkInstallationId, - phoneMetadata: phoneMetadata, - userIdentityId: userIdentityId - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SimulatePhones SimulatePhones => new(this); - } - - public partial interface ISeamClient - { - public Api.SimulatePhones SimulatePhones { get; } - } -} diff --git a/src/Seam/Api/SimulateThermostats.cs b/src/Seam/Api/SimulateThermostats.cs deleted file mode 100644 index d6f4ffa5..00000000 --- a/src/Seam/Api/SimulateThermostats.cs +++ /dev/null @@ -1,346 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SimulateThermostats - { - private ISeamClient _seam; - - public SimulateThermostats(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for HVAC Mode Adjusted. - /// - [DataContract(Name = "hvacModeAdjustedRequest_request")] - public class HvacModeAdjustedRequest - { - [JsonConstructorAttribute] - protected HvacModeAdjustedRequest() { } - - public HvacModeAdjustedRequest( - string deviceId = default, - HvacModeAdjustedRequest.HvacModeEnum hvacMode = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - DeviceId = deviceId; - HvacMode = hvacMode; - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - } - - /// - /// HVAC mode that you want to simulate. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum HvacModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "off")] - Off = 1, - - [EnumMember(Value = "cool")] - Cool = 2, - - [EnumMember(Value = "heat")] - Heat = 3, - - [EnumMember(Value = "heat_cool")] - HeatCool = 4, - } - - /// - /// ID of the thermostat device for which you want to simulate having adjusted the HVAC mode. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// HVAC mode that you want to simulate. - /// - [DataMember(Name = "hvac_mode", IsRequired = true, EmitDefaultValue = false)] - public HvacModeAdjustedRequest.HvacModeEnum HvacMode { get; set; } - - /// - /// Cooling [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to simulate. You must set `cooling_set_point_celsius` or `cooling_set_point_fahrenheit`. - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// Cooling [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to simulate. You must set `cooling_set_point_fahrenheit` or `cooling_set_point_celsius`. - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// Heating [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to simulate. You must set `heating_set_point_celsius` or `heating_set_point_fahrenheit`. - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// Heating [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to simulate. You must set `heating_set_point_fahrenheit` or `heating_set_point_celsius`. - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates having adjusted the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) for a [thermostat](https://docs.seam.co/capability-guides/thermostats). Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). - /// - public void HvacModeAdjusted(HvacModeAdjustedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/thermostats/simulate/hvac_mode_adjusted", requestOptions); - } - - /// - /// Simulates having adjusted the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) for a [thermostat](https://docs.seam.co/capability-guides/thermostats). Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). - /// - public void HvacModeAdjusted( - string deviceId = default, - HvacModeAdjustedRequest.HvacModeEnum hvacMode = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - HvacModeAdjusted( - new HvacModeAdjustedRequest( - deviceId: deviceId, - hvacMode: hvacMode, - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit - ) - ); - } - - /// - /// Simulates having adjusted the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) for a [thermostat](https://docs.seam.co/capability-guides/thermostats). Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). - /// - public async Task HvacModeAdjustedAsync(HvacModeAdjustedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/thermostats/simulate/hvac_mode_adjusted", - requestOptions - ); - } - - /// - /// Simulates having adjusted the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) for a [thermostat](https://docs.seam.co/capability-guides/thermostats). Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). - /// - public async Task HvacModeAdjustedAsync( - string deviceId = default, - HvacModeAdjustedRequest.HvacModeEnum hvacMode = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - await HvacModeAdjustedAsync( - new HvacModeAdjustedRequest( - deviceId: deviceId, - hvacMode: hvacMode, - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit - ) - ); - } - - /// - /// Request parameters for Temperature Reached. - /// - [DataContract(Name = "temperatureReachedRequest_request")] - public class TemperatureReachedRequest - { - [JsonConstructorAttribute] - protected TemperatureReachedRequest() { } - - public TemperatureReachedRequest( - string deviceId = default, - float? temperatureCelsius = default, - float? temperatureFahrenheit = default - ) - { - DeviceId = deviceId; - TemperatureCelsius = temperatureCelsius; - TemperatureFahrenheit = temperatureFahrenheit; - } - - /// - /// ID of the thermostat device that you want to simulate reaching a specified temperature. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Temperature in °C that you want simulate the thermostat reaching. You must set `temperature_celsius` or `temperature_fahrenheit`. - /// - [DataMember(Name = "temperature_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? TemperatureCelsius { get; set; } - - /// - /// Temperature in °F that you want simulate the thermostat reaching. You must set `temperature_fahrenheit` or `temperature_celsius`. - /// - [DataMember( - Name = "temperature_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? TemperatureFahrenheit { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulates a [thermostat](https://docs.seam.co/capability-guides/thermostats) reaching a specified temperature. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). - /// - public void TemperatureReached(TemperatureReachedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/thermostats/simulate/temperature_reached", requestOptions); - } - - /// - /// Simulates a [thermostat](https://docs.seam.co/capability-guides/thermostats) reaching a specified temperature. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). - /// - public void TemperatureReached( - string deviceId = default, - float? temperatureCelsius = default, - float? temperatureFahrenheit = default - ) - { - TemperatureReached( - new TemperatureReachedRequest( - deviceId: deviceId, - temperatureCelsius: temperatureCelsius, - temperatureFahrenheit: temperatureFahrenheit - ) - ); - } - - /// - /// Simulates a [thermostat](https://docs.seam.co/capability-guides/thermostats) reaching a specified temperature. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). - /// - public async Task TemperatureReachedAsync(TemperatureReachedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/thermostats/simulate/temperature_reached", - requestOptions - ); - } - - /// - /// Simulates a [thermostat](https://docs.seam.co/capability-guides/thermostats) reaching a specified temperature. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). - /// - public async Task TemperatureReachedAsync( - string deviceId = default, - float? temperatureCelsius = default, - float? temperatureFahrenheit = default - ) - { - await TemperatureReachedAsync( - new TemperatureReachedRequest( - deviceId: deviceId, - temperatureCelsius: temperatureCelsius, - temperatureFahrenheit: temperatureFahrenheit - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SimulateThermostats SimulateThermostats => new(this); - } - - public partial interface ISeamClient - { - public Api.SimulateThermostats SimulateThermostats { get; } - } -} diff --git a/src/Seam/Api/Spaces.cs b/src/Seam/Api/Spaces.cs deleted file mode 100644 index 52ba4f79..00000000 --- a/src/Seam/Api/Spaces.cs +++ /dev/null @@ -1,1744 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class Spaces - { - private ISeamClient _seam; - - public Spaces(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Add Entrances to a Space. - /// - [DataContract(Name = "addAcsEntrancesRequest_request")] - public class AddAcsEntrancesRequest - { - [JsonConstructorAttribute] - protected AddAcsEntrancesRequest() { } - - public AddAcsEntrancesRequest( - List acsEntranceIds = default, - string spaceId = default - ) - { - AcsEntranceIds = acsEntranceIds; - SpaceId = spaceId; - } - - /// - /// IDs of the entrances that you want to add to the space. - /// - [DataMember(Name = "acs_entrance_ids", IsRequired = true, EmitDefaultValue = false)] - public List AcsEntranceIds { get; set; } - - /// - /// ID of the space to which you want to add entrances. - /// - [DataMember(Name = "space_id", IsRequired = true, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Adds [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) to a specific space. - /// - public void AddAcsEntrances(AddAcsEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/spaces/add_acs_entrances", requestOptions); - } - - /// - /// Adds [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) to a specific space. - /// - public void AddAcsEntrances(List acsEntranceIds = default, string spaceId = default) - { - AddAcsEntrances( - new AddAcsEntrancesRequest(acsEntranceIds: acsEntranceIds, spaceId: spaceId) - ); - } - - /// - /// Adds [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) to a specific space. - /// - public async Task AddAcsEntrancesAsync(AddAcsEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/spaces/add_acs_entrances", requestOptions); - } - - /// - /// Adds [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) to a specific space. - /// - public async Task AddAcsEntrancesAsync( - List acsEntranceIds = default, - string spaceId = default - ) - { - await AddAcsEntrancesAsync( - new AddAcsEntrancesRequest(acsEntranceIds: acsEntranceIds, spaceId: spaceId) - ); - } - - /// - /// Request parameters for Add a Connected Account to a Space. - /// - [DataContract(Name = "addConnectedAccountRequest_request")] - public class AddConnectedAccountRequest - { - [JsonConstructorAttribute] - protected AddConnectedAccountRequest() { } - - public AddConnectedAccountRequest( - string connectedAccountId = default, - string spaceId = default - ) - { - ConnectedAccountId = connectedAccountId; - SpaceId = spaceId; - } - - /// - /// ID of the connected account that you want to add to the space. - /// - [DataMember(Name = "connected_account_id", IsRequired = true, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// ID of the space to which you want to add the connected account. - /// - [DataMember(Name = "space_id", IsRequired = true, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Adds a [connected account](https://docs.seam.co/core-concepts/connected-accounts) to a specific space. - /// - public void AddConnectedAccount(AddConnectedAccountRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/spaces/add_connected_account", requestOptions); - } - - /// - /// Adds a [connected account](https://docs.seam.co/core-concepts/connected-accounts) to a specific space. - /// - public void AddConnectedAccount( - string connectedAccountId = default, - string spaceId = default - ) - { - AddConnectedAccount( - new AddConnectedAccountRequest( - connectedAccountId: connectedAccountId, - spaceId: spaceId - ) - ); - } - - /// - /// Adds a [connected account](https://docs.seam.co/core-concepts/connected-accounts) to a specific space. - /// - public async Task AddConnectedAccountAsync(AddConnectedAccountRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/spaces/add_connected_account", requestOptions); - } - - /// - /// Adds a [connected account](https://docs.seam.co/core-concepts/connected-accounts) to a specific space. - /// - public async Task AddConnectedAccountAsync( - string connectedAccountId = default, - string spaceId = default - ) - { - await AddConnectedAccountAsync( - new AddConnectedAccountRequest( - connectedAccountId: connectedAccountId, - spaceId: spaceId - ) - ); - } - - /// - /// Request parameters for Add Devices to a Space. - /// - [DataContract(Name = "addDevicesRequest_request")] - public class AddDevicesRequest - { - [JsonConstructorAttribute] - protected AddDevicesRequest() { } - - public AddDevicesRequest(List deviceIds = default, string spaceId = default) - { - DeviceIds = deviceIds; - SpaceId = spaceId; - } - - /// - /// IDs of the devices that you want to add to the space. - /// - [DataMember(Name = "device_ids", IsRequired = true, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - /// - /// ID of the space to which you want to add devices. - /// - [DataMember(Name = "space_id", IsRequired = true, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Adds devices to a specific space. - /// - public void AddDevices(AddDevicesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/spaces/add_devices", requestOptions); - } - - /// - /// Adds devices to a specific space. - /// - public void AddDevices(List deviceIds = default, string spaceId = default) - { - AddDevices(new AddDevicesRequest(deviceIds: deviceIds, spaceId: spaceId)); - } - - /// - /// Adds devices to a specific space. - /// - public async Task AddDevicesAsync(AddDevicesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/spaces/add_devices", requestOptions); - } - - /// - /// Adds devices to a specific space. - /// - public async Task AddDevicesAsync( - List deviceIds = default, - string spaceId = default - ) - { - await AddDevicesAsync(new AddDevicesRequest(deviceIds: deviceIds, spaceId: spaceId)); - } - - /// - /// Request parameters for Create a Space. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - List? acsEntranceIds = default, - List? connectedAccountIds = default, - CreateRequestCustomerData? customerData = default, - string? customerKey = default, - List? deviceIds = default, - string name = default, - string? spaceKey = default - ) - { - AcsEntranceIds = acsEntranceIds; - ConnectedAccountIds = connectedAccountIds; - CustomerData = customerData; - CustomerKey = customerKey; - DeviceIds = deviceIds; - Name = name; - SpaceKey = spaceKey; - } - - /// - /// IDs of the entrances that you want to add to the new space. - /// - [DataMember(Name = "acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AcsEntranceIds { get; set; } - - /// - /// IDs of connected accounts to associate with the new space. Persisted on seam.location_third_party_account so the UI can show which provider account(s) a space came from. - /// - [DataMember( - Name = "connected_account_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? ConnectedAccountIds { get; set; } - - /// - /// Reservation/stay-related defaults for the space. - /// - [DataMember(Name = "customer_data", IsRequired = false, EmitDefaultValue = false)] - public CreateRequestCustomerData? CustomerData { get; set; } - - /// - /// Customer key for which you want to create the space. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// IDs of the devices that you want to add to the new space. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceIds { get; set; } - - /// - /// Name of the space that you want to create. - /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Unique key for the space within the workspace. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestCustomerData_model")] - public class CreateRequestCustomerData - { - [JsonConstructorAttribute] - protected CreateRequestCustomerData() { } - - public CreateRequestCustomerData( - string? address = default, - string? defaultCheckinTime = default, - string? defaultCheckoutTime = default, - string? timeZone = default - ) - { - Address = address; - DefaultCheckinTime = defaultCheckinTime; - DefaultCheckoutTime = defaultCheckoutTime; - TimeZone = timeZone; - } - - /// - /// Postal address for the space. - /// - [DataMember(Name = "address", IsRequired = false, EmitDefaultValue = false)] - public string? Address { get; set; } - - /// - /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember( - Name = "default_checkin_time", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DefaultCheckinTime { get; set; } - - /// - /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember( - Name = "default_checkout_time", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DefaultCheckoutTime { get; set; } - - /// - /// IANA time zone for the space, e.g. America/Los_Angeles. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(Space space = default) - { - Space = space; - } - - /// - /// OK - /// - [DataMember(Name = "space", IsRequired = false, EmitDefaultValue = false)] - public Space Space { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new space. - /// - public Space Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/spaces/create", requestOptions) - .EnsureData("/spaces/create") - .Space; - } - - /// - /// Creates a new space. - /// - public Space Create( - List? acsEntranceIds = default, - List? connectedAccountIds = default, - CreateRequestCustomerData? customerData = default, - string? customerKey = default, - List? deviceIds = default, - string name = default, - string? spaceKey = default - ) - { - return Create( - new CreateRequest( - acsEntranceIds: acsEntranceIds, - connectedAccountIds: connectedAccountIds, - customerData: customerData, - customerKey: customerKey, - deviceIds: deviceIds, - name: name, - spaceKey: spaceKey - ) - ); - } - - /// - /// Creates a new space. - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/spaces/create", requestOptions)) - .EnsureData("/spaces/create") - .Space; - } - - /// - /// Creates a new space. - /// - public async Task CreateAsync( - List? acsEntranceIds = default, - List? connectedAccountIds = default, - CreateRequestCustomerData? customerData = default, - string? customerKey = default, - List? deviceIds = default, - string name = default, - string? spaceKey = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - acsEntranceIds: acsEntranceIds, - connectedAccountIds: connectedAccountIds, - customerData: customerData, - customerKey: customerKey, - deviceIds: deviceIds, - name: name, - spaceKey: spaceKey - ) - ) - ); - } - - /// - /// Request parameters for Delete a Space. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string spaceId = default) - { - SpaceId = spaceId; - } - - /// - /// ID of the space that you want to delete. - /// - [DataMember(Name = "space_id", IsRequired = true, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a space. - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/spaces/delete", requestOptions); - } - - /// - /// Deletes a space. - /// - public void Delete(string spaceId = default) - { - Delete(new DeleteRequest(spaceId: spaceId)); - } - - /// - /// Deletes a space. - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/spaces/delete", requestOptions); - } - - /// - /// Deletes a space. - /// - public async Task DeleteAsync(string spaceId = default) - { - await DeleteAsync(new DeleteRequest(spaceId: spaceId)); - } - - /// - /// Request parameters for Get a Space. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string? spaceId = default, string? spaceKey = default) - { - SpaceId = spaceId; - SpaceKey = spaceKey; - } - - /// - /// ID of the space that you want to get. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceId { get; set; } - - /// - /// Unique key of the space that you want to get. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(Space space = default) - { - Space = space; - } - - /// - /// OK - /// - [DataMember(Name = "space", IsRequired = false, EmitDefaultValue = false)] - public Space Space { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets a space. - /// - public Space Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/spaces/get", requestOptions) - .EnsureData("/spaces/get") - .Space; - } - - /// - /// Gets a space. - /// - public Space Get(string? spaceId = default, string? spaceKey = default) - { - return Get(new GetRequest(spaceId: spaceId, spaceKey: spaceKey)); - } - - /// - /// Gets a space. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/spaces/get", requestOptions)) - .EnsureData("/spaces/get") - .Space; - } - - /// - /// Gets a space. - /// - public async Task GetAsync(string? spaceId = default, string? spaceKey = default) - { - return (await GetAsync(new GetRequest(spaceId: spaceId, spaceKey: spaceKey))); - } - - /// - /// Request parameters for Get related Space resources. - /// - [DataContract(Name = "getRelatedRequest_request")] - public class GetRelatedRequest - { - [JsonConstructorAttribute] - protected GetRelatedRequest() { } - - public GetRelatedRequest( - List? exclude = default, - List? include = default, - List? spaceIds = default, - List? spaceKeys = default - ) - { - Exclude = exclude; - Include = include; - SpaceIds = spaceIds; - SpaceKeys = spaceKeys; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExcludeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "spaces")] - Spaces = 1, - - [EnumMember(Value = "devices")] - Devices = 2, - - [EnumMember(Value = "acs_entrances")] - AcsEntrances = 3, - - [EnumMember(Value = "connected_accounts")] - ConnectedAccounts = 4, - - [EnumMember(Value = "acs_systems")] - AcsSystems = 5, - - [EnumMember(Value = "access_methods")] - AccessMethods = 6, - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum IncludeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "spaces")] - Spaces = 1, - - [EnumMember(Value = "devices")] - Devices = 2, - - [EnumMember(Value = "acs_entrances")] - AcsEntrances = 3, - - [EnumMember(Value = "connected_accounts")] - ConnectedAccounts = 4, - - [EnumMember(Value = "acs_systems")] - AcsSystems = 5, - - [EnumMember(Value = "access_methods")] - AccessMethods = 6, - } - - [DataMember(Name = "exclude", IsRequired = false, EmitDefaultValue = false)] - public List? Exclude { get; set; } - - [DataMember(Name = "include", IsRequired = false, EmitDefaultValue = false)] - public List? Include { get; set; } - - /// - /// IDs of the spaces that you want to get along with their related resources. - /// - [DataMember(Name = "space_ids", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceIds { get; set; } - - /// - /// Keys of the spaces that you want to get along with their related resources. - /// - [DataMember(Name = "space_keys", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceKeys { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getRelatedResponse_response")] - public class GetRelatedResponse - { - [JsonConstructorAttribute] - protected GetRelatedResponse() { } - - public GetRelatedResponse(Batch batch = default) - { - Batch = batch; - } - - /// - /// OK - /// - [DataMember(Name = "batch", IsRequired = false, EmitDefaultValue = false)] - public Batch Batch { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets all related resources for one or more Spaces. - /// - public Batch GetRelated(GetRelatedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/spaces/get_related", requestOptions) - .EnsureData("/spaces/get_related") - .Batch; - } - - /// - /// Gets all related resources for one or more Spaces. - /// - public Batch GetRelated( - List? exclude = default, - List? include = default, - List? spaceIds = default, - List? spaceKeys = default - ) - { - return GetRelated( - new GetRelatedRequest( - exclude: exclude, - include: include, - spaceIds: spaceIds, - spaceKeys: spaceKeys - ) - ); - } - - /// - /// Gets all related resources for one or more Spaces. - /// - public async Task GetRelatedAsync(GetRelatedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/spaces/get_related", requestOptions)) - .EnsureData("/spaces/get_related") - .Batch; - } - - /// - /// Gets all related resources for one or more Spaces. - /// - public async Task GetRelatedAsync( - List? exclude = default, - List? include = default, - List? spaceIds = default, - List? spaceKeys = default - ) - { - return ( - await GetRelatedAsync( - new GetRelatedRequest( - exclude: exclude, - include: include, - spaceIds: spaceIds, - spaceKeys: spaceKeys - ) - ) - ); - } - - /// - /// Request parameters for List Spaces. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? customerKey = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? spaceKey = default - ) - { - CustomerKey = customerKey; - Limit = limit; - PageCursor = pageCursor; - Search = search; - SpaceKey = spaceKey; - } - - /// - /// Customer key for which you want to list spaces. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Maximum number of records to return per page. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned spaces to include all records that satisfy a partial match using `name`, `space_key`, or `customer_key`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// Filter spaces by space_key. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List spaces = default) - { - Spaces = spaces; - } - - /// - /// OK - /// - [DataMember(Name = "spaces", IsRequired = false, EmitDefaultValue = false)] - public List Spaces { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all spaces. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/spaces/list", requestOptions) - .EnsureData("/spaces/list") - .Spaces; - } - - /// - /// Returns a list of all spaces. - /// - public List List( - string? customerKey = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? spaceKey = default - ) - { - return List( - new ListRequest( - customerKey: customerKey, - limit: limit, - pageCursor: pageCursor, - search: search, - spaceKey: spaceKey - ) - ); - } - - /// - /// Returns a list of all spaces. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/spaces/list", requestOptions)) - .EnsureData("/spaces/list") - .Spaces; - } - - /// - /// Returns a list of all spaces. - /// - public async Task> ListAsync( - string? customerKey = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? spaceKey = default - ) - { - return ( - await ListAsync( - new ListRequest( - customerKey: customerKey, - limit: limit, - pageCursor: pageCursor, - search: search, - spaceKey: spaceKey - ) - ) - ); - } - - /// - /// Request parameters for Remove Entrances from a Space. - /// - [DataContract(Name = "removeAcsEntrancesRequest_request")] - public class RemoveAcsEntrancesRequest - { - [JsonConstructorAttribute] - protected RemoveAcsEntrancesRequest() { } - - public RemoveAcsEntrancesRequest( - List acsEntranceIds = default, - string spaceId = default - ) - { - AcsEntranceIds = acsEntranceIds; - SpaceId = spaceId; - } - - /// - /// IDs of the entrances that you want to remove from the space. - /// - [DataMember(Name = "acs_entrance_ids", IsRequired = true, EmitDefaultValue = false)] - public List AcsEntranceIds { get; set; } - - /// - /// ID of the space from which you want to remove entrances. - /// - [DataMember(Name = "space_id", IsRequired = true, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Removes [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) from a specific space. - /// - public void RemoveAcsEntrances(RemoveAcsEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/spaces/remove_acs_entrances", requestOptions); - } - - /// - /// Removes [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) from a specific space. - /// - public void RemoveAcsEntrances( - List acsEntranceIds = default, - string spaceId = default - ) - { - RemoveAcsEntrances( - new RemoveAcsEntrancesRequest(acsEntranceIds: acsEntranceIds, spaceId: spaceId) - ); - } - - /// - /// Removes [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) from a specific space. - /// - public async Task RemoveAcsEntrancesAsync(RemoveAcsEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/spaces/remove_acs_entrances", requestOptions); - } - - /// - /// Removes [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) from a specific space. - /// - public async Task RemoveAcsEntrancesAsync( - List acsEntranceIds = default, - string spaceId = default - ) - { - await RemoveAcsEntrancesAsync( - new RemoveAcsEntrancesRequest(acsEntranceIds: acsEntranceIds, spaceId: spaceId) - ); - } - - /// - /// Request parameters for Remove a Connected Account from a Space. - /// - [DataContract(Name = "removeConnectedAccountRequest_request")] - public class RemoveConnectedAccountRequest - { - [JsonConstructorAttribute] - protected RemoveConnectedAccountRequest() { } - - public RemoveConnectedAccountRequest( - string connectedAccountId = default, - string spaceId = default - ) - { - ConnectedAccountId = connectedAccountId; - SpaceId = spaceId; - } - - /// - /// ID of the connected account that you want to remove from the space. - /// - [DataMember(Name = "connected_account_id", IsRequired = true, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// ID of the space from which you want to remove the connected account. - /// - [DataMember(Name = "space_id", IsRequired = true, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Removes a [connected account](https://docs.seam.co/core-concepts/connected-accounts) from a specific space. - /// - public void RemoveConnectedAccount(RemoveConnectedAccountRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/spaces/remove_connected_account", requestOptions); - } - - /// - /// Removes a [connected account](https://docs.seam.co/core-concepts/connected-accounts) from a specific space. - /// - public void RemoveConnectedAccount( - string connectedAccountId = default, - string spaceId = default - ) - { - RemoveConnectedAccount( - new RemoveConnectedAccountRequest( - connectedAccountId: connectedAccountId, - spaceId: spaceId - ) - ); - } - - /// - /// Removes a [connected account](https://docs.seam.co/core-concepts/connected-accounts) from a specific space. - /// - public async Task RemoveConnectedAccountAsync(RemoveConnectedAccountRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/spaces/remove_connected_account", requestOptions); - } - - /// - /// Removes a [connected account](https://docs.seam.co/core-concepts/connected-accounts) from a specific space. - /// - public async Task RemoveConnectedAccountAsync( - string connectedAccountId = default, - string spaceId = default - ) - { - await RemoveConnectedAccountAsync( - new RemoveConnectedAccountRequest( - connectedAccountId: connectedAccountId, - spaceId: spaceId - ) - ); - } - - /// - /// Request parameters for Remove Devices from a Space. - /// - [DataContract(Name = "removeDevicesRequest_request")] - public class RemoveDevicesRequest - { - [JsonConstructorAttribute] - protected RemoveDevicesRequest() { } - - public RemoveDevicesRequest(List deviceIds = default, string spaceId = default) - { - DeviceIds = deviceIds; - SpaceId = spaceId; - } - - /// - /// IDs of the devices that you want to remove from the space. - /// - [DataMember(Name = "device_ids", IsRequired = true, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - /// - /// ID of the space from which you want to remove devices. - /// - [DataMember(Name = "space_id", IsRequired = true, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Removes devices from a specific space. - /// - public void RemoveDevices(RemoveDevicesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/spaces/remove_devices", requestOptions); - } - - /// - /// Removes devices from a specific space. - /// - public void RemoveDevices(List deviceIds = default, string spaceId = default) - { - RemoveDevices(new RemoveDevicesRequest(deviceIds: deviceIds, spaceId: spaceId)); - } - - /// - /// Removes devices from a specific space. - /// - public async Task RemoveDevicesAsync(RemoveDevicesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/spaces/remove_devices", requestOptions); - } - - /// - /// Removes devices from a specific space. - /// - public async Task RemoveDevicesAsync( - List deviceIds = default, - string spaceId = default - ) - { - await RemoveDevicesAsync( - new RemoveDevicesRequest(deviceIds: deviceIds, spaceId: spaceId) - ); - } - - /// - /// Request parameters for Update a Space. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - List? acsEntranceIds = default, - UpdateRequestCustomerData? customerData = default, - List? deviceIds = default, - string? name = default, - string? spaceId = default, - string? spaceKey = default - ) - { - AcsEntranceIds = acsEntranceIds; - CustomerData = customerData; - DeviceIds = deviceIds; - Name = name; - SpaceId = spaceId; - SpaceKey = spaceKey; - } - - /// - /// IDs of the entrances that you want to set for the space. If specified, this will replace all existing entrances. - /// - [DataMember(Name = "acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AcsEntranceIds { get; set; } - - /// - /// Reservation/stay-related defaults for the space. Only the keys you provide are updated; omit a key to leave it unchanged. Pass null on a key to clear it. - /// - [DataMember(Name = "customer_data", IsRequired = false, EmitDefaultValue = false)] - public UpdateRequestCustomerData? CustomerData { get; set; } - - /// - /// IDs of the devices that you want to set for the space. If specified, this will replace all existing devices. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceIds { get; set; } - - /// - /// Name of the space. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// ID of the space that you want to update. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceId { get; set; } - - /// - /// Unique key of the space that you want to update. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "updateRequestCustomerData_model")] - public class UpdateRequestCustomerData - { - [JsonConstructorAttribute] - protected UpdateRequestCustomerData() { } - - public UpdateRequestCustomerData( - string? address = default, - string? defaultCheckinTime = default, - string? defaultCheckoutTime = default, - string? timeZone = default - ) - { - Address = address; - DefaultCheckinTime = defaultCheckinTime; - DefaultCheckoutTime = defaultCheckoutTime; - TimeZone = timeZone; - } - - /// - /// Postal address for the space. - /// - [DataMember(Name = "address", IsRequired = false, EmitDefaultValue = false)] - public string? Address { get; set; } - - /// - /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember( - Name = "default_checkin_time", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DefaultCheckinTime { get; set; } - - /// - /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember( - Name = "default_checkout_time", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DefaultCheckoutTime { get; set; } - - /// - /// IANA time zone for the space, e.g. America/Los_Angeles. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "updateResponse_response")] - public class UpdateResponse - { - [JsonConstructorAttribute] - protected UpdateResponse() { } - - public UpdateResponse(Space space = default) - { - Space = space; - } - - /// - /// OK - /// - [DataMember(Name = "space", IsRequired = false, EmitDefaultValue = false)] - public Space Space { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates an existing space. - /// - public Space Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Patch("/spaces/update", requestOptions) - .EnsureData("/spaces/update") - .Space; - } - - /// - /// Updates an existing space. - /// - public Space Update( - List? acsEntranceIds = default, - UpdateRequestCustomerData? customerData = default, - List? deviceIds = default, - string? name = default, - string? spaceId = default, - string? spaceKey = default - ) - { - return Update( - new UpdateRequest( - acsEntranceIds: acsEntranceIds, - customerData: customerData, - deviceIds: deviceIds, - name: name, - spaceId: spaceId, - spaceKey: spaceKey - ) - ); - } - - /// - /// Updates an existing space. - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PatchAsync("/spaces/update", requestOptions)) - .EnsureData("/spaces/update") - .Space; - } - - /// - /// Updates an existing space. - /// - public async Task UpdateAsync( - List? acsEntranceIds = default, - UpdateRequestCustomerData? customerData = default, - List? deviceIds = default, - string? name = default, - string? spaceId = default, - string? spaceKey = default - ) - { - return ( - await UpdateAsync( - new UpdateRequest( - acsEntranceIds: acsEntranceIds, - customerData: customerData, - deviceIds: deviceIds, - name: name, - spaceId: spaceId, - spaceKey: spaceKey - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.Spaces Spaces => new(this); - } - - public partial interface ISeamClient - { - public Api.Spaces Spaces { get; } - } -} diff --git a/src/Seam/Api/SystemsAcs.cs b/src/Seam/Api/SystemsAcs.cs deleted file mode 100644 index 4960c1fc..00000000 --- a/src/Seam/Api/SystemsAcs.cs +++ /dev/null @@ -1,772 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class SystemsAcs - { - private ISeamClient _seam; - - public SystemsAcs(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Get an ACS System. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string acsSystemId = default) - { - AcsSystemId = acsSystemId; - } - - /// - /// ID of the access system that you want to get. - /// - [DataMember(Name = "acs_system_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(AcsSystem acsSystem = default) - { - AcsSystem = acsSystem; - } - - /// - /// OK - /// - [DataMember(Name = "acs_system", IsRequired = false, EmitDefaultValue = false)] - public AcsSystem AcsSystem { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [access system](https://docs.seam.co/low-level-apis/access-systems). - /// - public AcsSystem Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/systems/get", requestOptions) - .EnsureData("/acs/systems/get") - .AcsSystem; - } - - /// - /// Returns a specified [access system](https://docs.seam.co/low-level-apis/access-systems). - /// - public AcsSystem Get(string acsSystemId = default) - { - return Get(new GetRequest(acsSystemId: acsSystemId)); - } - - /// - /// Returns a specified [access system](https://docs.seam.co/low-level-apis/access-systems). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/systems/get", requestOptions)) - .EnsureData("/acs/systems/get") - .AcsSystem; - } - - /// - /// Returns a specified [access system](https://docs.seam.co/low-level-apis/access-systems). - /// - public async Task GetAsync(string acsSystemId = default) - { - return (await GetAsync(new GetRequest(acsSystemId: acsSystemId))); - } - - /// - /// Request parameters for List ACS Systems. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? connectedAccountId = default, - string? customerKey = default, - string? search = default - ) - { - ConnectedAccountId = connectedAccountId; - CustomerKey = customerKey; - Search = search; - } - - /// - /// ID of the connected account by which you want to filter the list of access systems. - /// - [DataMember( - Name = "connected_account_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectedAccountId { get; set; } - - /// - /// Customer key for which you want to list access systems. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// String for which to search. Filters returned access systems to include all records that satisfy a partial match using `name` or `acs_system_id`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List acsSystems = default) - { - AcsSystems = acsSystems; - } - - /// - /// OK - /// - [DataMember(Name = "acs_systems", IsRequired = false, EmitDefaultValue = false)] - public List AcsSystems { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems). - /// - /// To filter the list of returned access systems by a specific connected account ID, include the `connected_account_id` in the request body. If you omit the `connected_account_id` parameter, the response includes all access systems connected to your workspace. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/systems/list", requestOptions) - .EnsureData("/acs/systems/list") - .AcsSystems; - } - - /// - /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems). - /// - /// To filter the list of returned access systems by a specific connected account ID, include the `connected_account_id` in the request body. If you omit the `connected_account_id` parameter, the response includes all access systems connected to your workspace. - /// - public List List( - string? connectedAccountId = default, - string? customerKey = default, - string? search = default - ) - { - return List( - new ListRequest( - connectedAccountId: connectedAccountId, - customerKey: customerKey, - search: search - ) - ); - } - - /// - /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems). - /// - /// To filter the list of returned access systems by a specific connected account ID, include the `connected_account_id` in the request body. If you omit the `connected_account_id` parameter, the response includes all access systems connected to your workspace. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/systems/list", requestOptions)) - .EnsureData("/acs/systems/list") - .AcsSystems; - } - - /// - /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems). - /// - /// To filter the list of returned access systems by a specific connected account ID, include the `connected_account_id` in the request body. If you omit the `connected_account_id` parameter, the response includes all access systems connected to your workspace. - /// - public async Task> ListAsync( - string? connectedAccountId = default, - string? customerKey = default, - string? search = default - ) - { - return ( - await ListAsync( - new ListRequest( - connectedAccountId: connectedAccountId, - customerKey: customerKey, - search: search - ) - ) - ); - } - - /// - /// Request parameters for List Compatible Credential Manager ACS Systems. - /// - [DataContract(Name = "listCompatibleCredentialManagerAcsSystemsRequest_request")] - public class ListCompatibleCredentialManagerAcsSystemsRequest - { - [JsonConstructorAttribute] - protected ListCompatibleCredentialManagerAcsSystemsRequest() { } - - public ListCompatibleCredentialManagerAcsSystemsRequest(string acsSystemId = default) - { - AcsSystemId = acsSystemId; - } - - /// - /// ID of the access system for which you want to retrieve all compatible credential manager systems. - /// - [DataMember(Name = "acs_system_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listCompatibleCredentialManagerAcsSystemsResponse_response")] - public class ListCompatibleCredentialManagerAcsSystemsResponse - { - [JsonConstructorAttribute] - protected ListCompatibleCredentialManagerAcsSystemsResponse() { } - - public ListCompatibleCredentialManagerAcsSystemsResponse( - List acsSystems = default - ) - { - AcsSystems = acsSystems; - } - - /// - /// OK - /// - [DataMember(Name = "acs_systems", IsRequired = false, EmitDefaultValue = false)] - public List AcsSystems { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all credential manager systems that are compatible with a specified [access system](https://docs.seam.co/low-level-apis/access-systems). - /// - /// Specify the access system for which you want to retrieve all compatible credential manager systems by including the corresponding `acs_system_id` in the request body. - /// - public List ListCompatibleCredentialManagerAcsSystems( - ListCompatibleCredentialManagerAcsSystemsRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get( - "/acs/systems/list_compatible_credential_manager_acs_systems", - requestOptions - ) - .EnsureData("/acs/systems/list_compatible_credential_manager_acs_systems") - .AcsSystems; - } - - /// - /// Returns a list of all credential manager systems that are compatible with a specified [access system](https://docs.seam.co/low-level-apis/access-systems). - /// - /// Specify the access system for which you want to retrieve all compatible credential manager systems by including the corresponding `acs_system_id` in the request body. - /// - public List ListCompatibleCredentialManagerAcsSystems( - string acsSystemId = default - ) - { - return ListCompatibleCredentialManagerAcsSystems( - new ListCompatibleCredentialManagerAcsSystemsRequest(acsSystemId: acsSystemId) - ); - } - - /// - /// Returns a list of all credential manager systems that are compatible with a specified [access system](https://docs.seam.co/low-level-apis/access-systems). - /// - /// Specify the access system for which you want to retrieve all compatible credential manager systems by including the corresponding `acs_system_id` in the request body. - /// - public async Task> ListCompatibleCredentialManagerAcsSystemsAsync( - ListCompatibleCredentialManagerAcsSystemsRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/acs/systems/list_compatible_credential_manager_acs_systems", - requestOptions - ) - ) - .EnsureData("/acs/systems/list_compatible_credential_manager_acs_systems") - .AcsSystems; - } - - /// - /// Returns a list of all credential manager systems that are compatible with a specified [access system](https://docs.seam.co/low-level-apis/access-systems). - /// - /// Specify the access system for which you want to retrieve all compatible credential manager systems by including the corresponding `acs_system_id` in the request body. - /// - public async Task> ListCompatibleCredentialManagerAcsSystemsAsync( - string acsSystemId = default - ) - { - return ( - await ListCompatibleCredentialManagerAcsSystemsAsync( - new ListCompatibleCredentialManagerAcsSystemsRequest(acsSystemId: acsSystemId) - ) - ); - } - - /// - /// Request parameters for Report Devices. - /// - [DataContract(Name = "reportDevicesRequest_request")] - public class ReportDevicesRequest - { - [JsonConstructorAttribute] - protected ReportDevicesRequest() { } - - public ReportDevicesRequest( - List? acsEncoders = default, - List? acsEntrances = default, - string acsSystemId = default - ) - { - AcsEncoders = acsEncoders; - AcsEntrances = acsEntrances; - AcsSystemId = acsSystemId; - } - - /// - /// Array of ACS encoders to report - /// - [DataMember(Name = "acs_encoders", IsRequired = false, EmitDefaultValue = false)] - public List? AcsEncoders { get; set; } - - /// - /// Array of ACS entrances to report - /// - [DataMember(Name = "acs_entrances", IsRequired = false, EmitDefaultValue = false)] - public List? AcsEntrances { get; set; } - - /// - /// ID of the ACS system to report resources for - /// - [DataMember(Name = "acs_system_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "reportDevicesRequestAcsEncoders_model")] - public class ReportDevicesRequestAcsEncoders - { - [JsonConstructorAttribute] - protected ReportDevicesRequestAcsEncoders() { } - - public ReportDevicesRequestAcsEncoders( - ReportDevicesRequestAcsEncodersHotekMetadata? hotekMetadata = default, - bool? isRemoved = default - ) - { - HotekMetadata = hotekMetadata; - IsRemoved = isRemoved; - } - - /// - /// Hotek-specific metadata associated with the entrance. - /// - [DataMember(Name = "hotek_metadata", IsRequired = false, EmitDefaultValue = false)] - public ReportDevicesRequestAcsEncodersHotekMetadata? HotekMetadata { get; set; } - - /// - /// Whether the encoder is removed - /// - [DataMember(Name = "is_removed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsRemoved { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "reportDevicesRequestAcsEncodersHotekMetadata_model")] - public class ReportDevicesRequestAcsEncodersHotekMetadata - { - [JsonConstructorAttribute] - protected ReportDevicesRequestAcsEncodersHotekMetadata() { } - - public ReportDevicesRequestAcsEncodersHotekMetadata(string? encoderNumber = default) - { - EncoderNumber = encoderNumber; - } - - /// - /// The encoder number determined by the USB port connection. - /// - [DataMember(Name = "encoder_number", IsRequired = false, EmitDefaultValue = false)] - public string? EncoderNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "reportDevicesRequestAcsEntrances_model")] - public class ReportDevicesRequestAcsEntrances - { - [JsonConstructorAttribute] - protected ReportDevicesRequestAcsEntrances() { } - - public ReportDevicesRequestAcsEntrances( - ReportDevicesRequestAcsEntrancesHotekMetadata? hotekMetadata = default, - bool? isRemoved = default - ) - { - HotekMetadata = hotekMetadata; - IsRemoved = isRemoved; - } - - /// - /// Hotek-specific metadata associated with the entrance. - /// - [DataMember(Name = "hotek_metadata", IsRequired = false, EmitDefaultValue = false)] - public ReportDevicesRequestAcsEntrancesHotekMetadata? HotekMetadata { get; set; } - - /// - /// Whether the entrance is removed - /// - [DataMember(Name = "is_removed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsRemoved { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "reportDevicesRequestAcsEntrancesHotekMetadata_model")] - public class ReportDevicesRequestAcsEntrancesHotekMetadata - { - [JsonConstructorAttribute] - protected ReportDevicesRequestAcsEntrancesHotekMetadata() { } - - public ReportDevicesRequestAcsEntrancesHotekMetadata( - string? commonAreaName = default, - string? commonAreaNumber = default, - string? roomNumber = default - ) - { - CommonAreaName = commonAreaName; - CommonAreaNumber = commonAreaNumber; - RoomNumber = roomNumber; - } - - /// - /// The common area name - /// - [DataMember(Name = "common_area_name", IsRequired = false, EmitDefaultValue = false)] - public string? CommonAreaName { get; set; } - - /// - /// The room number identifier - /// - [DataMember(Name = "common_area_number", IsRequired = false, EmitDefaultValue = false)] - public string? CommonAreaNumber { get; set; } - - /// - /// The room number identifier - /// - [DataMember(Name = "room_number", IsRequired = false, EmitDefaultValue = false)] - public string? RoomNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Reports ACS system device status including encoders and entrances. - /// - public void ReportDevices(ReportDevicesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/acs/systems/report_devices", requestOptions); - } - - /// - /// Reports ACS system device status including encoders and entrances. - /// - public void ReportDevices( - List? acsEncoders = default, - List? acsEntrances = default, - string acsSystemId = default - ) - { - ReportDevices( - new ReportDevicesRequest( - acsEncoders: acsEncoders, - acsEntrances: acsEntrances, - acsSystemId: acsSystemId - ) - ); - } - - /// - /// Reports ACS system device status including encoders and entrances. - /// - public async Task ReportDevicesAsync(ReportDevicesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/acs/systems/report_devices", requestOptions); - } - - /// - /// Reports ACS system device status including encoders and entrances. - /// - public async Task ReportDevicesAsync( - List? acsEncoders = default, - List? acsEntrances = default, - string acsSystemId = default - ) - { - await ReportDevicesAsync( - new ReportDevicesRequest( - acsEncoders: acsEncoders, - acsEntrances: acsEntrances, - acsSystemId: acsSystemId - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.SystemsAcs SystemsAcs => new(this); - } - - public partial interface ISeamClient - { - public Api.SystemsAcs SystemsAcs { get; } - } -} diff --git a/src/Seam/Api/Thermostats.cs b/src/Seam/Api/Thermostats.cs deleted file mode 100644 index 272d61ad..00000000 --- a/src/Seam/Api/Thermostats.cs +++ /dev/null @@ -1,2918 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class Thermostats - { - private ISeamClient _seam; - - public Thermostats(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Activate a Climate Preset. - /// - [DataContract(Name = "activateClimatePresetRequest_request")] - public class ActivateClimatePresetRequest - { - [JsonConstructorAttribute] - protected ActivateClimatePresetRequest() { } - - public ActivateClimatePresetRequest( - string climatePresetKey = default, - string deviceId = default - ) - { - ClimatePresetKey = climatePresetKey; - DeviceId = deviceId; - } - - /// - /// Climate preset key of the climate preset that you want to activate. - /// - [DataMember(Name = "climate_preset_key", IsRequired = true, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// ID of the thermostat device for which you want to activate a climate preset. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "activateClimatePresetResponse_response")] - public class ActivateClimatePresetResponse - { - [JsonConstructorAttribute] - protected ActivateClimatePresetResponse() { } - - public ActivateClimatePresetResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Activates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public ActionAttempt ActivateClimatePreset(ActivateClimatePresetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post( - "/thermostats/activate_climate_preset", - requestOptions - ) - .EnsureData("/thermostats/activate_climate_preset") - .ActionAttempt; - } - - /// - /// Activates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public ActionAttempt ActivateClimatePreset( - string climatePresetKey = default, - string deviceId = default - ) - { - return ActivateClimatePreset( - new ActivateClimatePresetRequest( - climatePresetKey: climatePresetKey, - deviceId: deviceId - ) - ); - } - - /// - /// Activates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task ActivateClimatePresetAsync( - ActivateClimatePresetRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/thermostats/activate_climate_preset", - requestOptions - ) - ) - .EnsureData("/thermostats/activate_climate_preset") - .ActionAttempt; - } - - /// - /// Activates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task ActivateClimatePresetAsync( - string climatePresetKey = default, - string deviceId = default - ) - { - return ( - await ActivateClimatePresetAsync( - new ActivateClimatePresetRequest( - climatePresetKey: climatePresetKey, - deviceId: deviceId - ) - ) - ); - } - - /// - /// Request parameters for Set to Cool Mode. - /// - [DataContract(Name = "coolRequest_request")] - public class CoolRequest - { - [JsonConstructorAttribute] - protected CoolRequest() { } - - public CoolRequest( - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default - ) - { - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - DeviceId = deviceId; - } - - /// - /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// ID of the thermostat device that you want to set to cool mode. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "coolResponse_response")] - public class CoolResponse - { - [JsonConstructorAttribute] - protected CoolResponse() { } - - public CoolResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [cool mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public ActionAttempt Cool(CoolRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/thermostats/cool", requestOptions) - .EnsureData("/thermostats/cool") - .ActionAttempt; - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [cool mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public ActionAttempt Cool( - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default - ) - { - return Cool( - new CoolRequest( - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - deviceId: deviceId - ) - ); - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [cool mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public async Task CoolAsync(CoolRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/thermostats/cool", requestOptions)) - .EnsureData("/thermostats/cool") - .ActionAttempt; - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [cool mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public async Task CoolAsync( - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default - ) - { - return ( - await CoolAsync( - new CoolRequest( - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - deviceId: deviceId - ) - ) - ); - } - - /// - /// Request parameters for Create a Climate Preset. - /// - [DataContract(Name = "createClimatePresetRequest_request")] - public class CreateClimatePresetRequest - { - [JsonConstructorAttribute] - protected CreateClimatePresetRequest() { } - - public CreateClimatePresetRequest( - string climatePresetKey = default, - CreateClimatePresetRequest.ClimatePresetModeEnum? climatePresetMode = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default, - CreateClimatePresetRequestEcobeeMetadata? ecobeeMetadata = default, - CreateClimatePresetRequest.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - CreateClimatePresetRequest.HvacModeSettingEnum? hvacModeSetting = default, - bool? manualOverrideAllowed = default, - string? name = default - ) - { - ClimatePresetKey = climatePresetKey; - ClimatePresetMode = climatePresetMode; - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - DeviceId = deviceId; - EcobeeMetadata = ecobeeMetadata; - FanModeSetting = fanModeSetting; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - HvacModeSetting = hvacModeSetting; - ManualOverrideAllowed = manualOverrideAllowed; - Name = name; - } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ClimatePresetModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "home")] - Home = 1, - - [EnumMember(Value = "away")] - Away = 2, - - [EnumMember(Value = "wake")] - Wake = 3, - - [EnumMember(Value = "sleep")] - Sleep = 4, - - [EnumMember(Value = "occupied")] - Occupied = 5, - - [EnumMember(Value = "unoccupied")] - Unoccupied = 6, - } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum FanModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum HvacModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "off")] - Off = 1, - - [EnumMember(Value = "heat")] - Heat = 2, - - [EnumMember(Value = "cool")] - Cool = 3, - - [EnumMember(Value = "heat_cool")] - HeatCool = 4, - - [EnumMember(Value = "eco")] - Eco = 5, - } - - /// - /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "climate_preset_key", IsRequired = true, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [DataMember(Name = "climate_preset_mode", IsRequired = false, EmitDefaultValue = false)] - public CreateClimatePresetRequest.ClimatePresetModeEnum? ClimatePresetMode { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// ID of the thermostat device for which you want create a climate preset. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Metadata specific to the Ecobee climate, if applicable. - /// - [DataMember(Name = "ecobee_metadata", IsRequired = false, EmitDefaultValue = false)] - public CreateClimatePresetRequestEcobeeMetadata? EcobeeMetadata { get; set; } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [DataMember(Name = "fan_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public CreateClimatePresetRequest.FanModeSettingEnum? FanModeSetting { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [DataMember(Name = "hvac_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public CreateClimatePresetRequest.HvacModeSettingEnum? HvacModeSetting { get; set; } - - /// - /// Indicates whether a person at the thermostat or using the API can change the thermostat's settings. - /// - [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] - [DataMember( - Name = "manual_override_allowed", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? ManualOverrideAllowed { get; set; } - - /// - /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createClimatePresetRequestEcobeeMetadata_model")] - public class CreateClimatePresetRequestEcobeeMetadata - { - [JsonConstructorAttribute] - protected CreateClimatePresetRequestEcobeeMetadata() { } - - public CreateClimatePresetRequestEcobeeMetadata( - string? climateRef = default, - bool? isOptimized = default, - CreateClimatePresetRequestEcobeeMetadata.OwnerEnum? owner = default - ) - { - ClimateRef = climateRef; - IsOptimized = isOptimized; - Owner = owner; - } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum OwnerEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "user")] - User = 1, - - [EnumMember(Value = "system")] - System = 2, - } - - /// - /// Reference to the Ecobee climate, if applicable. - /// - [DataMember(Name = "climate_ref", IsRequired = false, EmitDefaultValue = false)] - public string? ClimateRef { get; set; } - - /// - /// Indicates if the climate preset is optimized by Ecobee. - /// - [DataMember(Name = "is_optimized", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOptimized { get; set; } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [DataMember(Name = "owner", IsRequired = false, EmitDefaultValue = false)] - public CreateClimatePresetRequestEcobeeMetadata.OwnerEnum? Owner { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void CreateClimatePreset(CreateClimatePresetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/thermostats/create_climate_preset", requestOptions); - } - - /// - /// Creates a [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void CreateClimatePreset( - string climatePresetKey = default, - CreateClimatePresetRequest.ClimatePresetModeEnum? climatePresetMode = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default, - CreateClimatePresetRequestEcobeeMetadata? ecobeeMetadata = default, - CreateClimatePresetRequest.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - CreateClimatePresetRequest.HvacModeSettingEnum? hvacModeSetting = default, - bool? manualOverrideAllowed = default, - string? name = default - ) - { - CreateClimatePreset( - new CreateClimatePresetRequest( - climatePresetKey: climatePresetKey, - climatePresetMode: climatePresetMode, - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - deviceId: deviceId, - ecobeeMetadata: ecobeeMetadata, - fanModeSetting: fanModeSetting, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit, - hvacModeSetting: hvacModeSetting, - manualOverrideAllowed: manualOverrideAllowed, - name: name - ) - ); - } - - /// - /// Creates a [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task CreateClimatePresetAsync(CreateClimatePresetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/thermostats/create_climate_preset", requestOptions); - } - - /// - /// Creates a [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task CreateClimatePresetAsync( - string climatePresetKey = default, - CreateClimatePresetRequest.ClimatePresetModeEnum? climatePresetMode = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default, - CreateClimatePresetRequestEcobeeMetadata? ecobeeMetadata = default, - CreateClimatePresetRequest.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - CreateClimatePresetRequest.HvacModeSettingEnum? hvacModeSetting = default, - bool? manualOverrideAllowed = default, - string? name = default - ) - { - await CreateClimatePresetAsync( - new CreateClimatePresetRequest( - climatePresetKey: climatePresetKey, - climatePresetMode: climatePresetMode, - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - deviceId: deviceId, - ecobeeMetadata: ecobeeMetadata, - fanModeSetting: fanModeSetting, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit, - hvacModeSetting: hvacModeSetting, - manualOverrideAllowed: manualOverrideAllowed, - name: name - ) - ); - } - - /// - /// Request parameters for Delete a Climate Preset. - /// - [DataContract(Name = "deleteClimatePresetRequest_request")] - public class DeleteClimatePresetRequest - { - [JsonConstructorAttribute] - protected DeleteClimatePresetRequest() { } - - public DeleteClimatePresetRequest( - string climatePresetKey = default, - string deviceId = default - ) - { - ClimatePresetKey = climatePresetKey; - DeviceId = deviceId; - } - - /// - /// Climate preset key of the climate preset that you want to delete. - /// - [DataMember(Name = "climate_preset_key", IsRequired = true, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// ID of the thermostat device for which you want to delete a climate preset. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void DeleteClimatePreset(DeleteClimatePresetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/thermostats/delete_climate_preset", requestOptions); - } - - /// - /// Deletes a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void DeleteClimatePreset( - string climatePresetKey = default, - string deviceId = default - ) - { - DeleteClimatePreset( - new DeleteClimatePresetRequest( - climatePresetKey: climatePresetKey, - deviceId: deviceId - ) - ); - } - - /// - /// Deletes a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task DeleteClimatePresetAsync(DeleteClimatePresetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/thermostats/delete_climate_preset", requestOptions); - } - - /// - /// Deletes a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task DeleteClimatePresetAsync( - string climatePresetKey = default, - string deviceId = default - ) - { - await DeleteClimatePresetAsync( - new DeleteClimatePresetRequest( - climatePresetKey: climatePresetKey, - deviceId: deviceId - ) - ); - } - - /// - /// Request parameters for Set to Heat Mode. - /// - [DataContract(Name = "heatRequest_request")] - public class HeatRequest - { - [JsonConstructorAttribute] - protected HeatRequest() { } - - public HeatRequest( - string deviceId = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - DeviceId = deviceId; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - } - - /// - /// ID of the thermostat device that you want to set to heat mode. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "heatResponse_response")] - public class HeatResponse - { - [JsonConstructorAttribute] - protected HeatResponse() { } - - public HeatResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public ActionAttempt Heat(HeatRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/thermostats/heat", requestOptions) - .EnsureData("/thermostats/heat") - .ActionAttempt; - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public ActionAttempt Heat( - string deviceId = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - return Heat( - new HeatRequest( - deviceId: deviceId, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit - ) - ); - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public async Task HeatAsync(HeatRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/thermostats/heat", requestOptions)) - .EnsureData("/thermostats/heat") - .ActionAttempt; - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public async Task HeatAsync( - string deviceId = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - return ( - await HeatAsync( - new HeatRequest( - deviceId: deviceId, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit - ) - ) - ); - } - - /// - /// Request parameters for Set to Heat-Cool (Auto) Mode. - /// - [DataContract(Name = "heatCoolRequest_request")] - public class HeatCoolRequest - { - [JsonConstructorAttribute] - protected HeatCoolRequest() { } - - public HeatCoolRequest( - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - DeviceId = deviceId; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - } - - /// - /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// ID of the thermostat device that you want to set to heat-cool mode. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "heatCoolResponse_response")] - public class HeatCoolResponse - { - [JsonConstructorAttribute] - protected HeatCoolResponse() { } - - public HeatCoolResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat-cool ("auto") mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public ActionAttempt HeatCool(HeatCoolRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/thermostats/heat_cool", requestOptions) - .EnsureData("/thermostats/heat_cool") - .ActionAttempt; - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat-cool ("auto") mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public ActionAttempt HeatCool( - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - return HeatCool( - new HeatCoolRequest( - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - deviceId: deviceId, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit - ) - ); - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat-cool ("auto") mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public async Task HeatCoolAsync(HeatCoolRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync("/thermostats/heat_cool", requestOptions) - ) - .EnsureData("/thermostats/heat_cool") - .ActionAttempt; - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat-cool ("auto") mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public async Task HeatCoolAsync( - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - return ( - await HeatCoolAsync( - new HeatCoolRequest( - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - deviceId: deviceId, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit - ) - ) - ); - } - - /// - /// Request parameters for List Thermostats. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - ListRequest.ManufacturerEnum? manufacturer = default - ) - { - ConnectWebviewId = connectWebviewId; - ConnectedAccountId = connectedAccountId; - CustomerKey = customerKey; - DeviceType = deviceType; - DeviceTypes = deviceTypes; - Manufacturer = manufacturer; - } - - /// - /// Device type by which you want to filter thermostat devices. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 1, - - [EnumMember(Value = "nest_thermostat")] - NestThermostat = 2, - - [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 3, - - [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 4, - - [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 5, - - [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 6, - } - - /// - /// Array of device types by which you want to filter thermostat devices. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypesEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 1, - - [EnumMember(Value = "nest_thermostat")] - NestThermostat = 2, - - [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 3, - - [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 4, - - [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 5, - - [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 6, - } - - /// - /// Manufacturer by which you want to filter thermostat devices. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ManufacturerEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "ecobee")] - Ecobee = 1, - - [EnumMember(Value = "honeywell_resideo")] - HoneywellResideo = 2, - - [EnumMember(Value = "nest")] - Nest = 3, - - [EnumMember(Value = "sensi")] - Sensi = 4, - - [EnumMember(Value = "smartthings")] - Smartthings = 5, - - [EnumMember(Value = "tado")] - Tado = 6, - } - - /// - /// ID of the Connect Webview for which you want to list devices. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectWebviewId { get; set; } - - /// - /// ID of the connected account for which you want to list devices. - /// - [DataMember( - Name = "connected_account_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectedAccountId { get; set; } - - /// - /// Customer key for which you want to list devices. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Device type by which you want to filter thermostat devices. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.DeviceTypeEnum? DeviceType { get; set; } - - /// - /// Array of device types by which you want to filter thermostat devices. - /// - [DataMember(Name = "device_types", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceTypes { get; set; } - - /// - /// Manufacturer by which you want to filter thermostat devices. - /// - [DataMember(Name = "manufacturer", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.ManufacturerEnum? Manufacturer { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List devices = default) - { - Devices = devices; - } - - /// - /// OK - /// - [DataMember(Name = "devices", IsRequired = false, EmitDefaultValue = false)] - public List Devices { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [thermostats](https://docs.seam.co/capability-guides/thermostats). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/thermostats/list", requestOptions) - .EnsureData("/thermostats/list") - .Devices; - } - - /// - /// Returns a list of all [thermostats](https://docs.seam.co/capability-guides/thermostats). - /// - public List List( - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - ListRequest.ManufacturerEnum? manufacturer = default - ) - { - return List( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - deviceType: deviceType, - deviceTypes: deviceTypes, - manufacturer: manufacturer - ) - ); - } - - /// - /// Returns a list of all [thermostats](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/thermostats/list", requestOptions)) - .EnsureData("/thermostats/list") - .Devices; - } - - /// - /// Returns a list of all [thermostats](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task> ListAsync( - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - ListRequest.ManufacturerEnum? manufacturer = default - ) - { - return ( - await ListAsync( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - deviceType: deviceType, - deviceTypes: deviceTypes, - manufacturer: manufacturer - ) - ) - ); - } - - /// - /// Request parameters for Set to Off Mode. - /// - [DataContract(Name = "offRequest_request")] - public class OffRequest - { - [JsonConstructorAttribute] - protected OffRequest() { } - - public OffRequest(string deviceId = default) - { - DeviceId = deviceId; - } - - /// - /// ID of the thermostat device that you want to set to off mode. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "offResponse_response")] - public class OffResponse - { - [JsonConstructorAttribute] - protected OffResponse() { } - - public OffResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to ["off" mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public ActionAttempt Off(OffRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/thermostats/off", requestOptions) - .EnsureData("/thermostats/off") - .ActionAttempt; - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to ["off" mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public ActionAttempt Off(string deviceId = default) - { - return Off(new OffRequest(deviceId: deviceId)); - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to ["off" mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public async Task OffAsync(OffRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/thermostats/off", requestOptions)) - .EnsureData("/thermostats/off") - .ActionAttempt; - } - - /// - /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to ["off" mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). - /// - public async Task OffAsync(string deviceId = default) - { - return (await OffAsync(new OffRequest(deviceId: deviceId))); - } - - /// - /// Request parameters for Set the Fallback Climate Preset. - /// - [DataContract(Name = "setFallbackClimatePresetRequest_request")] - public class SetFallbackClimatePresetRequest - { - [JsonConstructorAttribute] - protected SetFallbackClimatePresetRequest() { } - - public SetFallbackClimatePresetRequest( - string climatePresetKey = default, - string deviceId = default - ) - { - ClimatePresetKey = climatePresetKey; - DeviceId = deviceId; - } - - /// - /// Climate preset key of the climate preset that you want to set as the fallback climate preset. - /// - [DataMember(Name = "climate_preset_key", IsRequired = true, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// ID of the thermostat device for which you want to set the fallback climate preset. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Sets a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) as the ["fallback"](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) preset for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void SetFallbackClimatePreset(SetFallbackClimatePresetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/thermostats/set_fallback_climate_preset", requestOptions); - } - - /// - /// Sets a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) as the ["fallback"](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) preset for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void SetFallbackClimatePreset( - string climatePresetKey = default, - string deviceId = default - ) - { - SetFallbackClimatePreset( - new SetFallbackClimatePresetRequest( - climatePresetKey: climatePresetKey, - deviceId: deviceId - ) - ); - } - - /// - /// Sets a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) as the ["fallback"](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) preset for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task SetFallbackClimatePresetAsync(SetFallbackClimatePresetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/thermostats/set_fallback_climate_preset", - requestOptions - ); - } - - /// - /// Sets a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) as the ["fallback"](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) preset for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task SetFallbackClimatePresetAsync( - string climatePresetKey = default, - string deviceId = default - ) - { - await SetFallbackClimatePresetAsync( - new SetFallbackClimatePresetRequest( - climatePresetKey: climatePresetKey, - deviceId: deviceId - ) - ); - } - - /// - /// Request parameters for Set the Fan Mode Setting. - /// - [DataContract(Name = "setFanModeRequest_request")] - public class SetFanModeRequest - { - [JsonConstructorAttribute] - protected SetFanModeRequest() { } - - public SetFanModeRequest( - string deviceId = default, - SetFanModeRequest.FanModeEnum? fanMode = default, - SetFanModeRequest.FanModeSettingEnum? fanModeSetting = default - ) - { - DeviceId = deviceId; - FanMode = fanMode; - FanModeSetting = fanModeSetting; - } - - /// - /// Fan mode setting for the thermostat, such as `auto`, `on`, or `circulate`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum FanModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// [Fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) that you want to set for the thermostat. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum FanModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// ID of the thermostat device for which you want to set the fan mode. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Fan mode setting for the thermostat, such as `auto`, `on`, or `circulate`. - /// - [Obsolete("Use `fan_mode_setting` instead.")] - [DataMember(Name = "fan_mode", IsRequired = false, EmitDefaultValue = false)] - public SetFanModeRequest.FanModeEnum? FanMode { get; set; } - - /// - /// [Fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) that you want to set for the thermostat. - /// - [DataMember(Name = "fan_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public SetFanModeRequest.FanModeSettingEnum? FanModeSetting { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "setFanModeResponse_response")] - public class SetFanModeResponse - { - [JsonConstructorAttribute] - protected SetFanModeResponse() { } - - public SetFanModeResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Sets the [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public ActionAttempt SetFanMode(SetFanModeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/thermostats/set_fan_mode", requestOptions) - .EnsureData("/thermostats/set_fan_mode") - .ActionAttempt; - } - - /// - /// Sets the [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public ActionAttempt SetFanMode( - string deviceId = default, - SetFanModeRequest.FanModeEnum? fanMode = default, - SetFanModeRequest.FanModeSettingEnum? fanModeSetting = default - ) - { - return SetFanMode( - new SetFanModeRequest( - deviceId: deviceId, - fanMode: fanMode, - fanModeSetting: fanModeSetting - ) - ); - } - - /// - /// Sets the [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task SetFanModeAsync(SetFanModeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/thermostats/set_fan_mode", - requestOptions - ) - ) - .EnsureData("/thermostats/set_fan_mode") - .ActionAttempt; - } - - /// - /// Sets the [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task SetFanModeAsync( - string deviceId = default, - SetFanModeRequest.FanModeEnum? fanMode = default, - SetFanModeRequest.FanModeSettingEnum? fanModeSetting = default - ) - { - return ( - await SetFanModeAsync( - new SetFanModeRequest( - deviceId: deviceId, - fanMode: fanMode, - fanModeSetting: fanModeSetting - ) - ) - ); - } - - /// - /// Request parameters for Set the HVAC Mode. - /// - [DataContract(Name = "setHvacModeRequest_request")] - public class SetHvacModeRequest - { - [JsonConstructorAttribute] - protected SetHvacModeRequest() { } - - public SetHvacModeRequest( - string deviceId = default, - SetHvacModeRequest.HvacModeSettingEnum hvacModeSetting = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - DeviceId = deviceId; - HvacModeSetting = hvacModeSetting; - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum HvacModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "off")] - Off = 1, - - [EnumMember(Value = "cool")] - Cool = 2, - - [EnumMember(Value = "heat")] - Heat = 3, - - [EnumMember(Value = "heat_cool")] - HeatCool = 4, - - [EnumMember(Value = "eco")] - Eco = 5, - } - - /// - /// ID of the thermostat device for which you want to set the HVAC mode. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - [DataMember(Name = "hvac_mode_setting", IsRequired = true, EmitDefaultValue = false)] - public SetHvacModeRequest.HvacModeSettingEnum HvacModeSetting { get; set; } - - /// - /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "setHvacModeResponse_response")] - public class SetHvacModeResponse - { - [JsonConstructorAttribute] - protected SetHvacModeResponse() { } - - public SetHvacModeResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Sets the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public ActionAttempt SetHvacMode(SetHvacModeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/thermostats/set_hvac_mode", requestOptions) - .EnsureData("/thermostats/set_hvac_mode") - .ActionAttempt; - } - - /// - /// Sets the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public ActionAttempt SetHvacMode( - string deviceId = default, - SetHvacModeRequest.HvacModeSettingEnum hvacModeSetting = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - return SetHvacMode( - new SetHvacModeRequest( - deviceId: deviceId, - hvacModeSetting: hvacModeSetting, - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit - ) - ); - } - - /// - /// Sets the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task SetHvacModeAsync(SetHvacModeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/thermostats/set_hvac_mode", - requestOptions - ) - ) - .EnsureData("/thermostats/set_hvac_mode") - .ActionAttempt; - } - - /// - /// Sets the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task SetHvacModeAsync( - string deviceId = default, - SetHvacModeRequest.HvacModeSettingEnum hvacModeSetting = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default - ) - { - return ( - await SetHvacModeAsync( - new SetHvacModeRequest( - deviceId: deviceId, - hvacModeSetting: hvacModeSetting, - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit - ) - ) - ); - } - - /// - /// Request parameters for Set a Temperature Threshold. - /// - [DataContract(Name = "setTemperatureThresholdRequest_request")] - public class SetTemperatureThresholdRequest - { - [JsonConstructorAttribute] - protected SetTemperatureThresholdRequest() { } - - public SetTemperatureThresholdRequest( - string deviceId = default, - float? lowerLimitCelsius = default, - float? lowerLimitFahrenheit = default, - float? upperLimitCelsius = default, - float? upperLimitFahrenheit = default - ) - { - DeviceId = deviceId; - LowerLimitCelsius = lowerLimitCelsius; - LowerLimitFahrenheit = lowerLimitFahrenheit; - UpperLimitCelsius = upperLimitCelsius; - UpperLimitFahrenheit = upperLimitFahrenheit; - } - - /// - /// ID of the thermostat device for which you want to set a temperature threshold. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Lower temperature limit in in °C. Seam alerts you if the reported temperature is lower than this value. You can specify either `lower_limit` but not both. - /// - [DataMember(Name = "lower_limit_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? LowerLimitCelsius { get; set; } - - /// - /// Lower temperature limit in in °F. Seam alerts you if the reported temperature is lower than this value. You can specify either `lower_limit` but not both. - /// - [DataMember( - Name = "lower_limit_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? LowerLimitFahrenheit { get; set; } - - /// - /// Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either `upper_limit` but not both. - /// - [DataMember(Name = "upper_limit_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? UpperLimitCelsius { get; set; } - - /// - /// Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either `upper_limit` but not both. - /// - [DataMember( - Name = "upper_limit_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? UpperLimitFahrenheit { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Sets a [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) for a specified thermostat. Seam emits a `thermostat.temperature_threshold_exceeded` event and adds a warning on a thermostat if it reports a temperature outside the threshold range. - /// - public void SetTemperatureThreshold(SetTemperatureThresholdRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/thermostats/set_temperature_threshold", requestOptions); - } - - /// - /// Sets a [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) for a specified thermostat. Seam emits a `thermostat.temperature_threshold_exceeded` event and adds a warning on a thermostat if it reports a temperature outside the threshold range. - /// - public void SetTemperatureThreshold( - string deviceId = default, - float? lowerLimitCelsius = default, - float? lowerLimitFahrenheit = default, - float? upperLimitCelsius = default, - float? upperLimitFahrenheit = default - ) - { - SetTemperatureThreshold( - new SetTemperatureThresholdRequest( - deviceId: deviceId, - lowerLimitCelsius: lowerLimitCelsius, - lowerLimitFahrenheit: lowerLimitFahrenheit, - upperLimitCelsius: upperLimitCelsius, - upperLimitFahrenheit: upperLimitFahrenheit - ) - ); - } - - /// - /// Sets a [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) for a specified thermostat. Seam emits a `thermostat.temperature_threshold_exceeded` event and adds a warning on a thermostat if it reports a temperature outside the threshold range. - /// - public async Task SetTemperatureThresholdAsync(SetTemperatureThresholdRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync( - "/thermostats/set_temperature_threshold", - requestOptions - ); - } - - /// - /// Sets a [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) for a specified thermostat. Seam emits a `thermostat.temperature_threshold_exceeded` event and adds a warning on a thermostat if it reports a temperature outside the threshold range. - /// - public async Task SetTemperatureThresholdAsync( - string deviceId = default, - float? lowerLimitCelsius = default, - float? lowerLimitFahrenheit = default, - float? upperLimitCelsius = default, - float? upperLimitFahrenheit = default - ) - { - await SetTemperatureThresholdAsync( - new SetTemperatureThresholdRequest( - deviceId: deviceId, - lowerLimitCelsius: lowerLimitCelsius, - lowerLimitFahrenheit: lowerLimitFahrenheit, - upperLimitCelsius: upperLimitCelsius, - upperLimitFahrenheit: upperLimitFahrenheit - ) - ); - } - - /// - /// Request parameters for Update a Climate Preset. - /// - [DataContract(Name = "updateClimatePresetRequest_request")] - public class UpdateClimatePresetRequest - { - [JsonConstructorAttribute] - protected UpdateClimatePresetRequest() { } - - public UpdateClimatePresetRequest( - string climatePresetKey = default, - UpdateClimatePresetRequest.ClimatePresetModeEnum? climatePresetMode = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default, - UpdateClimatePresetRequestEcobeeMetadata? ecobeeMetadata = default, - UpdateClimatePresetRequest.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - UpdateClimatePresetRequest.HvacModeSettingEnum? hvacModeSetting = default, - bool? manualOverrideAllowed = default, - string? name = default - ) - { - ClimatePresetKey = climatePresetKey; - ClimatePresetMode = climatePresetMode; - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - DeviceId = deviceId; - EcobeeMetadata = ecobeeMetadata; - FanModeSetting = fanModeSetting; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - HvacModeSetting = hvacModeSetting; - ManualOverrideAllowed = manualOverrideAllowed; - Name = name; - } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ClimatePresetModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "home")] - Home = 1, - - [EnumMember(Value = "away")] - Away = 2, - - [EnumMember(Value = "wake")] - Wake = 3, - - [EnumMember(Value = "sleep")] - Sleep = 4, - - [EnumMember(Value = "occupied")] - Occupied = 5, - - [EnumMember(Value = "unoccupied")] - Unoccupied = 6, - } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum FanModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum HvacModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "off")] - Off = 1, - - [EnumMember(Value = "heat")] - Heat = 2, - - [EnumMember(Value = "cool")] - Cool = 3, - - [EnumMember(Value = "heat_cool")] - HeatCool = 4, - - [EnumMember(Value = "eco")] - Eco = 5, - } - - /// - /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "climate_preset_key", IsRequired = true, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [DataMember(Name = "climate_preset_mode", IsRequired = false, EmitDefaultValue = false)] - public UpdateClimatePresetRequest.ClimatePresetModeEnum? ClimatePresetMode { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// ID of the thermostat device for which you want to update a climate preset. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Metadata specific to the Ecobee climate, if applicable. - /// - [DataMember(Name = "ecobee_metadata", IsRequired = false, EmitDefaultValue = false)] - public UpdateClimatePresetRequestEcobeeMetadata? EcobeeMetadata { get; set; } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [DataMember(Name = "fan_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public UpdateClimatePresetRequest.FanModeSettingEnum? FanModeSetting { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [DataMember(Name = "hvac_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public UpdateClimatePresetRequest.HvacModeSettingEnum? HvacModeSetting { get; set; } - - /// - /// Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] - [DataMember( - Name = "manual_override_allowed", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? ManualOverrideAllowed { get; set; } - - /// - /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "updateClimatePresetRequestEcobeeMetadata_model")] - public class UpdateClimatePresetRequestEcobeeMetadata - { - [JsonConstructorAttribute] - protected UpdateClimatePresetRequestEcobeeMetadata() { } - - public UpdateClimatePresetRequestEcobeeMetadata( - string? climateRef = default, - bool? isOptimized = default, - UpdateClimatePresetRequestEcobeeMetadata.OwnerEnum? owner = default - ) - { - ClimateRef = climateRef; - IsOptimized = isOptimized; - Owner = owner; - } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum OwnerEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "user")] - User = 1, - - [EnumMember(Value = "system")] - System = 2, - } - - /// - /// Reference to the Ecobee climate, if applicable. - /// - [DataMember(Name = "climate_ref", IsRequired = false, EmitDefaultValue = false)] - public string? ClimateRef { get; set; } - - /// - /// Indicates if the climate preset is optimized by Ecobee. - /// - [DataMember(Name = "is_optimized", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOptimized { get; set; } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [DataMember(Name = "owner", IsRequired = false, EmitDefaultValue = false)] - public UpdateClimatePresetRequestEcobeeMetadata.OwnerEnum? Owner { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void UpdateClimatePreset(UpdateClimatePresetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/thermostats/update_climate_preset", requestOptions); - } - - /// - /// Updates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public void UpdateClimatePreset( - string climatePresetKey = default, - UpdateClimatePresetRequest.ClimatePresetModeEnum? climatePresetMode = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default, - UpdateClimatePresetRequestEcobeeMetadata? ecobeeMetadata = default, - UpdateClimatePresetRequest.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - UpdateClimatePresetRequest.HvacModeSettingEnum? hvacModeSetting = default, - bool? manualOverrideAllowed = default, - string? name = default - ) - { - UpdateClimatePreset( - new UpdateClimatePresetRequest( - climatePresetKey: climatePresetKey, - climatePresetMode: climatePresetMode, - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - deviceId: deviceId, - ecobeeMetadata: ecobeeMetadata, - fanModeSetting: fanModeSetting, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit, - hvacModeSetting: hvacModeSetting, - manualOverrideAllowed: manualOverrideAllowed, - name: name - ) - ); - } - - /// - /// Updates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task UpdateClimatePresetAsync(UpdateClimatePresetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/thermostats/update_climate_preset", requestOptions); - } - - /// - /// Updates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). - /// - public async Task UpdateClimatePresetAsync( - string climatePresetKey = default, - UpdateClimatePresetRequest.ClimatePresetModeEnum? climatePresetMode = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string deviceId = default, - UpdateClimatePresetRequestEcobeeMetadata? ecobeeMetadata = default, - UpdateClimatePresetRequest.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - UpdateClimatePresetRequest.HvacModeSettingEnum? hvacModeSetting = default, - bool? manualOverrideAllowed = default, - string? name = default - ) - { - await UpdateClimatePresetAsync( - new UpdateClimatePresetRequest( - climatePresetKey: climatePresetKey, - climatePresetMode: climatePresetMode, - coolingSetPointCelsius: coolingSetPointCelsius, - coolingSetPointFahrenheit: coolingSetPointFahrenheit, - deviceId: deviceId, - ecobeeMetadata: ecobeeMetadata, - fanModeSetting: fanModeSetting, - heatingSetPointCelsius: heatingSetPointCelsius, - heatingSetPointFahrenheit: heatingSetPointFahrenheit, - hvacModeSetting: hvacModeSetting, - manualOverrideAllowed: manualOverrideAllowed, - name: name - ) - ); - } - - /// - /// Request parameters for Update the Thermostat Weekly Program. - /// - [DataContract(Name = "updateWeeklyProgramRequest_request")] - public class UpdateWeeklyProgramRequest - { - [JsonConstructorAttribute] - protected UpdateWeeklyProgramRequest() { } - - public UpdateWeeklyProgramRequest( - string deviceId = default, - string? fridayProgramId = default, - string? mondayProgramId = default, - string? saturdayProgramId = default, - string? sundayProgramId = default, - string? thursdayProgramId = default, - string? tuesdayProgramId = default, - string? wednesdayProgramId = default - ) - { - DeviceId = deviceId; - FridayProgramId = fridayProgramId; - MondayProgramId = mondayProgramId; - SaturdayProgramId = saturdayProgramId; - SundayProgramId = sundayProgramId; - ThursdayProgramId = thursdayProgramId; - TuesdayProgramId = tuesdayProgramId; - WednesdayProgramId = wednesdayProgramId; - } - - /// - /// ID of the thermostat device for which you want to update the weekly program. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// ID of the thermostat daily program to run on Fridays. - /// - [DataMember(Name = "friday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? FridayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Mondays. - /// - [DataMember(Name = "monday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? MondayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Saturdays. - /// - [DataMember(Name = "saturday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? SaturdayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Sundays. - /// - [DataMember(Name = "sunday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? SundayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Thursdays. - /// - [DataMember(Name = "thursday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? ThursdayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Tuesdays. - /// - [DataMember(Name = "tuesday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? TuesdayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Wednesdays. - /// - [DataMember( - Name = "wednesday_program_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? WednesdayProgramId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "updateWeeklyProgramResponse_response")] - public class UpdateWeeklyProgramResponse - { - [JsonConstructorAttribute] - protected UpdateWeeklyProgramResponse() { } - - public UpdateWeeklyProgramResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates the thermostat weekly program for a thermostat device. To configure a weekly program, specify the ID of the daily program that you want to use for each day of the week. When you update a weekly program, the set of programs that you specify overwrites any previous weekly program for the thermostat. - /// - public ActionAttempt UpdateWeeklyProgram(UpdateWeeklyProgramRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post( - "/thermostats/update_weekly_program", - requestOptions - ) - .EnsureData("/thermostats/update_weekly_program") - .ActionAttempt; - } - - /// - /// Updates the thermostat weekly program for a thermostat device. To configure a weekly program, specify the ID of the daily program that you want to use for each day of the week. When you update a weekly program, the set of programs that you specify overwrites any previous weekly program for the thermostat. - /// - public ActionAttempt UpdateWeeklyProgram( - string deviceId = default, - string? fridayProgramId = default, - string? mondayProgramId = default, - string? saturdayProgramId = default, - string? sundayProgramId = default, - string? thursdayProgramId = default, - string? tuesdayProgramId = default, - string? wednesdayProgramId = default - ) - { - return UpdateWeeklyProgram( - new UpdateWeeklyProgramRequest( - deviceId: deviceId, - fridayProgramId: fridayProgramId, - mondayProgramId: mondayProgramId, - saturdayProgramId: saturdayProgramId, - sundayProgramId: sundayProgramId, - thursdayProgramId: thursdayProgramId, - tuesdayProgramId: tuesdayProgramId, - wednesdayProgramId: wednesdayProgramId - ) - ); - } - - /// - /// Updates the thermostat weekly program for a thermostat device. To configure a weekly program, specify the ID of the daily program that you want to use for each day of the week. When you update a weekly program, the set of programs that you specify overwrites any previous weekly program for the thermostat. - /// - public async Task UpdateWeeklyProgramAsync( - UpdateWeeklyProgramRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/thermostats/update_weekly_program", - requestOptions - ) - ) - .EnsureData("/thermostats/update_weekly_program") - .ActionAttempt; - } - - /// - /// Updates the thermostat weekly program for a thermostat device. To configure a weekly program, specify the ID of the daily program that you want to use for each day of the week. When you update a weekly program, the set of programs that you specify overwrites any previous weekly program for the thermostat. - /// - public async Task UpdateWeeklyProgramAsync( - string deviceId = default, - string? fridayProgramId = default, - string? mondayProgramId = default, - string? saturdayProgramId = default, - string? sundayProgramId = default, - string? thursdayProgramId = default, - string? tuesdayProgramId = default, - string? wednesdayProgramId = default - ) - { - return ( - await UpdateWeeklyProgramAsync( - new UpdateWeeklyProgramRequest( - deviceId: deviceId, - fridayProgramId: fridayProgramId, - mondayProgramId: mondayProgramId, - saturdayProgramId: saturdayProgramId, - sundayProgramId: sundayProgramId, - thursdayProgramId: thursdayProgramId, - tuesdayProgramId: tuesdayProgramId, - wednesdayProgramId: wednesdayProgramId - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.Thermostats Thermostats => new(this); - } - - public partial interface ISeamClient - { - public Api.Thermostats Thermostats { get; } - } -} diff --git a/src/Seam/Api/UnmanagedAccessCodes.cs b/src/Seam/Api/UnmanagedAccessCodes.cs deleted file mode 100644 index c7b4a584..00000000 --- a/src/Seam/Api/UnmanagedAccessCodes.cs +++ /dev/null @@ -1,748 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class UnmanagedAccessCodes - { - private ISeamClient _seam; - - public UnmanagedAccessCodes(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Convert an Unmanaged Access Code. - /// - [DataContract(Name = "convertToManagedRequest_request")] - public class ConvertToManagedRequest - { - [JsonConstructorAttribute] - protected ConvertToManagedRequest() { } - - public ConvertToManagedRequest( - string accessCodeId = default, - bool? allowExternalModification = default, - bool? force = default, - bool? isExternalModificationAllowed = default - ) - { - AccessCodeId = accessCodeId; - AllowExternalModification = allowExternalModification; - Force = force; - IsExternalModificationAllowed = isExternalModificationAllowed; - } - - /// - /// ID of the unmanaged access code that you want to convert to a managed access code. - /// - [DataMember(Name = "access_code_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the access code is allowed. - /// - [DataMember( - Name = "allow_external_modification", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AllowExternalModification { get; set; } - - /// - /// Indicates whether to force the access code conversion. To switch management of an access code from one Seam workspace to another, set `force` to `true`. - /// - [DataMember(Name = "force", IsRequired = false, EmitDefaultValue = false)] - public bool? Force { get; set; } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the access code is allowed. - /// - [DataMember( - Name = "is_external_modification_allowed", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsExternalModificationAllowed { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Converts an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) to an [access code managed through Seam](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// An unmanaged access code has a limited set of operations that you can perform on it. Once you convert an unmanaged access code to a managed access code, the full set of access code operations and lifecycle events becomes available for it. - /// - /// Note that not all device providers support converting an unmanaged access code to a managed access code. - /// - public void ConvertToManaged(ConvertToManagedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/access_codes/unmanaged/convert_to_managed", requestOptions); - } - - /// - /// Converts an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) to an [access code managed through Seam](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// An unmanaged access code has a limited set of operations that you can perform on it. Once you convert an unmanaged access code to a managed access code, the full set of access code operations and lifecycle events becomes available for it. - /// - /// Note that not all device providers support converting an unmanaged access code to a managed access code. - /// - public void ConvertToManaged( - string accessCodeId = default, - bool? allowExternalModification = default, - bool? force = default, - bool? isExternalModificationAllowed = default - ) - { - ConvertToManaged( - new ConvertToManagedRequest( - accessCodeId: accessCodeId, - allowExternalModification: allowExternalModification, - force: force, - isExternalModificationAllowed: isExternalModificationAllowed - ) - ); - } - - /// - /// Converts an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) to an [access code managed through Seam](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// An unmanaged access code has a limited set of operations that you can perform on it. Once you convert an unmanaged access code to a managed access code, the full set of access code operations and lifecycle events becomes available for it. - /// - /// Note that not all device providers support converting an unmanaged access code to a managed access code. - /// - public async Task ConvertToManagedAsync(ConvertToManagedRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync( - "/access_codes/unmanaged/convert_to_managed", - requestOptions - ); - } - - /// - /// Converts an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) to an [access code managed through Seam](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// An unmanaged access code has a limited set of operations that you can perform on it. Once you convert an unmanaged access code to a managed access code, the full set of access code operations and lifecycle events becomes available for it. - /// - /// Note that not all device providers support converting an unmanaged access code to a managed access code. - /// - public async Task ConvertToManagedAsync( - string accessCodeId = default, - bool? allowExternalModification = default, - bool? force = default, - bool? isExternalModificationAllowed = default - ) - { - await ConvertToManagedAsync( - new ConvertToManagedRequest( - accessCodeId: accessCodeId, - allowExternalModification: allowExternalModification, - force: force, - isExternalModificationAllowed: isExternalModificationAllowed - ) - ); - } - - /// - /// Request parameters for Delete an Unmanaged Access Code. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string accessCodeId = default) - { - AccessCodeId = accessCodeId; - } - - /// - /// ID of the unmanaged access code that you want to delete. - /// - [DataMember(Name = "access_code_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/access_codes/unmanaged/delete", requestOptions); - } - - /// - /// Deletes an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public void Delete(string accessCodeId = default) - { - Delete(new DeleteRequest(accessCodeId: accessCodeId)); - } - - /// - /// Deletes an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/access_codes/unmanaged/delete", requestOptions); - } - - /// - /// Deletes an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public async Task DeleteAsync(string accessCodeId = default) - { - await DeleteAsync(new DeleteRequest(accessCodeId: accessCodeId)); - } - - /// - /// Request parameters for Get an Unmanaged Access Code. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest( - string? accessCodeId = default, - string? code = default, - string? deviceId = default - ) - { - AccessCodeId = accessCodeId; - Code = code; - DeviceId = deviceId; - } - - /// - /// ID of the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessCodeId { get; set; } - - /// - /// Code of the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// ID of the device containing the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(UnmanagedAccessCode accessCode = default) - { - AccessCode = accessCode; - } - - /// - /// OK - /// - [DataMember(Name = "access_code", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessCode AccessCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - /// You must specify either `access_code_id` or both `device_id` and `code`. - /// - public UnmanagedAccessCode Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_codes/unmanaged/get", requestOptions) - .EnsureData("/access_codes/unmanaged/get") - .AccessCode; - } - - /// - /// Returns a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - /// You must specify either `access_code_id` or both `device_id` and `code`. - /// - public UnmanagedAccessCode Get( - string? accessCodeId = default, - string? code = default, - string? deviceId = default - ) - { - return Get(new GetRequest(accessCodeId: accessCodeId, code: code, deviceId: deviceId)); - } - - /// - /// Returns a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - /// You must specify either `access_code_id` or both `device_id` and `code`. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync("/access_codes/unmanaged/get", requestOptions) - ) - .EnsureData("/access_codes/unmanaged/get") - .AccessCode; - } - - /// - /// Returns a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - /// You must specify either `access_code_id` or both `device_id` and `code`. - /// - public async Task GetAsync( - string? accessCodeId = default, - string? code = default, - string? deviceId = default - ) - { - return ( - await GetAsync( - new GetRequest(accessCodeId: accessCodeId, code: code, deviceId: deviceId) - ) - ); - } - - /// - /// Request parameters for List Unmanaged Access Codes. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string deviceId = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentifierKey = default - ) - { - DeviceId = deviceId; - Limit = limit; - PageCursor = pageCursor; - Search = search; - UserIdentifierKey = userIdentifierKey; - } - - /// - /// ID of the device for which you want to list unmanaged access codes. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Numerical limit on the number of unmanaged access codes to return. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned access codes to include all records that satisfy a partial match using `name`, `code` or `access_code_id`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// Your user ID for the user by which to filter unmanaged access codes. - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List accessCodes = default) - { - AccessCodes = accessCodes; - } - - /// - /// OK - /// - [DataMember(Name = "access_codes", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodes { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [unmanaged access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_codes/unmanaged/list", requestOptions) - .EnsureData("/access_codes/unmanaged/list") - .AccessCodes; - } - - /// - /// Returns a list of all [unmanaged access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public List List( - string deviceId = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentifierKey = default - ) - { - return List( - new ListRequest( - deviceId: deviceId, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentifierKey: userIdentifierKey - ) - ); - } - - /// - /// Returns a list of all [unmanaged access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync("/access_codes/unmanaged/list", requestOptions) - ) - .EnsureData("/access_codes/unmanaged/list") - .AccessCodes; - } - - /// - /// Returns a list of all [unmanaged access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public async Task> ListAsync( - string deviceId = default, - float? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentifierKey = default - ) - { - return ( - await ListAsync( - new ListRequest( - deviceId: deviceId, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentifierKey: userIdentifierKey - ) - ) - ); - } - - /// - /// Request parameters for Update an Unmanaged Access Code. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string accessCodeId = default, - bool? allowExternalModification = default, - bool? force = default, - bool? isExternalModificationAllowed = default, - bool isManaged = default - ) - { - AccessCodeId = accessCodeId; - AllowExternalModification = allowExternalModification; - Force = force; - IsExternalModificationAllowed = isExternalModificationAllowed; - IsManaged = isManaged; - } - - /// - /// ID of the unmanaged access code that you want to update. - /// - [DataMember(Name = "access_code_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. - /// - [DataMember( - Name = "allow_external_modification", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AllowExternalModification { get; set; } - - /// - /// Indicates whether to force the unmanaged access code update. - /// - [DataMember(Name = "force", IsRequired = false, EmitDefaultValue = false)] - public bool? Force { get; set; } - - /// - /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. - /// - [DataMember( - Name = "is_external_modification_allowed", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsExternalModificationAllowed { get; set; } - - [DataMember(Name = "is_managed", IsRequired = true, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/access_codes/unmanaged/update", requestOptions); - } - - /// - /// Updates a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public void Update( - string accessCodeId = default, - bool? allowExternalModification = default, - bool? force = default, - bool? isExternalModificationAllowed = default, - bool isManaged = default - ) - { - Update( - new UpdateRequest( - accessCodeId: accessCodeId, - allowExternalModification: allowExternalModification, - force: force, - isExternalModificationAllowed: isExternalModificationAllowed, - isManaged: isManaged - ) - ); - } - - /// - /// Updates a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/access_codes/unmanaged/update", requestOptions); - } - - /// - /// Updates a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - public async Task UpdateAsync( - string accessCodeId = default, - bool? allowExternalModification = default, - bool? force = default, - bool? isExternalModificationAllowed = default, - bool isManaged = default - ) - { - await UpdateAsync( - new UpdateRequest( - accessCodeId: accessCodeId, - allowExternalModification: allowExternalModification, - force: force, - isExternalModificationAllowed: isExternalModificationAllowed, - isManaged: isManaged - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.UnmanagedAccessCodes UnmanagedAccessCodes => new(this); - } - - public partial interface ISeamClient - { - public Api.UnmanagedAccessCodes UnmanagedAccessCodes { get; } - } -} diff --git a/src/Seam/Api/UnmanagedAccessGrants.cs b/src/Seam/Api/UnmanagedAccessGrants.cs deleted file mode 100644 index 7a679ee8..00000000 --- a/src/Seam/Api/UnmanagedAccessGrants.cs +++ /dev/null @@ -1,480 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class UnmanagedAccessGrants - { - private ISeamClient _seam; - - public UnmanagedAccessGrants(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Get an Unmanaged Access Grant. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string accessGrantId = default) - { - AccessGrantId = accessGrantId; - } - - /// - /// ID of unmanaged Access Grant to get. - /// - [DataMember(Name = "access_grant_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(UnmanagedAccessGrant accessGrant = default) - { - AccessGrant = accessGrant; - } - - /// - /// OK - /// - [DataMember(Name = "access_grant", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessGrant AccessGrant { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Get an unmanaged Access Grant (where is_managed = false). - /// - public UnmanagedAccessGrant Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_grants/unmanaged/get", requestOptions) - .EnsureData("/access_grants/unmanaged/get") - .AccessGrant; - } - - /// - /// Get an unmanaged Access Grant (where is_managed = false). - /// - public UnmanagedAccessGrant Get(string accessGrantId = default) - { - return Get(new GetRequest(accessGrantId: accessGrantId)); - } - - /// - /// Get an unmanaged Access Grant (where is_managed = false). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync("/access_grants/unmanaged/get", requestOptions) - ) - .EnsureData("/access_grants/unmanaged/get") - .AccessGrant; - } - - /// - /// Get an unmanaged Access Grant (where is_managed = false). - /// - public async Task GetAsync(string accessGrantId = default) - { - return (await GetAsync(new GetRequest(accessGrantId: accessGrantId))); - } - - /// - /// Request parameters for List Unmanaged Access Grants. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? acsEntranceId = default, - string? acsSystemId = default, - float? limit = default, - string? pageCursor = default, - string? reservationKey = default, - string? userIdentityId = default - ) - { - AcsEntranceId = acsEntranceId; - AcsSystemId = acsSystemId; - Limit = limit; - PageCursor = pageCursor; - ReservationKey = reservationKey; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the entrance by which you want to filter the list of unmanaged Access Grants. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsEntranceId { get; set; } - - /// - /// ID of the access system by which you want to filter the list of unmanaged Access Grants. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// Numerical limit on the number of unmanaged access grants to return. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// Filter unmanaged Access Grants by reservation_key. - /// - [DataMember(Name = "reservation_key", IsRequired = false, EmitDefaultValue = false)] - public string? ReservationKey { get; set; } - - /// - /// ID of user identity by which you want to filter the list of unmanaged Access Grants. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List accessGrants = default) - { - AccessGrants = accessGrants; - } - - /// - /// OK - /// - [DataMember(Name = "access_grants", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrants { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets unmanaged Access Grants (where is_managed = false). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_grants/unmanaged/list", requestOptions) - .EnsureData("/access_grants/unmanaged/list") - .AccessGrants; - } - - /// - /// Gets unmanaged Access Grants (where is_managed = false). - /// - public List List( - string? acsEntranceId = default, - string? acsSystemId = default, - float? limit = default, - string? pageCursor = default, - string? reservationKey = default, - string? userIdentityId = default - ) - { - return List( - new ListRequest( - acsEntranceId: acsEntranceId, - acsSystemId: acsSystemId, - limit: limit, - pageCursor: pageCursor, - reservationKey: reservationKey, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Gets unmanaged Access Grants (where is_managed = false). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync("/access_grants/unmanaged/list", requestOptions) - ) - .EnsureData("/access_grants/unmanaged/list") - .AccessGrants; - } - - /// - /// Gets unmanaged Access Grants (where is_managed = false). - /// - public async Task> ListAsync( - string? acsEntranceId = default, - string? acsSystemId = default, - float? limit = default, - string? pageCursor = default, - string? reservationKey = default, - string? userIdentityId = default - ) - { - return ( - await ListAsync( - new ListRequest( - acsEntranceId: acsEntranceId, - acsSystemId: acsSystemId, - limit: limit, - pageCursor: pageCursor, - reservationKey: reservationKey, - userIdentityId: userIdentityId - ) - ) - ); - } - - /// - /// Request parameters for Update an Unmanaged Access Grant. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string accessGrantId = default, - string? accessGrantKey = default, - bool isManaged = default - ) - { - AccessGrantId = accessGrantId; - AccessGrantKey = accessGrantKey; - IsManaged = isManaged; - } - - /// - /// ID of the unmanaged Access Grant to update. - /// - [DataMember(Name = "access_grant_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// Unique key for the access grant. If not provided, the existing key will be preserved. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// Must be set to true to convert the unmanaged access grant to managed. - /// - [DataMember(Name = "is_managed", IsRequired = true, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates an unmanaged Access Grant to make it managed. - /// - /// This endpoint can only be used to convert unmanaged access grants to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed access grants back to unmanaged. - /// - /// When converting an unmanaged access grant to managed, all associated access methods will also be converted to managed. - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/access_grants/unmanaged/update", requestOptions); - } - - /// - /// Updates an unmanaged Access Grant to make it managed. - /// - /// This endpoint can only be used to convert unmanaged access grants to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed access grants back to unmanaged. - /// - /// When converting an unmanaged access grant to managed, all associated access methods will also be converted to managed. - /// - public void Update( - string accessGrantId = default, - string? accessGrantKey = default, - bool isManaged = default - ) - { - Update( - new UpdateRequest( - accessGrantId: accessGrantId, - accessGrantKey: accessGrantKey, - isManaged: isManaged - ) - ); - } - - /// - /// Updates an unmanaged Access Grant to make it managed. - /// - /// This endpoint can only be used to convert unmanaged access grants to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed access grants back to unmanaged. - /// - /// When converting an unmanaged access grant to managed, all associated access methods will also be converted to managed. - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/access_grants/unmanaged/update", requestOptions); - } - - /// - /// Updates an unmanaged Access Grant to make it managed. - /// - /// This endpoint can only be used to convert unmanaged access grants to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed access grants back to unmanaged. - /// - /// When converting an unmanaged access grant to managed, all associated access methods will also be converted to managed. - /// - public async Task UpdateAsync( - string accessGrantId = default, - string? accessGrantKey = default, - bool isManaged = default - ) - { - await UpdateAsync( - new UpdateRequest( - accessGrantId: accessGrantId, - accessGrantKey: accessGrantKey, - isManaged: isManaged - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.UnmanagedAccessGrants UnmanagedAccessGrants => new(this); - } - - public partial interface ISeamClient - { - public Api.UnmanagedAccessGrants UnmanagedAccessGrants { get; } - } -} diff --git a/src/Seam/Api/UnmanagedAccessMethods.cs b/src/Seam/Api/UnmanagedAccessMethods.cs deleted file mode 100644 index df4a90c4..00000000 --- a/src/Seam/Api/UnmanagedAccessMethods.cs +++ /dev/null @@ -1,326 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class UnmanagedAccessMethods - { - private ISeamClient _seam; - - public UnmanagedAccessMethods(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Get an Unmanaged Access Method. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string accessMethodId = default) - { - AccessMethodId = accessMethodId; - } - - /// - /// ID of unmanaged access method to get. - /// - [DataMember(Name = "access_method_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(UnmanagedAccessMethod accessMethod = default) - { - AccessMethod = accessMethod; - } - - /// - /// OK - /// - [DataMember(Name = "access_method", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessMethod AccessMethod { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets an unmanaged access method (where is_managed = false). - /// - public UnmanagedAccessMethod Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_methods/unmanaged/get", requestOptions) - .EnsureData("/access_methods/unmanaged/get") - .AccessMethod; - } - - /// - /// Gets an unmanaged access method (where is_managed = false). - /// - public UnmanagedAccessMethod Get(string accessMethodId = default) - { - return Get(new GetRequest(accessMethodId: accessMethodId)); - } - - /// - /// Gets an unmanaged access method (where is_managed = false). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync("/access_methods/unmanaged/get", requestOptions) - ) - .EnsureData("/access_methods/unmanaged/get") - .AccessMethod; - } - - /// - /// Gets an unmanaged access method (where is_managed = false). - /// - public async Task GetAsync(string accessMethodId = default) - { - return (await GetAsync(new GetRequest(accessMethodId: accessMethodId))); - } - - /// - /// Request parameters for List Unmanaged Access Methods. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string accessGrantId = default, - string? acsEntranceId = default, - string? deviceId = default, - string? spaceId = default - ) - { - AccessGrantId = accessGrantId; - AcsEntranceId = acsEntranceId; - DeviceId = deviceId; - SpaceId = spaceId; - } - - /// - /// ID of Access Grant to list unmanaged access methods for. - /// - [DataMember(Name = "access_grant_id", IsRequired = true, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// ID of the entrance for which you want to retrieve all unmanaged access methods. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsEntranceId { get; set; } - - /// - /// ID of the device for which you want to retrieve all unmanaged access methods. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// ID of the space for which you want to retrieve all unmanaged access methods. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List accessMethods = default) - { - AccessMethods = accessMethods; - } - - /// - /// OK - /// - [DataMember(Name = "access_methods", IsRequired = false, EmitDefaultValue = false)] - public List AccessMethods { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Lists all unmanaged access methods (where is_managed = false), usually filtered by Access Grant. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/access_methods/unmanaged/list", requestOptions) - .EnsureData("/access_methods/unmanaged/list") - .AccessMethods; - } - - /// - /// Lists all unmanaged access methods (where is_managed = false), usually filtered by Access Grant. - /// - public List List( - string accessGrantId = default, - string? acsEntranceId = default, - string? deviceId = default, - string? spaceId = default - ) - { - return List( - new ListRequest( - accessGrantId: accessGrantId, - acsEntranceId: acsEntranceId, - deviceId: deviceId, - spaceId: spaceId - ) - ); - } - - /// - /// Lists all unmanaged access methods (where is_managed = false), usually filtered by Access Grant. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync("/access_methods/unmanaged/list", requestOptions) - ) - .EnsureData("/access_methods/unmanaged/list") - .AccessMethods; - } - - /// - /// Lists all unmanaged access methods (where is_managed = false), usually filtered by Access Grant. - /// - public async Task> ListAsync( - string accessGrantId = default, - string? acsEntranceId = default, - string? deviceId = default, - string? spaceId = default - ) - { - return ( - await ListAsync( - new ListRequest( - accessGrantId: accessGrantId, - acsEntranceId: acsEntranceId, - deviceId: deviceId, - spaceId: spaceId - ) - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.UnmanagedAccessMethods UnmanagedAccessMethods => new(this); - } - - public partial interface ISeamClient - { - public Api.UnmanagedAccessMethods UnmanagedAccessMethods { get; } - } -} diff --git a/src/Seam/Api/UnmanagedDevices.cs b/src/Seam/Api/UnmanagedDevices.cs deleted file mode 100644 index c26528e4..00000000 --- a/src/Seam/Api/UnmanagedDevices.cs +++ /dev/null @@ -1,1026 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class UnmanagedDevices - { - private ISeamClient _seam; - - public UnmanagedDevices(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Get an Unmanaged Device. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string? deviceId = default, string? name = default) - { - DeviceId = deviceId; - Name = name; - } - - /// - /// ID of the unmanaged device that you want to get. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Name of the unmanaged device that you want to get. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(UnmanagedDevice device = default) - { - Device = device; - } - - /// - /// OK - /// - [DataMember(Name = "device", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedDevice Device { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - /// You must specify either `device_id` or `name`. - /// - public UnmanagedDevice Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/devices/unmanaged/get", requestOptions) - .EnsureData("/devices/unmanaged/get") - .Device; - } - - /// - /// Returns a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - /// You must specify either `device_id` or `name`. - /// - public UnmanagedDevice Get(string? deviceId = default, string? name = default) - { - return Get(new GetRequest(deviceId: deviceId, name: name)); - } - - /// - /// Returns a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - /// You must specify either `device_id` or `name`. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/devices/unmanaged/get", requestOptions)) - .EnsureData("/devices/unmanaged/get") - .Device; - } - - /// - /// Returns a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - /// You must specify either `device_id` or `name`. - /// - public async Task GetAsync( - string? deviceId = default, - string? name = default - ) - { - return (await GetAsync(new GetRequest(deviceId: deviceId, name: name))); - } - - /// - /// Request parameters for List Unmanaged Devices. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? connectWebviewId = default, - string? connectedAccountId = default, - List? connectedAccountIds = default, - string? createdBefore = default, - string? customerKey = default, - List? deviceIds = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - float? limit = default, - ListRequest.ManufacturerEnum? manufacturer = default, - string? pageCursor = default, - string? search = default - ) - { - ConnectWebviewId = connectWebviewId; - ConnectedAccountId = connectedAccountId; - ConnectedAccountIds = connectedAccountIds; - CreatedBefore = createdBefore; - CustomerKey = customerKey; - DeviceIds = deviceIds; - DeviceType = deviceType; - DeviceTypes = deviceTypes; - Limit = limit; - Manufacturer = manufacturer; - PageCursor = pageCursor; - Search = search; - } - - /// - /// Device type for which you want to list devices. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "akuvox_lock")] - AkuvoxLock = 1, - - [EnumMember(Value = "august_lock")] - AugustLock = 2, - - [EnumMember(Value = "brivo_access_point")] - BrivoAccessPoint = 3, - - [EnumMember(Value = "butterflymx_panel")] - ButterflymxPanel = 4, - - [EnumMember(Value = "avigilon_alta_entry")] - AvigilonAltaEntry = 5, - - [EnumMember(Value = "doorking_lock")] - DoorkingLock = 6, - - [EnumMember(Value = "genie_door")] - GenieDoor = 7, - - [EnumMember(Value = "igloo_lock")] - IglooLock = 8, - - [EnumMember(Value = "linear_lock")] - LinearLock = 9, - - [EnumMember(Value = "lockly_lock")] - LocklyLock = 10, - - [EnumMember(Value = "kwikset_lock")] - KwiksetLock = 11, - - [EnumMember(Value = "nuki_lock")] - NukiLock = 12, - - [EnumMember(Value = "salto_lock")] - SaltoLock = 13, - - [EnumMember(Value = "schlage_lock")] - SchlageLock = 14, - - [EnumMember(Value = "smartthings_lock")] - SmartthingsLock = 15, - - [EnumMember(Value = "wyze_lock")] - WyzeLock = 16, - - [EnumMember(Value = "yale_lock")] - YaleLock = 17, - - [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, - - [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, - - [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, - - [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, - - [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, - - [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, - - [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, - - [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, - - [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, - - [EnumMember(Value = "yacan_lock")] - YacanLock = 27, - - [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, - - [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, - - [EnumMember(Value = "kisi_lock")] - KisiLock = 30, - - [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, - - [EnumMember(Value = "keynest_key")] - KeynestKey = 32, - - [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, - - [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, - - [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, - - [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, - - [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, - - [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, - - [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, - - [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, - - [EnumMember(Value = "ios_phone")] - IosPhone = 41, - - [EnumMember(Value = "android_phone")] - AndroidPhone = 42, - - [EnumMember(Value = "ring_camera")] - RingCamera = 43, - } - - /// - /// Array of device types for which you want to list devices. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypesEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "akuvox_lock")] - AkuvoxLock = 1, - - [EnumMember(Value = "august_lock")] - AugustLock = 2, - - [EnumMember(Value = "brivo_access_point")] - BrivoAccessPoint = 3, - - [EnumMember(Value = "butterflymx_panel")] - ButterflymxPanel = 4, - - [EnumMember(Value = "avigilon_alta_entry")] - AvigilonAltaEntry = 5, - - [EnumMember(Value = "doorking_lock")] - DoorkingLock = 6, - - [EnumMember(Value = "genie_door")] - GenieDoor = 7, - - [EnumMember(Value = "igloo_lock")] - IglooLock = 8, - - [EnumMember(Value = "linear_lock")] - LinearLock = 9, - - [EnumMember(Value = "lockly_lock")] - LocklyLock = 10, - - [EnumMember(Value = "kwikset_lock")] - KwiksetLock = 11, - - [EnumMember(Value = "nuki_lock")] - NukiLock = 12, - - [EnumMember(Value = "salto_lock")] - SaltoLock = 13, - - [EnumMember(Value = "schlage_lock")] - SchlageLock = 14, - - [EnumMember(Value = "smartthings_lock")] - SmartthingsLock = 15, - - [EnumMember(Value = "wyze_lock")] - WyzeLock = 16, - - [EnumMember(Value = "yale_lock")] - YaleLock = 17, - - [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, - - [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, - - [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, - - [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, - - [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, - - [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, - - [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, - - [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, - - [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, - - [EnumMember(Value = "yacan_lock")] - YacanLock = 27, - - [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, - - [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, - - [EnumMember(Value = "kisi_lock")] - KisiLock = 30, - - [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, - - [EnumMember(Value = "keynest_key")] - KeynestKey = 32, - - [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, - - [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, - - [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, - - [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, - - [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, - - [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, - - [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, - - [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, - - [EnumMember(Value = "ios_phone")] - IosPhone = 41, - - [EnumMember(Value = "android_phone")] - AndroidPhone = 42, - - [EnumMember(Value = "ring_camera")] - RingCamera = 43, - } - - /// - /// Manufacturer for which you want to list devices. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ManufacturerEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "akuvox")] - Akuvox = 1, - - [EnumMember(Value = "august")] - August = 2, - - [EnumMember(Value = "avigilon_alta")] - AvigilonAlta = 3, - - [EnumMember(Value = "brivo")] - Brivo = 4, - - [EnumMember(Value = "butterflymx")] - Butterflymx = 5, - - [EnumMember(Value = "doorking")] - Doorking = 6, - - [EnumMember(Value = "four_suites")] - FourSuites = 7, - - [EnumMember(Value = "genie")] - Genie = 8, - - [EnumMember(Value = "igloo")] - Igloo = 9, - - [EnumMember(Value = "keywe")] - Keywe = 10, - - [EnumMember(Value = "kwikset")] - Kwikset = 11, - - [EnumMember(Value = "linear")] - Linear = 12, - - [EnumMember(Value = "lockly")] - Lockly = 13, - - [EnumMember(Value = "nuki")] - Nuki = 14, - - [EnumMember(Value = "philia")] - Philia = 15, - - [EnumMember(Value = "salto")] - Salto = 16, - - [EnumMember(Value = "samsung")] - Samsung = 17, - - [EnumMember(Value = "schlage")] - Schlage = 18, - - [EnumMember(Value = "seam")] - Seam = 19, - - [EnumMember(Value = "unknown")] - Unknown = 20, - - [EnumMember(Value = "wyze")] - Wyze = 21, - - [EnumMember(Value = "yale")] - Yale = 22, - - [EnumMember(Value = "two_n")] - TwoN = 23, - - [EnumMember(Value = "ttlock")] - Ttlock = 24, - - [EnumMember(Value = "igloohome")] - Igloohome = 25, - - [EnumMember(Value = "controlbyweb")] - Controlbyweb = 26, - - [EnumMember(Value = "dormakaba_oracode")] - DormakabaOracode = 27, - - [EnumMember(Value = "tedee")] - Tedee = 28, - - [EnumMember(Value = "keyincode")] - Keyincode = 29, - - [EnumMember(Value = "akiles")] - Akiles = 30, - - [EnumMember(Value = "aqara")] - Aqara = 31, - - [EnumMember(Value = "ecobee")] - Ecobee = 32, - - [EnumMember(Value = "honeywell_resideo")] - HoneywellResideo = 33, - - [EnumMember(Value = "keynest")] - Keynest = 34, - - [EnumMember(Value = "korelock")] - Korelock = 35, - - [EnumMember(Value = "minut")] - Minut = 36, - - [EnumMember(Value = "nest")] - Nest = 37, - - [EnumMember(Value = "noiseaware")] - Noiseaware = 38, - - [EnumMember(Value = "sensi")] - Sensi = 39, - - [EnumMember(Value = "smartthings")] - Smartthings = 40, - - [EnumMember(Value = "tado")] - Tado = 41, - - [EnumMember(Value = "ultraloq")] - Ultraloq = 42, - - [EnumMember(Value = "ring")] - Ring = 43, - - [EnumMember(Value = "ical")] - Ical = 44, - - [EnumMember(Value = "lodgify")] - Lodgify = 45, - - [EnumMember(Value = "hostaway")] - Hostaway = 46, - - [EnumMember(Value = "guesty")] - Guesty = 47, - - [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 48, - - [EnumMember(Value = "omnitec")] - Omnitec = 49, - - [EnumMember(Value = "kisi")] - Kisi = 50, - - [EnumMember(Value = "slack")] - Slack = 51, - - [EnumMember(Value = "yacan")] - Yacan = 52, - } - - /// - /// ID of the Connect Webview for which you want to list devices. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectWebviewId { get; set; } - - /// - /// ID of the connected account for which you want to list devices. - /// - [DataMember( - Name = "connected_account_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectedAccountId { get; set; } - - /// - /// Array of IDs of the connected accounts for which you want to list devices. - /// - [DataMember( - Name = "connected_account_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? ConnectedAccountIds { get; set; } - - /// - /// Timestamp by which to limit returned devices. Returns devices created before this timestamp. - /// - [DataMember(Name = "created_before", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedBefore { get; set; } - - /// - /// Customer key for which you want to list devices. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Array of device IDs for which you want to list devices. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceIds { get; set; } - - /// - /// Device type for which you want to list devices. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.DeviceTypeEnum? DeviceType { get; set; } - - /// - /// Array of device types for which you want to list devices. - /// - [DataMember(Name = "device_types", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceTypes { get; set; } - - /// - /// Numerical limit on the number of devices to return. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } - - /// - /// Manufacturer for which you want to list devices. - /// - [DataMember(Name = "manufacturer", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.ManufacturerEnum? Manufacturer { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned devices to include all records that satisfy a partial match using `device_id` (full or partial UUID prefix, minimum 4 characters), `connected_account_id`, `display_name`, `custom_metadata` or `location.location_name`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List devices = default) - { - Devices = devices; - } - - /// - /// OK - /// - [DataMember(Name = "devices", IsRequired = false, EmitDefaultValue = false)] - public List Devices { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [unmanaged devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/devices/unmanaged/list", requestOptions) - .EnsureData("/devices/unmanaged/list") - .Devices; - } - - /// - /// Returns a list of all [unmanaged devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - public List List( - string? connectWebviewId = default, - string? connectedAccountId = default, - List? connectedAccountIds = default, - string? createdBefore = default, - string? customerKey = default, - List? deviceIds = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - float? limit = default, - ListRequest.ManufacturerEnum? manufacturer = default, - string? pageCursor = default, - string? search = default - ) - { - return List( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - connectedAccountIds: connectedAccountIds, - createdBefore: createdBefore, - customerKey: customerKey, - deviceIds: deviceIds, - deviceType: deviceType, - deviceTypes: deviceTypes, - limit: limit, - manufacturer: manufacturer, - pageCursor: pageCursor, - search: search - ) - ); - } - - /// - /// Returns a list of all [unmanaged devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/devices/unmanaged/list", requestOptions)) - .EnsureData("/devices/unmanaged/list") - .Devices; - } - - /// - /// Returns a list of all [unmanaged devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - public async Task> ListAsync( - string? connectWebviewId = default, - string? connectedAccountId = default, - List? connectedAccountIds = default, - string? createdBefore = default, - string? customerKey = default, - List? deviceIds = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - float? limit = default, - ListRequest.ManufacturerEnum? manufacturer = default, - string? pageCursor = default, - string? search = default - ) - { - return ( - await ListAsync( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - connectedAccountIds: connectedAccountIds, - createdBefore: createdBefore, - customerKey: customerKey, - deviceIds: deviceIds, - deviceType: deviceType, - deviceTypes: deviceTypes, - limit: limit, - manufacturer: manufacturer, - pageCursor: pageCursor, - search: search - ) - ) - ); - } - - /// - /// Request parameters for Update an Unmanaged Device. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - object? customMetadata = default, - string deviceId = default, - bool? isManaged = default - ) - { - CustomMetadata = customMetadata; - DeviceId = deviceId; - IsManaged = isManaged; - } - - /// - /// Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). Set a key to `null` or to an empty string to remove that key from the custom metadata. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadata { get; set; } - - /// - /// ID of the unmanaged device that you want to update. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Indicates whether the device is managed. Set this parameter to `true` to convert an unmanaged device to managed. - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsManaged { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). To convert an unmanaged device to managed, set `is_managed` to `true`. - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/devices/unmanaged/update", requestOptions); - } - - /// - /// Updates a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). To convert an unmanaged device to managed, set `is_managed` to `true`. - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - public void Update( - object? customMetadata = default, - string deviceId = default, - bool? isManaged = default - ) - { - Update( - new UpdateRequest( - customMetadata: customMetadata, - deviceId: deviceId, - isManaged: isManaged - ) - ); - } - - /// - /// Updates a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). To convert an unmanaged device to managed, set `is_managed` to `true`. - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/devices/unmanaged/update", requestOptions); - } - - /// - /// Updates a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). To convert an unmanaged device to managed, set `is_managed` to `true`. - /// - /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - public async Task UpdateAsync( - object? customMetadata = default, - string deviceId = default, - bool? isManaged = default - ) - { - await UpdateAsync( - new UpdateRequest( - customMetadata: customMetadata, - deviceId: deviceId, - isManaged: isManaged - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.UnmanagedDevices UnmanagedDevices => new(this); - } - - public partial interface ISeamClient - { - public Api.UnmanagedDevices UnmanagedDevices { get; } - } -} diff --git a/src/Seam/Api/UnmanagedUserIdentities.cs b/src/Seam/Api/UnmanagedUserIdentities.cs deleted file mode 100644 index d390dba2..00000000 --- a/src/Seam/Api/UnmanagedUserIdentities.cs +++ /dev/null @@ -1,451 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class UnmanagedUserIdentities - { - private ISeamClient _seam; - - public UnmanagedUserIdentities(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Get an Unmanaged User Identity. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string userIdentityId = default) - { - UserIdentityId = userIdentityId; - } - - /// - /// ID of the unmanaged user identity that you want to get. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(UnmanagedUserIdentity userIdentity = default) - { - UserIdentity = userIdentity; - } - - /// - /// OK - /// - [DataMember(Name = "user_identity", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedUserIdentity UserIdentity { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). - /// - public UnmanagedUserIdentity Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/user_identities/unmanaged/get", requestOptions) - .EnsureData("/user_identities/unmanaged/get") - .UserIdentity; - } - - /// - /// Returns a specified unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). - /// - public UnmanagedUserIdentity Get(string userIdentityId = default) - { - return Get(new GetRequest(userIdentityId: userIdentityId)); - } - - /// - /// Returns a specified unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync("/user_identities/unmanaged/get", requestOptions) - ) - .EnsureData("/user_identities/unmanaged/get") - .UserIdentity; - } - - /// - /// Returns a specified unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). - /// - public async Task GetAsync(string userIdentityId = default) - { - return (await GetAsync(new GetRequest(userIdentityId: userIdentityId))); - } - - /// - /// Request parameters for List Unmanaged User Identities. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? createdBefore = default, - int? limit = default, - string? pageCursor = default, - string? search = default - ) - { - CreatedBefore = createdBefore; - Limit = limit; - PageCursor = pageCursor; - Search = search; - } - - /// - /// Timestamp by which to limit returned unmanaged user identities. Returns user identities created before this timestamp. - /// - [DataMember(Name = "created_before", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedBefore { get; set; } - - /// - /// Maximum number of records to return per page. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public int? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned unmanaged user identities to include all records that satisfy a partial match using `full_name`, `phone_number`, `email_address`, `user_identity_id` or `acs_system_id`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List userIdentities = default) - { - UserIdentities = userIdentities; - } - - /// - /// OK - /// - [DataMember(Name = "user_identities", IsRequired = false, EmitDefaultValue = false)] - public List UserIdentities { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all unmanaged [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/user_identities/unmanaged/list", requestOptions) - .EnsureData("/user_identities/unmanaged/list") - .UserIdentities; - } - - /// - /// Returns a list of all unmanaged [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). - /// - public List List( - string? createdBefore = default, - int? limit = default, - string? pageCursor = default, - string? search = default - ) - { - return List( - new ListRequest( - createdBefore: createdBefore, - limit: limit, - pageCursor: pageCursor, - search: search - ) - ); - } - - /// - /// Returns a list of all unmanaged [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/user_identities/unmanaged/list", - requestOptions - ) - ) - .EnsureData("/user_identities/unmanaged/list") - .UserIdentities; - } - - /// - /// Returns a list of all unmanaged [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). - /// - public async Task> ListAsync( - string? createdBefore = default, - int? limit = default, - string? pageCursor = default, - string? search = default - ) - { - return ( - await ListAsync( - new ListRequest( - createdBefore: createdBefore, - limit: limit, - pageCursor: pageCursor, - search: search - ) - ) - ); - } - - /// - /// Request parameters for Update an Unmanaged User Identity. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - bool isManaged = default, - string userIdentityId = default, - string? userIdentityKey = default - ) - { - IsManaged = isManaged; - UserIdentityId = userIdentityId; - UserIdentityKey = userIdentityKey; - } - - /// - /// Must be set to true to convert the unmanaged user identity to managed. - /// - [DataMember(Name = "is_managed", IsRequired = true, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// ID of the unmanaged user identity that you want to update. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - /// - /// Unique key for the user identity. If not provided, the existing key will be preserved. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates an unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) to make it managed. - /// - /// This endpoint can only be used to convert unmanaged user identities to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed user identities back to unmanaged. - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/user_identities/unmanaged/update", requestOptions); - } - - /// - /// Updates an unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) to make it managed. - /// - /// This endpoint can only be used to convert unmanaged user identities to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed user identities back to unmanaged. - /// - public void Update( - bool isManaged = default, - string userIdentityId = default, - string? userIdentityKey = default - ) - { - Update( - new UpdateRequest( - isManaged: isManaged, - userIdentityId: userIdentityId, - userIdentityKey: userIdentityKey - ) - ); - } - - /// - /// Updates an unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) to make it managed. - /// - /// This endpoint can only be used to convert unmanaged user identities to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed user identities back to unmanaged. - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/user_identities/unmanaged/update", requestOptions); - } - - /// - /// Updates an unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) to make it managed. - /// - /// This endpoint can only be used to convert unmanaged user identities to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed user identities back to unmanaged. - /// - public async Task UpdateAsync( - bool isManaged = default, - string userIdentityId = default, - string? userIdentityKey = default - ) - { - await UpdateAsync( - new UpdateRequest( - isManaged: isManaged, - userIdentityId: userIdentityId, - userIdentityKey: userIdentityKey - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.UnmanagedUserIdentities UnmanagedUserIdentities => new(this); - } - - public partial interface ISeamClient - { - public Api.UnmanagedUserIdentities UnmanagedUserIdentities { get; } - } -} diff --git a/src/Seam/Api/UserIdentities.cs b/src/Seam/Api/UserIdentities.cs deleted file mode 100644 index a2fe9465..00000000 --- a/src/Seam/Api/UserIdentities.cs +++ /dev/null @@ -1,2015 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class UserIdentities - { - private ISeamClient _seam; - - public UserIdentities(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Add an ACS User to a User Identity. - /// - [DataContract(Name = "addAcsUserRequest_request")] - public class AddAcsUserRequest - { - [JsonConstructorAttribute] - protected AddAcsUserRequest() { } - - public AddAcsUserRequest( - string acsUserId = default, - string? userIdentityId = default, - string? userIdentityKey = default - ) - { - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - UserIdentityKey = userIdentityKey; - } - - /// - /// ID of the access system user that you want to add to the user identity. - /// - [DataMember(Name = "acs_user_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsUserId { get; set; } - - /// - /// ID of the user identity to which you want to add an access system user. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Key of the user identity to which you want to add an access system user. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - /// You must specify either `user_identity_id` or `user_identity_key` to identify the user identity. - /// - /// If `user_identity_key` is provided, but the user identity doesn't exist, a new user identity will be created automatically using information from the ACS user. - /// - public void AddAcsUser(AddAcsUserRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/user_identities/add_acs_user", requestOptions); - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - /// You must specify either `user_identity_id` or `user_identity_key` to identify the user identity. - /// - /// If `user_identity_key` is provided, but the user identity doesn't exist, a new user identity will be created automatically using information from the ACS user. - /// - public void AddAcsUser( - string acsUserId = default, - string? userIdentityId = default, - string? userIdentityKey = default - ) - { - AddAcsUser( - new AddAcsUserRequest( - acsUserId: acsUserId, - userIdentityId: userIdentityId, - userIdentityKey: userIdentityKey - ) - ); - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - /// You must specify either `user_identity_id` or `user_identity_key` to identify the user identity. - /// - /// If `user_identity_key` is provided, but the user identity doesn't exist, a new user identity will be created automatically using information from the ACS user. - /// - public async Task AddAcsUserAsync(AddAcsUserRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/user_identities/add_acs_user", requestOptions); - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - /// You must specify either `user_identity_id` or `user_identity_key` to identify the user identity. - /// - /// If `user_identity_key` is provided, but the user identity doesn't exist, a new user identity will be created automatically using information from the ACS user. - /// - public async Task AddAcsUserAsync( - string acsUserId = default, - string? userIdentityId = default, - string? userIdentityKey = default - ) - { - await AddAcsUserAsync( - new AddAcsUserRequest( - acsUserId: acsUserId, - userIdentityId: userIdentityId, - userIdentityKey: userIdentityKey - ) - ); - } - - /// - /// Request parameters for Create a User Identity. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - List? acsSystemIds = default, - string? emailAddress = default, - string? fullName = default, - string? phoneNumber = default, - string? userIdentityKey = default - ) - { - AcsSystemIds = acsSystemIds; - EmailAddress = emailAddress; - FullName = fullName; - PhoneNumber = phoneNumber; - UserIdentityKey = userIdentityKey; - } - - /// - /// List of access system IDs to associate with the new user identity through access system users. If there's no user with the same email address or phone number in the specified access systems, a new access system user is created. If there is an existing user with the same email or phone number in the specified access systems, the user is linked to the user identity. - /// - [DataMember(Name = "acs_system_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AcsSystemIds { get; set; } - - /// - /// Unique email address for the new user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Full name of the user associated with the new user identity. - /// - [DataMember(Name = "full_name", IsRequired = false, EmitDefaultValue = false)] - public string? FullName { get; set; } - - /// - /// Unique phone number for the new user identity in E.164 format (for example, +15555550100). - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Unique key for the new user identity. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(UserIdentity userIdentity = default) - { - UserIdentity = userIdentity; - } - - /// - /// OK - /// - [DataMember(Name = "user_identity", IsRequired = false, EmitDefaultValue = false)] - public UserIdentity UserIdentity { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public UserIdentity Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/user_identities/create", requestOptions) - .EnsureData("/user_identities/create") - .UserIdentity; - } - - /// - /// Creates a new [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public UserIdentity Create( - List? acsSystemIds = default, - string? emailAddress = default, - string? fullName = default, - string? phoneNumber = default, - string? userIdentityKey = default - ) - { - return Create( - new CreateRequest( - acsSystemIds: acsSystemIds, - emailAddress: emailAddress, - fullName: fullName, - phoneNumber: phoneNumber, - userIdentityKey: userIdentityKey - ) - ); - } - - /// - /// Creates a new [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync("/user_identities/create", requestOptions) - ) - .EnsureData("/user_identities/create") - .UserIdentity; - } - - /// - /// Creates a new [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task CreateAsync( - List? acsSystemIds = default, - string? emailAddress = default, - string? fullName = default, - string? phoneNumber = default, - string? userIdentityKey = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - acsSystemIds: acsSystemIds, - emailAddress: emailAddress, - fullName: fullName, - phoneNumber: phoneNumber, - userIdentityKey: userIdentityKey - ) - ) - ); - } - - /// - /// Request parameters for Delete a User Identity. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string userIdentityId = default) - { - UserIdentityId = userIdentityId; - } - - /// - /// ID of the user identity that you want to delete. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This deletes the user identity and all associated resources, including any [credentials](https://docs.seam.co/api/acs/credentials), [acs users](https://docs.seam.co/api/acs/users) and [client sessions](https://docs.seam.co/api/client_sessions). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/user_identities/delete", requestOptions); - } - - /// - /// Deletes a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This deletes the user identity and all associated resources, including any [credentials](https://docs.seam.co/api/acs/credentials), [acs users](https://docs.seam.co/api/acs/users) and [client sessions](https://docs.seam.co/api/client_sessions). - /// - public void Delete(string userIdentityId = default) - { - Delete(new DeleteRequest(userIdentityId: userIdentityId)); - } - - /// - /// Deletes a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This deletes the user identity and all associated resources, including any [credentials](https://docs.seam.co/api/acs/credentials), [acs users](https://docs.seam.co/api/acs/users) and [client sessions](https://docs.seam.co/api/client_sessions). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/user_identities/delete", requestOptions); - } - - /// - /// Deletes a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This deletes the user identity and all associated resources, including any [credentials](https://docs.seam.co/api/acs/credentials), [acs users](https://docs.seam.co/api/acs/users) and [client sessions](https://docs.seam.co/api/client_sessions). - /// - public async Task DeleteAsync(string userIdentityId = default) - { - await DeleteAsync(new DeleteRequest(userIdentityId: userIdentityId)); - } - - /// - /// Request parameters for Generate an Instant Key. - /// - [DataContract(Name = "generateInstantKeyRequest_request")] - public class GenerateInstantKeyRequest - { - [JsonConstructorAttribute] - protected GenerateInstantKeyRequest() { } - - public GenerateInstantKeyRequest( - string? customizationProfileId = default, - float? maxUseCount = default, - string userIdentityId = default - ) - { - CustomizationProfileId = customizationProfileId; - MaxUseCount = maxUseCount; - UserIdentityId = userIdentityId; - } - - [DataMember( - Name = "customization_profile_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomizationProfileId { get; set; } - - /// - /// Maximum number of times the instant key can be used. Default: 1. - /// - [DataMember(Name = "max_use_count", IsRequired = false, EmitDefaultValue = false)] - public float? MaxUseCount { get; set; } - - /// - /// ID of the user identity for which you want to generate an instant key. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "generateInstantKeyResponse_response")] - public class GenerateInstantKeyResponse - { - [JsonConstructorAttribute] - protected GenerateInstantKeyResponse() { } - - public GenerateInstantKeyResponse(InstantKey instantKey = default) - { - InstantKey = instantKey; - } - - /// - /// OK - /// - [DataMember(Name = "instant_key", IsRequired = false, EmitDefaultValue = false)] - public InstantKey InstantKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Generates a new [instant key](https://docs.seam.co/capability-guides/instant-keys) for a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public InstantKey GenerateInstantKey(GenerateInstantKeyRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post( - "/user_identities/generate_instant_key", - requestOptions - ) - .EnsureData("/user_identities/generate_instant_key") - .InstantKey; - } - - /// - /// Generates a new [instant key](https://docs.seam.co/capability-guides/instant-keys) for a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public InstantKey GenerateInstantKey( - string? customizationProfileId = default, - float? maxUseCount = default, - string userIdentityId = default - ) - { - return GenerateInstantKey( - new GenerateInstantKeyRequest( - customizationProfileId: customizationProfileId, - maxUseCount: maxUseCount, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Generates a new [instant key](https://docs.seam.co/capability-guides/instant-keys) for a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task GenerateInstantKeyAsync(GenerateInstantKeyRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/user_identities/generate_instant_key", - requestOptions - ) - ) - .EnsureData("/user_identities/generate_instant_key") - .InstantKey; - } - - /// - /// Generates a new [instant key](https://docs.seam.co/capability-guides/instant-keys) for a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task GenerateInstantKeyAsync( - string? customizationProfileId = default, - float? maxUseCount = default, - string userIdentityId = default - ) - { - return ( - await GenerateInstantKeyAsync( - new GenerateInstantKeyRequest( - customizationProfileId: customizationProfileId, - maxUseCount: maxUseCount, - userIdentityId: userIdentityId - ) - ) - ); - } - - /// - /// Request parameters for Get a User Identity. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string? userIdentityId = default, string? userIdentityKey = default) - { - UserIdentityId = userIdentityId; - UserIdentityKey = userIdentityKey; - } - - /// - /// ID of the user identity that you want to get. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(UserIdentity userIdentity = default) - { - UserIdentity = userIdentity; - } - - /// - /// OK - /// - [DataMember(Name = "user_identity", IsRequired = false, EmitDefaultValue = false)] - public UserIdentity UserIdentity { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public UserIdentity Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/user_identities/get", requestOptions) - .EnsureData("/user_identities/get") - .UserIdentity; - } - - /// - /// Returns a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public UserIdentity Get(string? userIdentityId = default, string? userIdentityKey = default) - { - return Get( - new GetRequest(userIdentityId: userIdentityId, userIdentityKey: userIdentityKey) - ); - } - - /// - /// Returns a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/user_identities/get", requestOptions)) - .EnsureData("/user_identities/get") - .UserIdentity; - } - - /// - /// Returns a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task GetAsync( - string? userIdentityId = default, - string? userIdentityKey = default - ) - { - return ( - await GetAsync( - new GetRequest(userIdentityId: userIdentityId, userIdentityKey: userIdentityKey) - ) - ); - } - - /// - /// Request parameters for Grant a User Identity Access to a Device. - /// - [DataContract(Name = "grantAccessToDeviceRequest_request")] - public class GrantAccessToDeviceRequest - { - [JsonConstructorAttribute] - protected GrantAccessToDeviceRequest() { } - - public GrantAccessToDeviceRequest( - string deviceId = default, - string userIdentityId = default - ) - { - DeviceId = deviceId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the managed device to which you want to grant access to the user identity. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// ID of the user identity that you want to grant access to a device. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Grants a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) access to a specified [device](https://docs.seam.co/core-concepts/devices/). - /// - public void GrantAccessToDevice(GrantAccessToDeviceRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/user_identities/grant_access_to_device", requestOptions); - } - - /// - /// Grants a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) access to a specified [device](https://docs.seam.co/core-concepts/devices/). - /// - public void GrantAccessToDevice(string deviceId = default, string userIdentityId = default) - { - GrantAccessToDevice( - new GrantAccessToDeviceRequest(deviceId: deviceId, userIdentityId: userIdentityId) - ); - } - - /// - /// Grants a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) access to a specified [device](https://docs.seam.co/core-concepts/devices/). - /// - public async Task GrantAccessToDeviceAsync(GrantAccessToDeviceRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/user_identities/grant_access_to_device", requestOptions); - } - - /// - /// Grants a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) access to a specified [device](https://docs.seam.co/core-concepts/devices/). - /// - public async Task GrantAccessToDeviceAsync( - string deviceId = default, - string userIdentityId = default - ) - { - await GrantAccessToDeviceAsync( - new GrantAccessToDeviceRequest(deviceId: deviceId, userIdentityId: userIdentityId) - ); - } - - /// - /// Request parameters for List User Identities. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? createdBefore = default, - string? credentialManagerAcsSystemId = default, - int? limit = default, - string? pageCursor = default, - string? search = default, - List? userIdentityIds = default - ) - { - CreatedBefore = createdBefore; - CredentialManagerAcsSystemId = credentialManagerAcsSystemId; - Limit = limit; - PageCursor = pageCursor; - Search = search; - UserIdentityIds = userIdentityIds; - } - - /// - /// Timestamp by which to limit returned user identities. Returns user identities created before this timestamp. - /// - [DataMember(Name = "created_before", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedBefore { get; set; } - - /// - /// `acs_system_id` of the credential manager by which you want to filter the list of user identities. - /// - [DataMember( - Name = "credential_manager_acs_system_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CredentialManagerAcsSystemId { get; set; } - - /// - /// Maximum number of records to return per page. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public int? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned user identities to include all records that satisfy a partial match using `full_name`, `phone_number`, `email_address` or `user_identity_id`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// Array of user identity IDs by which to filter the list of user identities. - /// - [DataMember(Name = "user_identity_ids", IsRequired = false, EmitDefaultValue = false)] - public List? UserIdentityIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List userIdentities = default) - { - UserIdentities = userIdentities; - } - - /// - /// OK - /// - [DataMember(Name = "user_identities", IsRequired = false, EmitDefaultValue = false)] - public List UserIdentities { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/user_identities/list", requestOptions) - .EnsureData("/user_identities/list") - .UserIdentities; - } - - /// - /// Returns a list of all [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public List List( - string? createdBefore = default, - string? credentialManagerAcsSystemId = default, - int? limit = default, - string? pageCursor = default, - string? search = default, - List? userIdentityIds = default - ) - { - return List( - new ListRequest( - createdBefore: createdBefore, - credentialManagerAcsSystemId: credentialManagerAcsSystemId, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentityIds: userIdentityIds - ) - ); - } - - /// - /// Returns a list of all [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/user_identities/list", requestOptions)) - .EnsureData("/user_identities/list") - .UserIdentities; - } - - /// - /// Returns a list of all [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task> ListAsync( - string? createdBefore = default, - string? credentialManagerAcsSystemId = default, - int? limit = default, - string? pageCursor = default, - string? search = default, - List? userIdentityIds = default - ) - { - return ( - await ListAsync( - new ListRequest( - createdBefore: createdBefore, - credentialManagerAcsSystemId: credentialManagerAcsSystemId, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentityIds: userIdentityIds - ) - ) - ); - } - - /// - /// Request parameters for List Accessible Devices for a User Identity. - /// - [DataContract(Name = "listAccessibleDevicesRequest_request")] - public class ListAccessibleDevicesRequest - { - [JsonConstructorAttribute] - protected ListAccessibleDevicesRequest() { } - - public ListAccessibleDevicesRequest(string userIdentityId = default) - { - UserIdentityId = userIdentityId; - } - - /// - /// ID of the user identity for which you want to retrieve all accessible devices. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listAccessibleDevicesResponse_response")] - public class ListAccessibleDevicesResponse - { - [JsonConstructorAttribute] - protected ListAccessibleDevicesResponse() { } - - public ListAccessibleDevicesResponse(List devices = default) - { - Devices = devices; - } - - /// - /// OK - /// - [DataMember(Name = "devices", IsRequired = false, EmitDefaultValue = false)] - public List Devices { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [devices](https://docs.seam.co/core-concepts/devices) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes devices derived from the access grants assigned to the user identity and devices directly linked to the user identity. - /// - public List ListAccessibleDevices(ListAccessibleDevicesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get( - "/user_identities/list_accessible_devices", - requestOptions - ) - .EnsureData("/user_identities/list_accessible_devices") - .Devices; - } - - /// - /// Returns a list of all [devices](https://docs.seam.co/core-concepts/devices) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes devices derived from the access grants assigned to the user identity and devices directly linked to the user identity. - /// - public List ListAccessibleDevices(string userIdentityId = default) - { - return ListAccessibleDevices( - new ListAccessibleDevicesRequest(userIdentityId: userIdentityId) - ); - } - - /// - /// Returns a list of all [devices](https://docs.seam.co/core-concepts/devices) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes devices derived from the access grants assigned to the user identity and devices directly linked to the user identity. - /// - public async Task> ListAccessibleDevicesAsync( - ListAccessibleDevicesRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/user_identities/list_accessible_devices", - requestOptions - ) - ) - .EnsureData("/user_identities/list_accessible_devices") - .Devices; - } - - /// - /// Returns a list of all [devices](https://docs.seam.co/core-concepts/devices) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes devices derived from the access grants assigned to the user identity and devices directly linked to the user identity. - /// - public async Task> ListAccessibleDevicesAsync(string userIdentityId = default) - { - return ( - await ListAccessibleDevicesAsync( - new ListAccessibleDevicesRequest(userIdentityId: userIdentityId) - ) - ); - } - - /// - /// Request parameters for List Accessible Entrances for a User Identity. - /// - [DataContract(Name = "listAccessibleEntrancesRequest_request")] - public class ListAccessibleEntrancesRequest - { - [JsonConstructorAttribute] - protected ListAccessibleEntrancesRequest() { } - - public ListAccessibleEntrancesRequest(string userIdentityId = default) - { - UserIdentityId = userIdentityId; - } - - /// - /// ID of the user identity for which you want to retrieve all accessible entrances. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listAccessibleEntrancesResponse_response")] - public class ListAccessibleEntrancesResponse - { - [JsonConstructorAttribute] - protected ListAccessibleEntrancesResponse() { } - - public ListAccessibleEntrancesResponse(List acsEntrances = default) - { - AcsEntrances = acsEntrances; - } - - /// - /// OK - /// - [DataMember(Name = "acs_entrances", IsRequired = false, EmitDefaultValue = false)] - public List AcsEntrances { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [ACS entrances](https://docs.seam.co/api/acs/entrances) accessible to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes entrances derived from the access grants assigned to the user identity and entrances accessible through ACS users linked to the user identity. - /// - public List ListAccessibleEntrances(ListAccessibleEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get( - "/user_identities/list_accessible_entrances", - requestOptions - ) - .EnsureData("/user_identities/list_accessible_entrances") - .AcsEntrances; - } - - /// - /// Returns a list of all [ACS entrances](https://docs.seam.co/api/acs/entrances) accessible to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes entrances derived from the access grants assigned to the user identity and entrances accessible through ACS users linked to the user identity. - /// - public List ListAccessibleEntrances(string userIdentityId = default) - { - return ListAccessibleEntrances( - new ListAccessibleEntrancesRequest(userIdentityId: userIdentityId) - ); - } - - /// - /// Returns a list of all [ACS entrances](https://docs.seam.co/api/acs/entrances) accessible to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes entrances derived from the access grants assigned to the user identity and entrances accessible through ACS users linked to the user identity. - /// - public async Task> ListAccessibleEntrancesAsync( - ListAccessibleEntrancesRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/user_identities/list_accessible_entrances", - requestOptions - ) - ) - .EnsureData("/user_identities/list_accessible_entrances") - .AcsEntrances; - } - - /// - /// Returns a list of all [ACS entrances](https://docs.seam.co/api/acs/entrances) accessible to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes entrances derived from the access grants assigned to the user identity and entrances accessible through ACS users linked to the user identity. - /// - public async Task> ListAccessibleEntrancesAsync( - string userIdentityId = default - ) - { - return ( - await ListAccessibleEntrancesAsync( - new ListAccessibleEntrancesRequest(userIdentityId: userIdentityId) - ) - ); - } - - /// - /// Request parameters for List ACS Systems Associated with a User Identity. - /// - [DataContract(Name = "listAcsSystemsRequest_request")] - public class ListAcsSystemsRequest - { - [JsonConstructorAttribute] - protected ListAcsSystemsRequest() { } - - public ListAcsSystemsRequest(string userIdentityId = default) - { - UserIdentityId = userIdentityId; - } - - /// - /// ID of the user identity for which you want to retrieve all access systems. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listAcsSystemsResponse_response")] - public class ListAcsSystemsResponse - { - [JsonConstructorAttribute] - protected ListAcsSystemsResponse() { } - - public ListAcsSystemsResponse(List acsSystems = default) - { - AcsSystems = acsSystems; - } - - /// - /// OK - /// - [DataMember(Name = "acs_systems", IsRequired = false, EmitDefaultValue = false)] - public List AcsSystems { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public List ListAcsSystems(ListAcsSystemsRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/user_identities/list_acs_systems", requestOptions) - .EnsureData("/user_identities/list_acs_systems") - .AcsSystems; - } - - /// - /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public List ListAcsSystems(string userIdentityId = default) - { - return ListAcsSystems(new ListAcsSystemsRequest(userIdentityId: userIdentityId)); - } - - /// - /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task> ListAcsSystemsAsync(ListAcsSystemsRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/user_identities/list_acs_systems", - requestOptions - ) - ) - .EnsureData("/user_identities/list_acs_systems") - .AcsSystems; - } - - /// - /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task> ListAcsSystemsAsync(string userIdentityId = default) - { - return ( - await ListAcsSystemsAsync(new ListAcsSystemsRequest(userIdentityId: userIdentityId)) - ); - } - - /// - /// Request parameters for List ACS Users Associated with a User Identity. - /// - [DataContract(Name = "listAcsUsersRequest_request")] - public class ListAcsUsersRequest - { - [JsonConstructorAttribute] - protected ListAcsUsersRequest() { } - - public ListAcsUsersRequest(string userIdentityId = default) - { - UserIdentityId = userIdentityId; - } - - /// - /// ID of the user identity for which you want to retrieve all access system users. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listAcsUsersResponse_response")] - public class ListAcsUsersResponse - { - [JsonConstructorAttribute] - protected ListAcsUsersResponse() { } - - public ListAcsUsersResponse(List acsUsers = default) - { - AcsUsers = acsUsers; - } - - /// - /// OK - /// - [DataMember(Name = "acs_users", IsRequired = false, EmitDefaultValue = false)] - public List AcsUsers { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) assigned to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public List ListAcsUsers(ListAcsUsersRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/user_identities/list_acs_users", requestOptions) - .EnsureData("/user_identities/list_acs_users") - .AcsUsers; - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) assigned to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public List ListAcsUsers(string userIdentityId = default) - { - return ListAcsUsers(new ListAcsUsersRequest(userIdentityId: userIdentityId)); - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) assigned to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task> ListAcsUsersAsync(ListAcsUsersRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/user_identities/list_acs_users", - requestOptions - ) - ) - .EnsureData("/user_identities/list_acs_users") - .AcsUsers; - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) assigned to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task> ListAcsUsersAsync(string userIdentityId = default) - { - return ( - await ListAcsUsersAsync(new ListAcsUsersRequest(userIdentityId: userIdentityId)) - ); - } - - /// - /// Request parameters for Merge User Identities. - /// - [DataContract(Name = "mergeRequest_request")] - public class MergeRequest - { - [JsonConstructorAttribute] - protected MergeRequest() { } - - public MergeRequest( - List? mergedUserIdentityIds = default, - string? userIdentityId = default, - List? mergedUserIdentityKeys = default, - string? userIdentityKey = default - ) - { - MergedUserIdentityIds = mergedUserIdentityIds; - UserIdentityId = userIdentityId; - MergedUserIdentityKeys = mergedUserIdentityKeys; - UserIdentityKey = userIdentityKey; - } - - /// - /// IDs of the user identities to merge into the primary user identity. These user identities are deleted. - /// - [DataMember( - Name = "merged_user_identity_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? MergedUserIdentityIds { get; set; } - - /// - /// ID of the primary user identity to keep. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Keys of the user identities to merge into the primary user identity. These user identities are deleted. - /// - [DataMember( - Name = "merged_user_identity_keys", - IsRequired = false, - EmitDefaultValue = false - )] - public List? MergedUserIdentityKeys { get; set; } - - /// - /// Key of the primary user identity to keep. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Merges one or more [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) into a primary user identity, for when the same person ended up with more than one user identity. - /// - /// The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as `merged_user_identity_ids` and `merged_user_identity_keys`. - /// - /// Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. - /// - /// Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes. - /// - public void Merge(MergeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/user_identities/merge", requestOptions); - } - - /// - /// Merges one or more [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) into a primary user identity, for when the same person ended up with more than one user identity. - /// - /// The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as `merged_user_identity_ids` and `merged_user_identity_keys`. - /// - /// Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. - /// - /// Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes. - /// - public void Merge( - List? mergedUserIdentityIds = default, - string? userIdentityId = default, - List? mergedUserIdentityKeys = default, - string? userIdentityKey = default - ) - { - Merge( - new MergeRequest( - mergedUserIdentityIds: mergedUserIdentityIds, - userIdentityId: userIdentityId, - mergedUserIdentityKeys: mergedUserIdentityKeys, - userIdentityKey: userIdentityKey - ) - ); - } - - /// - /// Merges one or more [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) into a primary user identity, for when the same person ended up with more than one user identity. - /// - /// The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as `merged_user_identity_ids` and `merged_user_identity_keys`. - /// - /// Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. - /// - /// Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes. - /// - public async Task MergeAsync(MergeRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/user_identities/merge", requestOptions); - } - - /// - /// Merges one or more [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) into a primary user identity, for when the same person ended up with more than one user identity. - /// - /// The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as `merged_user_identity_ids` and `merged_user_identity_keys`. - /// - /// Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. - /// - /// Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes. - /// - public async Task MergeAsync( - List? mergedUserIdentityIds = default, - string? userIdentityId = default, - List? mergedUserIdentityKeys = default, - string? userIdentityKey = default - ) - { - await MergeAsync( - new MergeRequest( - mergedUserIdentityIds: mergedUserIdentityIds, - userIdentityId: userIdentityId, - mergedUserIdentityKeys: mergedUserIdentityKeys, - userIdentityKey: userIdentityKey - ) - ); - } - - /// - /// Request parameters for Remove an ACS User from a User Identity. - /// - [DataContract(Name = "removeAcsUserRequest_request")] - public class RemoveAcsUserRequest - { - [JsonConstructorAttribute] - protected RemoveAcsUserRequest() { } - - public RemoveAcsUserRequest(string acsUserId = default, string userIdentityId = default) - { - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access system user that you want to remove from the user identity.. - /// - [DataMember(Name = "acs_user_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsUserId { get; set; } - - /// - /// ID of the user identity from which you want to remove an access system user. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public void RemoveAcsUser(RemoveAcsUserRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/user_identities/remove_acs_user", requestOptions); - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public void RemoveAcsUser(string acsUserId = default, string userIdentityId = default) - { - RemoveAcsUser( - new RemoveAcsUserRequest(acsUserId: acsUserId, userIdentityId: userIdentityId) - ); - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task RemoveAcsUserAsync(RemoveAcsUserRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/user_identities/remove_acs_user", requestOptions); - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task RemoveAcsUserAsync( - string acsUserId = default, - string userIdentityId = default - ) - { - await RemoveAcsUserAsync( - new RemoveAcsUserRequest(acsUserId: acsUserId, userIdentityId: userIdentityId) - ); - } - - /// - /// Request parameters for Revoke Access to a Device from a User Identity. - /// - [DataContract(Name = "revokeAccessToDeviceRequest_request")] - public class RevokeAccessToDeviceRequest - { - [JsonConstructorAttribute] - protected RevokeAccessToDeviceRequest() { } - - public RevokeAccessToDeviceRequest( - string deviceId = default, - string userIdentityId = default - ) - { - DeviceId = deviceId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the managed device to which you want to revoke access from the user identity. - /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// ID of the user identity from which you want to revoke access to a device. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Revokes access to a specified [device](https://docs.seam.co/core-concepts/devices/) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public void RevokeAccessToDevice(RevokeAccessToDeviceRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/user_identities/revoke_access_to_device", requestOptions); - } - - /// - /// Revokes access to a specified [device](https://docs.seam.co/core-concepts/devices/) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public void RevokeAccessToDevice(string deviceId = default, string userIdentityId = default) - { - RevokeAccessToDevice( - new RevokeAccessToDeviceRequest(deviceId: deviceId, userIdentityId: userIdentityId) - ); - } - - /// - /// Revokes access to a specified [device](https://docs.seam.co/core-concepts/devices/) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task RevokeAccessToDeviceAsync(RevokeAccessToDeviceRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync( - "/user_identities/revoke_access_to_device", - requestOptions - ); - } - - /// - /// Revokes access to a specified [device](https://docs.seam.co/core-concepts/devices/) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task RevokeAccessToDeviceAsync( - string deviceId = default, - string userIdentityId = default - ) - { - await RevokeAccessToDeviceAsync( - new RevokeAccessToDeviceRequest(deviceId: deviceId, userIdentityId: userIdentityId) - ); - } - - /// - /// Request parameters for Update a User Identity. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string? emailAddress = default, - string? fullName = default, - string? phoneNumber = default, - string userIdentityId = default, - string? userIdentityKey = default - ) - { - EmailAddress = emailAddress; - FullName = fullName; - PhoneNumber = phoneNumber; - UserIdentityId = userIdentityId; - UserIdentityKey = userIdentityKey; - } - - /// - /// Unique email address for the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Full name of the user associated with the user identity. - /// - [DataMember(Name = "full_name", IsRequired = false, EmitDefaultValue = false)] - public string? FullName { get; set; } - - /// - /// Unique phone number for the user identity. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// ID of the user identity that you want to update. - /// - [DataMember(Name = "user_identity_id", IsRequired = true, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - /// - /// Unique key for the user identity. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/user_identities/update", requestOptions); - } - - /// - /// Updates a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public void Update( - string? emailAddress = default, - string? fullName = default, - string? phoneNumber = default, - string userIdentityId = default, - string? userIdentityKey = default - ) - { - Update( - new UpdateRequest( - emailAddress: emailAddress, - fullName: fullName, - phoneNumber: phoneNumber, - userIdentityId: userIdentityId, - userIdentityKey: userIdentityKey - ) - ); - } - - /// - /// Updates a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/user_identities/update", requestOptions); - } - - /// - /// Updates a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). - /// - public async Task UpdateAsync( - string? emailAddress = default, - string? fullName = default, - string? phoneNumber = default, - string userIdentityId = default, - string? userIdentityKey = default - ) - { - await UpdateAsync( - new UpdateRequest( - emailAddress: emailAddress, - fullName: fullName, - phoneNumber: phoneNumber, - userIdentityId: userIdentityId, - userIdentityKey: userIdentityKey - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.UserIdentities UserIdentities => new(this); - } - - public partial interface ISeamClient - { - public Api.UserIdentities UserIdentities { get; } - } -} diff --git a/src/Seam/Api/UsersAcs.cs b/src/Seam/Api/UsersAcs.cs deleted file mode 100644 index 152d54ca..00000000 --- a/src/Seam/Api/UsersAcs.cs +++ /dev/null @@ -1,1750 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class UsersAcs - { - private ISeamClient _seam; - - public UsersAcs(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Add an ACS User to an Access Group. - /// - [DataContract(Name = "addToAccessGroupRequest_request")] - public class AddToAccessGroupRequest - { - [JsonConstructorAttribute] - protected AddToAccessGroupRequest() { } - - public AddToAccessGroupRequest( - string acsAccessGroupId = default, - string acsUserId = default - ) - { - AcsAccessGroupId = acsAccessGroupId; - AcsUserId = acsUserId; - } - - /// - /// ID of the access group to which you want to add an access system user. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - /// - /// ID of the access system user that you want to add to an access group. - /// - [DataMember(Name = "acs_user_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsUserId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void AddToAccessGroup(AddToAccessGroupRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/acs/users/add_to_access_group", requestOptions); - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void AddToAccessGroup(string acsAccessGroupId = default, string acsUserId = default) - { - AddToAccessGroup( - new AddToAccessGroupRequest( - acsAccessGroupId: acsAccessGroupId, - acsUserId: acsUserId - ) - ); - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task AddToAccessGroupAsync(AddToAccessGroupRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/acs/users/add_to_access_group", requestOptions); - } - - /// - /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task AddToAccessGroupAsync( - string acsAccessGroupId = default, - string acsUserId = default - ) - { - await AddToAccessGroupAsync( - new AddToAccessGroupRequest( - acsAccessGroupId: acsAccessGroupId, - acsUserId: acsUserId - ) - ); - } - - /// - /// Request parameters for Create an ACS User. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - CreateRequestAccessSchedule? accessSchedule = default, - List? acsAccessGroupIds = default, - string acsSystemId = default, - string? email = default, - string? emailAddress = default, - string fullName = default, - string? phoneNumber = default, - string? userIdentityId = default - ) - { - AccessSchedule = accessSchedule; - AcsAccessGroupIds = acsAccessGroupIds; - AcsSystemId = acsSystemId; - Email = email; - EmailAddress = emailAddress; - FullName = fullName; - PhoneNumber = phoneNumber; - UserIdentityId = userIdentityId; - } - - /// - /// `starts_at` and `ends_at` timestamps for the new access system user's access. If you specify an `access_schedule`, you may include both `starts_at` and `ends_at`. If you omit `starts_at`, it defaults to the current time. `ends_at` is optional and must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "access_schedule", IsRequired = false, EmitDefaultValue = false)] - public CreateRequestAccessSchedule? AccessSchedule { get; set; } - - /// - /// Array of access group IDs to indicate the access groups to which you want to add the new access system user. - /// - [DataMember( - Name = "acs_access_group_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? AcsAccessGroupIds { get; set; } - - /// - /// ID of the access system to which you want to add the new access system user. - /// - [DataMember(Name = "acs_system_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - [Obsolete("use email_address.")] - [DataMember(Name = "email", IsRequired = false, EmitDefaultValue = false)] - public string? Email { get; set; } - - /// - /// Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Full name of the new access system user. - /// - [DataMember(Name = "full_name", IsRequired = true, EmitDefaultValue = false)] - public string FullName { get; set; } - - /// - /// Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// ID of the user identity with which you want to associate the new access system user. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestAccessSchedule_model")] - public class CreateRequestAccessSchedule - { - [JsonConstructorAttribute] - protected CreateRequestAccessSchedule() { } - - public CreateRequestAccessSchedule(string? endsAt = default, string? startsAt = default) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Ending timestamp for the new access system user's access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Starting timestamp for the new access system user's access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(AcsUser acsUser = default) - { - AcsUser = acsUser; - } - - /// - /// OK - /// - [DataMember(Name = "acs_user", IsRequired = false, EmitDefaultValue = false)] - public AcsUser AcsUser { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public AcsUser Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/acs/users/create", requestOptions) - .EnsureData("/acs/users/create") - .AcsUser; - } - - /// - /// Creates a new [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public AcsUser Create( - CreateRequestAccessSchedule? accessSchedule = default, - List? acsAccessGroupIds = default, - string acsSystemId = default, - string? email = default, - string? emailAddress = default, - string fullName = default, - string? phoneNumber = default, - string? userIdentityId = default - ) - { - return Create( - new CreateRequest( - accessSchedule: accessSchedule, - acsAccessGroupIds: acsAccessGroupIds, - acsSystemId: acsSystemId, - email: email, - emailAddress: emailAddress, - fullName: fullName, - phoneNumber: phoneNumber, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Creates a new [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/acs/users/create", requestOptions)) - .EnsureData("/acs/users/create") - .AcsUser; - } - - /// - /// Creates a new [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task CreateAsync( - CreateRequestAccessSchedule? accessSchedule = default, - List? acsAccessGroupIds = default, - string acsSystemId = default, - string? email = default, - string? emailAddress = default, - string fullName = default, - string? phoneNumber = default, - string? userIdentityId = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - accessSchedule: accessSchedule, - acsAccessGroupIds: acsAccessGroupIds, - acsSystemId: acsSystemId, - email: email, - emailAddress: emailAddress, - fullName: fullName, - phoneNumber: phoneNumber, - userIdentityId: userIdentityId - ) - ) - ); - } - - /// - /// Request parameters for Delete an ACS User. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access system that you want to delete. You must provide acs_system_id with user_identity_id. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user that you want to delete. You must provide either acs_user_id or user_identity_id - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity that you want to delete. You must provide either acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) and invalidates the access system user's [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/acs/users/delete", requestOptions); - } - - /// - /// Deletes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) and invalidates the access system user's [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public void Delete( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - Delete( - new DeleteRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Deletes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) and invalidates the access system user's [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/acs/users/delete", requestOptions); - } - - /// - /// Deletes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) and invalidates the access system user's [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - public async Task DeleteAsync( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await DeleteAsync( - new DeleteRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Request parameters for Get an ACS User. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access system that you want to get. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user that you want to get. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity that you want to get. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(AcsUser acsUser = default) - { - AcsUser = acsUser; - } - - /// - /// OK - /// - [DataMember(Name = "acs_user", IsRequired = false, EmitDefaultValue = false)] - public AcsUser AcsUser { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public AcsUser Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/users/get", requestOptions) - .EnsureData("/acs/users/get") - .AcsUser; - } - - /// - /// Returns a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public AcsUser Get( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - return Get( - new GetRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Returns a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/users/get", requestOptions)) - .EnsureData("/acs/users/get") - .AcsUser; - } - - /// - /// Returns a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task GetAsync( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - return ( - await GetAsync( - new GetRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ) - ); - } - - /// - /// Request parameters for List ACS Users. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? acsSystemId = default, - string? createdBefore = default, - int? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentityEmailAddress = default, - string? userIdentityId = default, - string? userIdentityPhoneNumber = default - ) - { - AcsSystemId = acsSystemId; - CreatedBefore = createdBefore; - Limit = limit; - PageCursor = pageCursor; - Search = search; - UserIdentityEmailAddress = userIdentityEmailAddress; - UserIdentityId = userIdentityId; - UserIdentityPhoneNumber = userIdentityPhoneNumber; - } - - /// - /// ID of the `acs_system` for which you want to retrieve all access system users. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// Timestamp by which to limit returned access system users. Returns users created before this timestamp. - /// - [DataMember(Name = "created_before", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedBefore { get; set; } - - /// - /// Maximum number of records to return per page. - /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public int? Limit { get; set; } - - /// - /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. - /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } - - /// - /// String for which to search. Filters returned access system users to include all records that satisfy a partial match using `full_name`, `phone_number`, `email_address`, `acs_user_id`, `user_identity_id`, `user_identity_full_name` or `user_identity_phone_number`. - /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } - - /// - /// Email address of the user identity for which you want to retrieve all access system users. Specify `null` to retrieve access system users whose user identity has no email address. - /// - [DataMember( - Name = "user_identity_email_address", - IsRequired = false, - EmitDefaultValue = false - )] - public string? UserIdentityEmailAddress { get; set; } - - /// - /// ID of the user identity for which you want to retrieve all access system users. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Phone number of the user identity for which you want to retrieve all access system users, in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, `+15555550100`). Specify `null` to retrieve access system users whose user identity has no phone number. - /// - [DataMember( - Name = "user_identity_phone_number", - IsRequired = false, - EmitDefaultValue = false - )] - public string? UserIdentityPhoneNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List acsUsers = default) - { - AcsUsers = acsUsers; - } - - /// - /// OK - /// - [DataMember(Name = "acs_users", IsRequired = false, EmitDefaultValue = false)] - public List AcsUsers { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/acs/users/list", requestOptions) - .EnsureData("/acs/users/list") - .AcsUsers; - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public List List( - string? acsSystemId = default, - string? createdBefore = default, - int? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentityEmailAddress = default, - string? userIdentityId = default, - string? userIdentityPhoneNumber = default - ) - { - return List( - new ListRequest( - acsSystemId: acsSystemId, - createdBefore: createdBefore, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentityEmailAddress: userIdentityEmailAddress, - userIdentityId: userIdentityId, - userIdentityPhoneNumber: userIdentityPhoneNumber - ) - ); - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/acs/users/list", requestOptions)) - .EnsureData("/acs/users/list") - .AcsUsers; - } - - /// - /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task> ListAsync( - string? acsSystemId = default, - string? createdBefore = default, - int? limit = default, - string? pageCursor = default, - string? search = default, - string? userIdentityEmailAddress = default, - string? userIdentityId = default, - string? userIdentityPhoneNumber = default - ) - { - return ( - await ListAsync( - new ListRequest( - acsSystemId: acsSystemId, - createdBefore: createdBefore, - limit: limit, - pageCursor: pageCursor, - search: search, - userIdentityEmailAddress: userIdentityEmailAddress, - userIdentityId: userIdentityId, - userIdentityPhoneNumber: userIdentityPhoneNumber - ) - ) - ); - } - - /// - /// Request parameters for List ACS User-Accessible Entrances. - /// - [DataContract(Name = "listAccessibleEntrancesRequest_request")] - public class ListAccessibleEntrancesRequest - { - [JsonConstructorAttribute] - protected ListAccessibleEntrancesRequest() { } - - public ListAccessibleEntrancesRequest( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access system for which you want to list accessible entrances. You can only provide acs_system_id with user_identity_id. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listAccessibleEntrancesResponse_response")] - public class ListAccessibleEntrancesResponse - { - [JsonConstructorAttribute] - protected ListAccessibleEntrancesResponse() { } - - public ListAccessibleEntrancesResponse(List acsEntrances = default) - { - AcsEntrances = acsEntrances; - } - - /// - /// OK - /// - [DataMember(Name = "acs_entrances", IsRequired = false, EmitDefaultValue = false)] - public List AcsEntrances { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Lists the [entrances](https://docs.seam.co/api/acs/entrances) to which a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) has access. - /// - public List ListAccessibleEntrances(ListAccessibleEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get( - "/acs/users/list_accessible_entrances", - requestOptions - ) - .EnsureData("/acs/users/list_accessible_entrances") - .AcsEntrances; - } - - /// - /// Lists the [entrances](https://docs.seam.co/api/acs/entrances) to which a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) has access. - /// - public List ListAccessibleEntrances( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - return ListAccessibleEntrances( - new ListAccessibleEntrancesRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Lists the [entrances](https://docs.seam.co/api/acs/entrances) to which a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) has access. - /// - public async Task> ListAccessibleEntrancesAsync( - ListAccessibleEntrancesRequest request - ) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( - "/acs/users/list_accessible_entrances", - requestOptions - ) - ) - .EnsureData("/acs/users/list_accessible_entrances") - .AcsEntrances; - } - - /// - /// Lists the [entrances](https://docs.seam.co/api/acs/entrances) to which a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) has access. - /// - public async Task> ListAccessibleEntrancesAsync( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - return ( - await ListAccessibleEntrancesAsync( - new ListAccessibleEntrancesRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ) - ); - } - - /// - /// Request parameters for Remove an ACS User from an Access Group. - /// - [DataContract(Name = "removeFromAccessGroupRequest_request")] - public class RemoveFromAccessGroupRequest - { - [JsonConstructorAttribute] - protected RemoveFromAccessGroupRequest() { } - - public RemoveFromAccessGroupRequest( - string acsAccessGroupId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsAccessGroupId = acsAccessGroupId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access group from which you want to remove an access system user. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = true, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - /// - /// ID of the access system user that you want to remove from an access group. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity that you want to remove from an access group. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void RemoveFromAccessGroup(RemoveFromAccessGroupRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/acs/users/remove_from_access_group", requestOptions); - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public void RemoveFromAccessGroup( - string acsAccessGroupId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - RemoveFromAccessGroup( - new RemoveFromAccessGroupRequest( - acsAccessGroupId: acsAccessGroupId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task RemoveFromAccessGroupAsync(RemoveFromAccessGroupRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/acs/users/remove_from_access_group", requestOptions); - } - - /// - /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). - /// - public async Task RemoveFromAccessGroupAsync( - string acsAccessGroupId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await RemoveFromAccessGroupAsync( - new RemoveFromAccessGroupRequest( - acsAccessGroupId: acsAccessGroupId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Request parameters for Revoke ACS User Access to All Entrances. - /// - [DataContract(Name = "revokeAccessToAllEntrancesRequest_request")] - public class RevokeAccessToAllEntrancesRequest - { - [JsonConstructorAttribute] - protected RevokeAccessToAllEntrancesRequest() { } - - public RevokeAccessToAllEntrancesRequest( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access system for which you want to revoke access. You can only provide acs_system_id with user_identity_id. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user for whom you want to revoke access. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity for whom you want to revoke access. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Revokes access to all [entrances](https://docs.seam.co/api/acs/entrances) for a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public void RevokeAccessToAllEntrances(RevokeAccessToAllEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/acs/users/revoke_access_to_all_entrances", requestOptions); - } - - /// - /// Revokes access to all [entrances](https://docs.seam.co/api/acs/entrances) for a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public void RevokeAccessToAllEntrances( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - RevokeAccessToAllEntrances( - new RevokeAccessToAllEntrancesRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Revokes access to all [entrances](https://docs.seam.co/api/acs/entrances) for a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task RevokeAccessToAllEntrancesAsync(RevokeAccessToAllEntrancesRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync( - "/acs/users/revoke_access_to_all_entrances", - requestOptions - ); - } - - /// - /// Revokes access to all [entrances](https://docs.seam.co/api/acs/entrances) for a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task RevokeAccessToAllEntrancesAsync( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await RevokeAccessToAllEntrancesAsync( - new RevokeAccessToAllEntrancesRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Request parameters for Suspend an ACS User. - /// - [DataContract(Name = "suspendRequest_request")] - public class SuspendRequest - { - [JsonConstructorAttribute] - protected SuspendRequest() { } - - public SuspendRequest( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access system that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// [Suspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#suspend-an-acs-user) a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can [unsuspend](https://docs.seam.co/api/acs/users/unsuspend) them. - /// - public void Suspend(SuspendRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/acs/users/suspend", requestOptions); - } - - /// - /// [Suspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#suspend-an-acs-user) a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can [unsuspend](https://docs.seam.co/api/acs/users/unsuspend) them. - /// - public void Suspend( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - Suspend( - new SuspendRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// [Suspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#suspend-an-acs-user) a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can [unsuspend](https://docs.seam.co/api/acs/users/unsuspend) them. - /// - public async Task SuspendAsync(SuspendRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/acs/users/suspend", requestOptions); - } - - /// - /// [Suspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#suspend-an-acs-user) a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can [unsuspend](https://docs.seam.co/api/acs/users/unsuspend) them. - /// - public async Task SuspendAsync( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await SuspendAsync( - new SuspendRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Request parameters for Unsuspend an ACS User. - /// - [DataContract(Name = "unsuspendRequest_request")] - public class UnsuspendRequest - { - [JsonConstructorAttribute] - protected UnsuspendRequest() { } - - public UnsuspendRequest( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - UserIdentityId = userIdentityId; - } - - /// - /// ID of the access system of the user that you want to unsuspend. You can only provide acs_system_id with user_identity_id. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// ID of the user identity that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// [Unsuspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#unsuspend-an-acs-user) a specified suspended [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). While [suspending an access system user](https://docs.seam.co/api/acs/users/suspend) revokes their access temporarily, unsuspending the access system user restores their access. - /// - public void Unsuspend(UnsuspendRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/acs/users/unsuspend", requestOptions); - } - - /// - /// [Unsuspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#unsuspend-an-acs-user) a specified suspended [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). While [suspending an access system user](https://docs.seam.co/api/acs/users/suspend) revokes their access temporarily, unsuspending the access system user restores their access. - /// - public void Unsuspend( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - Unsuspend( - new UnsuspendRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// [Unsuspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#unsuspend-an-acs-user) a specified suspended [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). While [suspending an access system user](https://docs.seam.co/api/acs/users/suspend) revokes their access temporarily, unsuspending the access system user restores their access. - /// - public async Task UnsuspendAsync(UnsuspendRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/acs/users/unsuspend", requestOptions); - } - - /// - /// [Unsuspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#unsuspend-an-acs-user) a specified suspended [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). While [suspending an access system user](https://docs.seam.co/api/acs/users/suspend) revokes their access temporarily, unsuspending the access system user restores their access. - /// - public async Task UnsuspendAsync( - string? acsSystemId = default, - string? acsUserId = default, - string? userIdentityId = default - ) - { - await UnsuspendAsync( - new UnsuspendRequest( - acsSystemId: acsSystemId, - acsUserId: acsUserId, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Request parameters for Update an ACS User. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - UpdateRequestAccessSchedule? accessSchedule = default, - string? acsSystemId = default, - string? acsUserId = default, - string? email = default, - string? emailAddress = default, - string? fullName = default, - string? hidAcsSystemId = default, - string? phoneNumber = default, - string? userIdentityId = default - ) - { - AccessSchedule = accessSchedule; - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - Email = email; - EmailAddress = emailAddress; - FullName = fullName; - HidAcsSystemId = hidAcsSystemId; - PhoneNumber = phoneNumber; - UserIdentityId = userIdentityId; - } - - /// - /// `starts_at` and `ends_at` timestamps for the access system user's access. If you specify an `access_schedule`, you may include both `starts_at` and `ends_at`. If you omit `starts_at`, it defaults to the current time. `ends_at` is optional and must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "access_schedule", IsRequired = false, EmitDefaultValue = false)] - public UpdateRequestAccessSchedule? AccessSchedule { get; set; } - - /// - /// ID of the access system that you want to update. You can only provide acs_system_id with user_identity_id. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } - - /// - /// ID of the access system user that you want to update. You can only provide acs_user_id or user_identity_id. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - [Obsolete("use email_address.")] - [DataMember(Name = "email", IsRequired = false, EmitDefaultValue = false)] - public string? Email { get; set; } - - /// - /// Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Full name of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "full_name", IsRequired = false, EmitDefaultValue = false)] - public string? FullName { get; set; } - - /// - /// ID of the HID access control system associated with the user. - /// - [DataMember(Name = "hid_acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? HidAcsSystemId { get; set; } - - /// - /// Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// ID of the user identity that you want to update. You can only provide acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "updateRequestAccessSchedule_model")] - public class UpdateRequestAccessSchedule - { - [JsonConstructorAttribute] - protected UpdateRequestAccessSchedule() { } - - public UpdateRequestAccessSchedule(string? endsAt = default, string? startsAt = default) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Ending timestamp for the access system user's access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Starting timestamp for the access system user's access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates the properties of a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/acs/users/update", requestOptions); - } - - /// - /// Updates the properties of a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public void Update( - UpdateRequestAccessSchedule? accessSchedule = default, - string? acsSystemId = default, - string? acsUserId = default, - string? email = default, - string? emailAddress = default, - string? fullName = default, - string? hidAcsSystemId = default, - string? phoneNumber = default, - string? userIdentityId = default - ) - { - Update( - new UpdateRequest( - accessSchedule: accessSchedule, - acsSystemId: acsSystemId, - acsUserId: acsUserId, - email: email, - emailAddress: emailAddress, - fullName: fullName, - hidAcsSystemId: hidAcsSystemId, - phoneNumber: phoneNumber, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Updates the properties of a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/acs/users/update", requestOptions); - } - - /// - /// Updates the properties of a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - public async Task UpdateAsync( - UpdateRequestAccessSchedule? accessSchedule = default, - string? acsSystemId = default, - string? acsUserId = default, - string? email = default, - string? emailAddress = default, - string? fullName = default, - string? hidAcsSystemId = default, - string? phoneNumber = default, - string? userIdentityId = default - ) - { - await UpdateAsync( - new UpdateRequest( - accessSchedule: accessSchedule, - acsSystemId: acsSystemId, - acsUserId: acsUserId, - email: email, - emailAddress: emailAddress, - fullName: fullName, - hidAcsSystemId: hidAcsSystemId, - phoneNumber: phoneNumber, - userIdentityId: userIdentityId - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.UsersAcs UsersAcs => new(this); - } - - public partial interface ISeamClient - { - public Api.UsersAcs UsersAcs { get; } - } -} diff --git a/src/Seam/Api/Webhooks.cs b/src/Seam/Api/Webhooks.cs deleted file mode 100644 index 7256e4e1..00000000 --- a/src/Seam/Api/Webhooks.cs +++ /dev/null @@ -1,546 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class Webhooks - { - private ISeamClient _seam; - - public Webhooks(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create a Webhook. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest(List? eventTypes = default, string url = default) - { - EventTypes = eventTypes; - Url = url; - } - - /// - /// Types of events that you want the new webhook to receive. - /// - [DataMember(Name = "event_types", IsRequired = false, EmitDefaultValue = false)] - public List? EventTypes { get; set; } - - /// - /// URL for the new webhook. - /// - [DataMember(Name = "url", IsRequired = true, EmitDefaultValue = false)] - public string Url { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(Webhook webhook = default) - { - Webhook = webhook; - } - - /// - /// OK - /// - [DataMember(Name = "webhook", IsRequired = false, EmitDefaultValue = false)] - public Webhook Webhook { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public Webhook Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/webhooks/create", requestOptions) - .EnsureData("/webhooks/create") - .Webhook; - } - - /// - /// Creates a new [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public Webhook Create(List? eventTypes = default, string url = default) - { - return Create(new CreateRequest(eventTypes: eventTypes, url: url)); - } - - /// - /// Creates a new [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/webhooks/create", requestOptions)) - .EnsureData("/webhooks/create") - .Webhook; - } - - /// - /// Creates a new [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task CreateAsync( - List? eventTypes = default, - string url = default - ) - { - return (await CreateAsync(new CreateRequest(eventTypes: eventTypes, url: url))); - } - - /// - /// Request parameters for Delete a Webhook. - /// - [DataContract(Name = "deleteRequest_request")] - public class DeleteRequest - { - [JsonConstructorAttribute] - protected DeleteRequest() { } - - public DeleteRequest(string webhookId = default) - { - WebhookId = webhookId; - } - - /// - /// ID of the webhook that you want to delete. - /// - [DataMember(Name = "webhook_id", IsRequired = true, EmitDefaultValue = false)] - public string WebhookId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Deletes a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public void Delete(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Delete("/webhooks/delete", requestOptions); - } - - /// - /// Deletes a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public void Delete(string webhookId = default) - { - Delete(new DeleteRequest(webhookId: webhookId)); - } - - /// - /// Deletes a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task DeleteAsync(DeleteRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.DeleteAsync("/webhooks/delete", requestOptions); - } - - /// - /// Deletes a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task DeleteAsync(string webhookId = default) - { - await DeleteAsync(new DeleteRequest(webhookId: webhookId)); - } - - /// - /// Request parameters for Get a Webhook. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string webhookId = default) - { - WebhookId = webhookId; - } - - /// - /// ID of the webhook that you want to get. - /// - [DataMember(Name = "webhook_id", IsRequired = true, EmitDefaultValue = false)] - public string WebhookId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(Webhook webhook = default) - { - Webhook = webhook; - } - - /// - /// OK - /// - [DataMember(Name = "webhook", IsRequired = false, EmitDefaultValue = false)] - public Webhook Webhook { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Gets a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public Webhook Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/webhooks/get", requestOptions) - .EnsureData("/webhooks/get") - .Webhook; - } - - /// - /// Gets a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public Webhook Get(string webhookId = default) - { - return Get(new GetRequest(webhookId: webhookId)); - } - - /// - /// Gets a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/webhooks/get", requestOptions)) - .EnsureData("/webhooks/get") - .Webhook; - } - - /// - /// Gets a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task GetAsync(string webhookId = default) - { - return (await GetAsync(new GetRequest(webhookId: webhookId))); - } - - /// - /// Request parameters for List Webhooks. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - public ListRequest() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List webhooks = default) - { - Webhooks = webhooks; - } - - /// - /// OK - /// - [DataMember(Name = "webhooks", IsRequired = false, EmitDefaultValue = false)] - public List Webhooks { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [webhooks](https://docs.seam.co/developer-tools/webhooks). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/webhooks/list", requestOptions) - .EnsureData("/webhooks/list") - .Webhooks; - } - - /// - /// Returns a list of all [webhooks](https://docs.seam.co/developer-tools/webhooks). - /// - public List List() - { - return List(new ListRequest()); - } - - /// - /// Returns a list of all [webhooks](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/webhooks/list", requestOptions)) - .EnsureData("/webhooks/list") - .Webhooks; - } - - /// - /// Returns a list of all [webhooks](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task> ListAsync() - { - return (await ListAsync(new ListRequest())); - } - - /// - /// Request parameters for Update a Webhook. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest(List eventTypes = default, string webhookId = default) - { - EventTypes = eventTypes; - WebhookId = webhookId; - } - - /// - /// Types of events that you want the webhook to receive. - /// - [DataMember(Name = "event_types", IsRequired = true, EmitDefaultValue = false)] - public List EventTypes { get; set; } - - /// - /// ID of the webhook that you want to update. - /// - [DataMember(Name = "webhook_id", IsRequired = true, EmitDefaultValue = false)] - public string WebhookId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Put("/webhooks/update", requestOptions); - } - - /// - /// Updates a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public void Update(List eventTypes = default, string webhookId = default) - { - Update(new UpdateRequest(eventTypes: eventTypes, webhookId: webhookId)); - } - - /// - /// Updates a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PutAsync("/webhooks/update", requestOptions); - } - - /// - /// Updates a specified [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - public async Task UpdateAsync(List eventTypes = default, string webhookId = default) - { - await UpdateAsync(new UpdateRequest(eventTypes: eventTypes, webhookId: webhookId)); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.Webhooks Webhooks => new(this); - } - - public partial interface ISeamClient - { - public Api.Webhooks Webhooks { get; } - } -} diff --git a/src/Seam/Api/Workspaces.cs b/src/Seam/Api/Workspaces.cs deleted file mode 100644 index 1e545a18..00000000 --- a/src/Seam/Api/Workspaces.cs +++ /dev/null @@ -1,966 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api -{ - public class Workspaces - { - private ISeamClient _seam; - - public Workspaces(ISeamClient seam) - { - _seam = seam; - } - - /// - /// Request parameters for Create a Workspace. - /// - [DataContract(Name = "createRequest_request")] - public class CreateRequest - { - [JsonConstructorAttribute] - protected CreateRequest() { } - - public CreateRequest( - string? companyName = default, - string? connectPartnerName = default, - CreateRequestConnectWebviewCustomization? connectWebviewCustomization = default, - bool? isSandbox = default, - string name = default, - string? organizationId = default, - CreateRequest.WebviewLogoShapeEnum? webviewLogoShape = default, - string? webviewPrimaryButtonColor = default, - string? webviewPrimaryButtonTextColor = default, - string? webviewSuccessMessage = default - ) - { - CompanyName = companyName; - ConnectPartnerName = connectPartnerName; - ConnectWebviewCustomization = connectWebviewCustomization; - IsSandbox = isSandbox; - Name = name; - OrganizationId = organizationId; - WebviewLogoShape = webviewLogoShape; - WebviewPrimaryButtonColor = webviewPrimaryButtonColor; - WebviewPrimaryButtonTextColor = webviewPrimaryButtonTextColor; - WebviewSuccessMessage = webviewSuccessMessage; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum WebviewLogoShapeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "circle")] - Circle = 1, - - [EnumMember(Value = "square")] - Square = 2, - } - - /// - /// Company name for the new workspace. - /// - [Obsolete("Use `connect_partner_name` instead.")] - [DataMember(Name = "company_name", IsRequired = false, EmitDefaultValue = false)] - public string? CompanyName { get; set; } - - /// - /// Connect partner name for the new workspace. - /// - [DataMember( - Name = "connect_partner_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectPartnerName { get; set; } - - /// - /// [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember( - Name = "connect_webview_customization", - IsRequired = false, - EmitDefaultValue = false - )] - public CreateRequestConnectWebviewCustomization? ConnectWebviewCustomization { get; set; } - - /// - /// Indicates whether the new workspace is a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - [DataMember(Name = "is_sandbox", IsRequired = false, EmitDefaultValue = false)] - public bool? IsSandbox { get; set; } - - /// - /// Name of the new workspace. - /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// ID of the organization to associate with the new workspace. - /// - [DataMember(Name = "organization_id", IsRequired = false, EmitDefaultValue = false)] - public string? OrganizationId { get; set; } - - [Obsolete("Use `connect_webview_customization.webview_logo_shape` instead.")] - [DataMember(Name = "webview_logo_shape", IsRequired = false, EmitDefaultValue = false)] - public CreateRequest.WebviewLogoShapeEnum? WebviewLogoShape { get; set; } - - [Obsolete("Use `connect_webview_customization.webview_primary_button_color` instead.")] - [DataMember( - Name = "webview_primary_button_color", - IsRequired = false, - EmitDefaultValue = false - )] - public string? WebviewPrimaryButtonColor { get; set; } - - [Obsolete( - "Use `connect_webview_customization.webview_primary_button_text_color` instead." - )] - [DataMember( - Name = "webview_primary_button_text_color", - IsRequired = false, - EmitDefaultValue = false - )] - public string? WebviewPrimaryButtonTextColor { get; set; } - - [Obsolete("Use `connect_webview_customization.webview_success_message` instead.")] - [DataMember( - Name = "webview_success_message", - IsRequired = false, - EmitDefaultValue = false - )] - public string? WebviewSuccessMessage { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createRequestConnectWebviewCustomization_model")] - public class CreateRequestConnectWebviewCustomization - { - [JsonConstructorAttribute] - protected CreateRequestConnectWebviewCustomization() { } - - public CreateRequestConnectWebviewCustomization( - CreateRequestConnectWebviewCustomization.LogoShapeEnum? logoShape = default, - string? primaryButtonColor = default, - string? primaryButtonTextColor = default, - string? successMessage = default - ) - { - LogoShape = logoShape; - PrimaryButtonColor = primaryButtonColor; - PrimaryButtonTextColor = primaryButtonTextColor; - SuccessMessage = successMessage; - } - - /// - /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum LogoShapeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "circle")] - Circle = 1, - - [EnumMember(Value = "square")] - Square = 2, - } - - /// - /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember(Name = "logo_shape", IsRequired = false, EmitDefaultValue = false)] - public CreateRequestConnectWebviewCustomization.LogoShapeEnum? LogoShape { get; set; } - - /// - /// Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember( - Name = "primary_button_color", - IsRequired = false, - EmitDefaultValue = false - )] - public string? PrimaryButtonColor { get; set; } - - /// - /// Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember( - Name = "primary_button_text_color", - IsRequired = false, - EmitDefaultValue = false - )] - public string? PrimaryButtonTextColor { get; set; } - - /// - /// Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember(Name = "success_message", IsRequired = false, EmitDefaultValue = false)] - public string? SuccessMessage { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "createResponse_response")] - public class CreateResponse - { - [JsonConstructorAttribute] - protected CreateResponse() { } - - public CreateResponse(Workspace workspace = default) - { - Workspace = workspace; - } - - /// - /// OK - /// - [DataMember(Name = "workspace", IsRequired = false, EmitDefaultValue = false)] - public Workspace Workspace { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Creates a new [workspace](https://docs.seam.co/core-concepts/workspaces). - /// - public Workspace Create(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/workspaces/create", requestOptions) - .EnsureData("/workspaces/create") - .Workspace; - } - - /// - /// Creates a new [workspace](https://docs.seam.co/core-concepts/workspaces). - /// - public Workspace Create( - string? companyName = default, - string? connectPartnerName = default, - CreateRequestConnectWebviewCustomization? connectWebviewCustomization = default, - bool? isSandbox = default, - string name = default, - string? organizationId = default, - CreateRequest.WebviewLogoShapeEnum? webviewLogoShape = default, - string? webviewPrimaryButtonColor = default, - string? webviewPrimaryButtonTextColor = default, - string? webviewSuccessMessage = default - ) - { - return Create( - new CreateRequest( - companyName: companyName, - connectPartnerName: connectPartnerName, - connectWebviewCustomization: connectWebviewCustomization, - isSandbox: isSandbox, - name: name, - organizationId: organizationId, - webviewLogoShape: webviewLogoShape, - webviewPrimaryButtonColor: webviewPrimaryButtonColor, - webviewPrimaryButtonTextColor: webviewPrimaryButtonTextColor, - webviewSuccessMessage: webviewSuccessMessage - ) - ); - } - - /// - /// Creates a new [workspace](https://docs.seam.co/core-concepts/workspaces). - /// - public async Task CreateAsync(CreateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.PostAsync("/workspaces/create", requestOptions)) - .EnsureData("/workspaces/create") - .Workspace; - } - - /// - /// Creates a new [workspace](https://docs.seam.co/core-concepts/workspaces). - /// - public async Task CreateAsync( - string? companyName = default, - string? connectPartnerName = default, - CreateRequestConnectWebviewCustomization? connectWebviewCustomization = default, - bool? isSandbox = default, - string name = default, - string? organizationId = default, - CreateRequest.WebviewLogoShapeEnum? webviewLogoShape = default, - string? webviewPrimaryButtonColor = default, - string? webviewPrimaryButtonTextColor = default, - string? webviewSuccessMessage = default - ) - { - return ( - await CreateAsync( - new CreateRequest( - companyName: companyName, - connectPartnerName: connectPartnerName, - connectWebviewCustomization: connectWebviewCustomization, - isSandbox: isSandbox, - name: name, - organizationId: organizationId, - webviewLogoShape: webviewLogoShape, - webviewPrimaryButtonColor: webviewPrimaryButtonColor, - webviewPrimaryButtonTextColor: webviewPrimaryButtonTextColor, - webviewSuccessMessage: webviewSuccessMessage - ) - ) - ); - } - - /// - /// Request parameters for Get a Workspace. - /// - [DataContract(Name = "getRequest_request")] - public class GetRequest - { - [JsonConstructorAttribute] - public GetRequest() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "getResponse_response")] - public class GetResponse - { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(Workspace workspace = default) - { - Workspace = workspace; - } - - /// - /// OK - /// - [DataMember(Name = "workspace", IsRequired = false, EmitDefaultValue = false)] - public Workspace Workspace { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public Workspace Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/workspaces/get", requestOptions) - .EnsureData("/workspaces/get") - .Workspace; - } - - /// - /// Returns the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public Workspace Get() - { - return Get(new GetRequest()); - } - - /// - /// Returns the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/workspaces/get", requestOptions)) - .EnsureData("/workspaces/get") - .Workspace; - } - - /// - /// Returns the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public async Task GetAsync() - { - return (await GetAsync(new GetRequest())); - } - - /// - /// Request parameters for List Workspaces. - /// - [DataContract(Name = "listRequest_request")] - public class ListRequest - { - [JsonConstructorAttribute] - public ListRequest() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "listResponse_response")] - public class ListResponse - { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List workspaces = default) - { - Workspaces = workspaces; - } - - /// - /// OK - /// - [DataMember(Name = "workspaces", IsRequired = false, EmitDefaultValue = false)] - public List Workspaces { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of [workspaces](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/workspaces/list", requestOptions) - .EnsureData("/workspaces/list") - .Workspaces; - } - - /// - /// Returns a list of [workspaces](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public List List() - { - return List(new ListRequest()); - } - - /// - /// Returns a list of [workspaces](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/workspaces/list", requestOptions)) - .EnsureData("/workspaces/list") - .Workspaces; - } - - /// - /// Returns a list of [workspaces](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public async Task> ListAsync() - { - return (await ListAsync(new ListRequest())); - } - - /// - /// Request parameters for Reset a Sandbox Workspace. - /// - [DataContract(Name = "resetSandboxRequest_request")] - public class ResetSandboxRequest - { - [JsonConstructorAttribute] - public ResetSandboxRequest() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "resetSandboxResponse_response")] - public class ResetSandboxResponse - { - [JsonConstructorAttribute] - protected ResetSandboxResponse() { } - - public ResetSandboxResponse(ActionAttempt actionAttempt = default) - { - ActionAttempt = actionAttempt; - } - - /// - /// OK - /// - [DataMember(Name = "action_attempt", IsRequired = false, EmitDefaultValue = false)] - public ActionAttempt ActionAttempt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Resets the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) associated with the authentication value. Note that this endpoint is only available for sandbox workspaces. - /// - public ActionAttempt ResetSandbox(ResetSandboxRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Post("/workspaces/reset_sandbox", requestOptions) - .EnsureData("/workspaces/reset_sandbox") - .ActionAttempt; - } - - /// - /// Resets the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) associated with the authentication value. Note that this endpoint is only available for sandbox workspaces. - /// - public ActionAttempt ResetSandbox() - { - return ResetSandbox(new ResetSandboxRequest()); - } - - /// - /// Resets the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) associated with the authentication value. Note that this endpoint is only available for sandbox workspaces. - /// - public async Task ResetSandboxAsync(ResetSandboxRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.PostAsync( - "/workspaces/reset_sandbox", - requestOptions - ) - ) - .EnsureData("/workspaces/reset_sandbox") - .ActionAttempt; - } - - /// - /// Resets the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) associated with the authentication value. Note that this endpoint is only available for sandbox workspaces. - /// - public async Task ResetSandboxAsync() - { - return (await ResetSandboxAsync(new ResetSandboxRequest())); - } - - /// - /// Request parameters for Update a Workspace. - /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest - { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - string? connectPartnerName = default, - UpdateRequestConnectWebviewCustomization? connectWebviewCustomization = default, - bool? isPublishableKeyAuthEnabled = default, - bool? isSuspended = default, - string? name = default, - string? organizationId = default - ) - { - ConnectPartnerName = connectPartnerName; - ConnectWebviewCustomization = connectWebviewCustomization; - IsPublishableKeyAuthEnabled = isPublishableKeyAuthEnabled; - IsSuspended = isSuspended; - Name = name; - OrganizationId = organizationId; - } - - /// - /// Connect partner name for the workspace. - /// - [DataMember( - Name = "connect_partner_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectPartnerName { get; set; } - - /// - /// [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember( - Name = "connect_webview_customization", - IsRequired = false, - EmitDefaultValue = false - )] - public UpdateRequestConnectWebviewCustomization? ConnectWebviewCustomization { get; set; } - - /// - /// Indicates whether publishable key authentication is enabled for this workspace. - /// - [DataMember( - Name = "is_publishable_key_auth_enabled", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsPublishableKeyAuthEnabled { get; set; } - - /// - /// Indicates whether the workspace is suspended. - /// - [DataMember(Name = "is_suspended", IsRequired = false, EmitDefaultValue = false)] - public bool? IsSuspended { get; set; } - - /// - /// Name of the workspace. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// ID of the organization to assign the workspace to. The authenticated user must be the owner of the workspace and an admin of the target organization. - /// - [DataMember(Name = "organization_id", IsRequired = false, EmitDefaultValue = false)] - public string? OrganizationId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "updateRequestConnectWebviewCustomization_model")] - public class UpdateRequestConnectWebviewCustomization - { - [JsonConstructorAttribute] - protected UpdateRequestConnectWebviewCustomization() { } - - public UpdateRequestConnectWebviewCustomization( - UpdateRequestConnectWebviewCustomization.LogoShapeEnum? logoShape = default, - string? primaryButtonColor = default, - string? primaryButtonTextColor = default, - string? successMessage = default - ) - { - LogoShape = logoShape; - PrimaryButtonColor = primaryButtonColor; - PrimaryButtonTextColor = primaryButtonTextColor; - SuccessMessage = successMessage; - } - - /// - /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum LogoShapeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "circle")] - Circle = 1, - - [EnumMember(Value = "square")] - Square = 2, - } - - /// - /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember(Name = "logo_shape", IsRequired = false, EmitDefaultValue = false)] - public UpdateRequestConnectWebviewCustomization.LogoShapeEnum? LogoShape { get; set; } - - /// - /// Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember( - Name = "primary_button_color", - IsRequired = false, - EmitDefaultValue = false - )] - public string? PrimaryButtonColor { get; set; } - - /// - /// Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember( - Name = "primary_button_text_color", - IsRequired = false, - EmitDefaultValue = false - )] - public string? PrimaryButtonTextColor { get; set; } - - /// - /// Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember(Name = "success_message", IsRequired = false, EmitDefaultValue = false)] - public string? SuccessMessage { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/workspaces/update", requestOptions); - } - - /// - /// Updates the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public void Update( - string? connectPartnerName = default, - UpdateRequestConnectWebviewCustomization? connectWebviewCustomization = default, - bool? isPublishableKeyAuthEnabled = default, - bool? isSuspended = default, - string? name = default, - string? organizationId = default - ) - { - Update( - new UpdateRequest( - connectPartnerName: connectPartnerName, - connectWebviewCustomization: connectWebviewCustomization, - isPublishableKeyAuthEnabled: isPublishableKeyAuthEnabled, - isSuspended: isSuspended, - name: name, - organizationId: organizationId - ) - ); - } - - /// - /// Updates the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/workspaces/update", requestOptions); - } - - /// - /// Updates the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. - /// - public async Task UpdateAsync( - string? connectPartnerName = default, - UpdateRequestConnectWebviewCustomization? connectWebviewCustomization = default, - bool? isPublishableKeyAuthEnabled = default, - bool? isSuspended = default, - string? name = default, - string? organizationId = default - ) - { - await UpdateAsync( - new UpdateRequest( - connectPartnerName: connectPartnerName, - connectWebviewCustomization: connectWebviewCustomization, - isPublishableKeyAuthEnabled: isPublishableKeyAuthEnabled, - isSuspended: isSuspended, - name: name, - organizationId: organizationId - ) - ); - } - } -} - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.Workspaces Workspaces => new(this); - } - - public partial interface ISeamClient - { - public Api.Workspaces Workspaces { get; } - } -} diff --git a/src/Seam/Client/ApiResponse.cs b/src/Seam/Client/ApiResponse.cs deleted file mode 100644 index f29fe4cc..00000000 --- a/src/Seam/Client/ApiResponse.cs +++ /dev/null @@ -1,189 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using Seam.Client; - -namespace Seam.Client -{ - /// - /// Provides a non-generic contract for the ApiResponse wrapper. - /// - public interface IApiResponse - { - /// - /// The data type of - /// - Type ResponseType { get; } - - /// - /// The content of this response - /// - Object Content { get; } - - /// - /// Gets or sets the status code (HTTP status code) - /// - /// The status code. - HttpStatusCode StatusCode { get; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - Multimap Headers { get; } - - /// - /// Gets or sets any error text defined by the calling client. - /// - string ErrorText { get; set; } - - /// - /// Gets or sets any cookies passed along on the response. - /// - List Cookies { get; set; } - - /// - /// The raw content of this response - /// - string RawContent { get; } - } - - /// - /// API Response - /// - public class ApiResponse : IApiResponse - { - #region Properties - - /// - /// Gets or sets the status code (HTTP status code) - /// - /// The status code. - public HttpStatusCode StatusCode { get; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - public Multimap Headers { get; } - - /// - /// Gets or sets the data (parsed HTTP body) - /// - /// The data. - public T Data { get; } - - /// - /// Gets or sets any error text defined by the calling client. - /// - public string ErrorText { get; set; } - - /// - /// Gets or sets any cookies passed along on the response. - /// - public List Cookies { get; set; } - - /// - /// The content of this response - /// - public Type ResponseType - { - get { return typeof(T); } - } - - /// - /// The data type of - /// - public object Content - { - get { return Data; } - } - - /// - /// The raw content - /// - public string RawContent { get; } - - #endregion Properties - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse( - HttpStatusCode statusCode, - Multimap headers, - T data, - string rawContent - ) - { - StatusCode = statusCode; - Headers = headers; - Data = data; - RawContent = rawContent; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) - : this(statusCode, headers, data, null) { } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) - : this(statusCode, null, data, rawContent) { } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, T data) - : this(statusCode, data, null) { } - - #endregion Constructors - - #region Methods - - /// - /// Returns the deserialized response data, or throws a - /// carrying the HTTP status code, headers, and raw response body when the body is - /// missing or could not be deserialized into . - /// - /// The request path, used in the exception message. - /// The deserialized response data. - /// Thrown when the response data is null. - public T EnsureData(string path) - { - if (Data != null) - { - return Data; - } - - var reason = string.IsNullOrEmpty(ErrorText) - ? "the response body is missing or could not be deserialized" - : ErrorText; - throw new SeamException( - (int)StatusCode, - string.Format("Error calling {0} (HTTP {1}): {2}", path, (int)StatusCode, reason), - RawContent, - Headers - ); - } - - #endregion Methods - } -} diff --git a/src/Seam/Client/ClientUtils.cs b/src/Seam/Client/ClientUtils.cs deleted file mode 100644 index 7bafc8e8..00000000 --- a/src/Seam/Client/ClientUtils.cs +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Seam Connect - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; - -namespace Seam.Client -{ - /// - /// Utility functions providing some benefit to API client consumers. - /// - public static class ClientUtils - { - /// - /// Sanitize filename by removing the path - /// - /// Filename - /// Filename - public static string SanitizeFilename(string filename) - { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); - return match.Success ? match.Groups[1].Value : filename; - } - - /// - /// Convert params to key/value pairs. - /// Use collectionFormat to properly format lists and collections. - /// - /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi - /// Key name. - /// Value object. - /// A multimap of keys with 1..n associated values. - public static Multimap ParameterToMultiMap( - string collectionFormat, - string name, - object value - ) - { - var parameters = new Multimap(); - - if (value is ICollection collection && collectionFormat == "multi") - { - foreach (var item in collection) - { - parameters.Add(name, ParameterToString(item)); - } - } - else if (value is IDictionary dictionary) - { - if (collectionFormat == "deepObject") - { - foreach (DictionaryEntry entry in dictionary) - { - parameters.Add( - name + "[" + entry.Key + "]", - ParameterToString(entry.Value) - ); - } - } - else - { - foreach (DictionaryEntry entry in dictionary) - { - parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); - } - } - } - else - { - parameters.Add(name, ParameterToString(value)); - } - - return parameters; - } - - /// - /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. - /// If parameter is a list, join the list with ",". - /// Otherwise just return the string. - /// - /// The parameter (header, path, query, form). - /// An optional configuration instance, providing formatting options used in processing. - /// Formatted string. - public static string ParameterToString( - object obj, - IReadableSeamRequestConfiguration configuration = null - ) - { - if (obj is DateTime dateTime) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return dateTime.ToString( - (configuration ?? GlobalSeamRequestConfiguration.Instance).DateTimeFormat - ); - if (obj is DateTimeOffset dateTimeOffset) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return dateTimeOffset.ToString( - (configuration ?? GlobalSeamRequestConfiguration.Instance).DateTimeFormat - ); - if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is ICollection collection) - { - List entries = new List(); - foreach (var entry in collection) - entries.Add(ParameterToString(entry, configuration)); - return string.Join(",", entries); - } - if (obj is Enum && HasEnumMemberAttrValue(obj)) - return GetEnumMemberAttrValue(obj); - - return Convert.ToString(obj, CultureInfo.InvariantCulture); - } - - /// - /// Serializes the given object when not null. Otherwise return null. - /// - /// The object to serialize. - /// Serialized string. - public static string Serialize(object obj) - { - return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; - } - - /// - /// Encode string in base64 format. - /// - /// string to be encoded. - /// Encoded string. - public static string Base64Encode(string text) - { - return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); - } - - /// - /// Convert stream to byte array - /// - /// Input stream to be converted - /// Byte array - public static byte[] ReadAsBytes(Stream inputStream) - { - using (var ms = new MemoryStream()) - { - inputStream.CopyTo(ms); - return ms.ToArray(); - } - } - - /// - /// Select the Content-Type header's value from the given content-type array: - /// if JSON type exists in the given array, use it; - /// otherwise use the first one defined in 'consumes' - /// - /// The Content-Type array to select from. - /// The Content-Type header to use. - public static string SelectHeaderContentType(string[] contentTypes) - { - if (contentTypes.Length == 0) - return null; - - foreach (var contentType in contentTypes) - { - if (IsJsonMime(contentType)) - return contentType; - } - - return contentTypes[0]; // use the first content type specified in 'consumes' - } - - /// - /// Select the Accept header's value from the given accepts array: - /// if JSON exists in the given array, use it; - /// otherwise use all of them (joining into a string) - /// - /// The accepts array to select from. - /// The Accept header to use. - public static string SelectHeaderAccept(string[] accepts) - { - if (accepts.Length == 0) - return null; - - if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) - return "application/json"; - - return string.Join(",", accepts); - } - - /// - /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. - /// - public static readonly Regex JsonRegex = new Regex( - "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$" - ); - - /// - /// Check if the given MIME is a JSON MIME. - /// JSON MIME examples: - /// application/json - /// application/json; charset=UTF8 - /// APPLICATION/JSON - /// application/vnd.company+json - /// - /// MIME - /// Returns True if MIME type is json. - public static bool IsJsonMime(string mime) - { - if (string.IsNullOrWhiteSpace(mime)) - return false; - - return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); - } - - /// - /// Is the Enum decorated with EnumMember Attribute - /// - /// - /// true if found - private static bool HasEnumMemberAttrValue(object enumVal) - { - if (enumVal == null) - throw new ArgumentNullException(nameof(enumVal)); - var enumType = enumVal.GetType(); - var memInfo = enumType.GetMember( - enumVal.ToString() ?? throw new InvalidOperationException() - ); - var attr = memInfo - .FirstOrDefault() - ?.GetCustomAttributes(false) - .OfType() - .FirstOrDefault(); - if (attr != null) - return true; - return false; - } - - /// - /// Get the EnumMember value - /// - /// - /// EnumMember value as string otherwise null - private static string GetEnumMemberAttrValue(object enumVal) - { - if (enumVal == null) - throw new ArgumentNullException(nameof(enumVal)); - var enumType = enumVal.GetType(); - var memInfo = enumType.GetMember( - enumVal.ToString() ?? throw new InvalidOperationException() - ); - var attr = memInfo - .FirstOrDefault() - ?.GetCustomAttributes(false) - .OfType() - .FirstOrDefault(); - if (attr != null) - { - return attr.Value; - } - return null; - } - } -} diff --git a/src/Seam/Client/ExceptionFactory.cs b/src/Seam/Client/ExceptionFactory.cs deleted file mode 100644 index 1f4f217e..00000000 --- a/src/Seam/Client/ExceptionFactory.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Seam.Client -{ - /// - /// A delegate to ExceptionFactory method - /// - /// Method name - /// Response - /// Exceptions - public delegate Exception ExceptionFactory(string methodName, IApiResponse response); -} diff --git a/src/Seam/Client/GlobalSeamRequestConfiguration.cs b/src/Seam/Client/GlobalSeamRequestConfiguration.cs deleted file mode 100644 index 6172fb93..00000000 --- a/src/Seam/Client/GlobalSeamRequestConfiguration.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Collections.Generic; -using Seam.Client; - -namespace Seam.Client -{ - /// - /// provides a compile-time extension point for globally configuring - /// API Clients. - /// - /// - /// A customized implementation via partial class may reside in another file and may - /// be excluded from automatic generation via a .openapi-generator-ignore file. - /// - public partial class GlobalSeamRequestConfiguration : SeamRequestConfiguration - { - #region Private Members - - private static readonly object GlobalConfigSync = new { }; - private static IReadableSeamRequestConfiguration _globalConfiguration; - - #endregion Private Members - - #region Constructors - - /// - private GlobalSeamRequestConfiguration() { } - - /// - public GlobalSeamRequestConfiguration( - IDictionary defaultHeader, - // IDictionary apiKey, - // IDictionary apiKeyPrefix, - string basePath = "https://connect.getseam.com" - ) - : base(defaultHeader, basePath) { } - - static GlobalSeamRequestConfiguration() - { - Instance = new GlobalSeamRequestConfiguration(); - } - - #endregion Constructors - - /// - /// Gets or sets the default Configuration. - /// - /// Configuration. - public static IReadableSeamRequestConfiguration Instance - { - get { return _globalConfiguration; } - set - { - lock (GlobalConfigSync) - { - _globalConfiguration = value; - } - } - } - } -} diff --git a/src/Seam/Client/HttpMethod.cs b/src/Seam/Client/HttpMethod.cs deleted file mode 100644 index ebc75166..00000000 --- a/src/Seam/Client/HttpMethod.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Seam.Client -{ - /// - /// Http methods supported by swagger - /// - public enum HttpMethod - { - /// HTTP GET request. - Get, - - /// HTTP POST request. - Post, - - /// HTTP PUT request. - Put, - - /// HTTP DELETE request. - Delete, - - /// HTTP HEAD request. - Head, - - /// HTTP OPTIONS request. - Options, - - /// HTTP PATCH request. - Patch, - } -} diff --git a/src/Seam/Client/IAsynchronousSeam.cs b/src/Seam/Client/IAsynchronousSeam.cs deleted file mode 100644 index 7d50a15c..00000000 --- a/src/Seam/Client/IAsynchronousSeam.cs +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Seam Connect - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Threading.Tasks; - -namespace Seam.Client -{ - /// - /// Contract for Asynchronous RESTful API interactions. - /// - /// This interface allows consumers to provide a custom API accessor client. - /// - public interface IAsynchronousSeam - { - /// - /// Executes a non-blocking call to some using the GET http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> GetAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ); - - /// - /// Executes a non-blocking call to some using the POST http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PostAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ); - - /// - /// Executes a non-blocking call to some using the PUT http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PutAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ); - - /// - /// Executes a non-blocking call to some using the DELETE http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> DeleteAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ); - - /// - /// Executes a non-blocking call to some using the HEAD http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> HeadAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ); - - /// - /// Executes a non-blocking call to some using the OPTIONS http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> OptionsAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ); - - /// - /// Executes a non-blocking call to some using the PATCH http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PatchAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ); - } -} diff --git a/src/Seam/Client/IReadableSeamRequestConfiguration.cs b/src/Seam/Client/IReadableSeamRequestConfiguration.cs deleted file mode 100644 index 951ca935..00000000 --- a/src/Seam/Client/IReadableSeamRequestConfiguration.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Security; -using System.Security.Cryptography.X509Certificates; - -namespace Seam.Client -{ - /// - /// Represents a readable-only configuration contract. - /// - public interface IReadableSeamRequestConfiguration - { - /// - /// Gets the base path. - /// - /// Base path. - string BasePath { get; } - - /// - /// Gets the date time format. - /// - /// Date time format. - string DateTimeFormat { get; } - - /// - /// Gets the default headers. - /// - /// Default headers. - IDictionary DefaultHeaders { get; } - - /// - /// Gets the temp folder path. - /// - /// Temp folder path. - string TempFolderPath { get; } - - /// - /// Gets the HTTP connection timeout (in milliseconds) - /// - /// HTTP connection timeout. - int Timeout { get; } - - /// - /// Gets the proxy. - /// - /// Proxy. - WebProxy Proxy { get; } - - /// - /// Gets the user agent. - /// - /// User agent. - string UserAgent { get; } - - /// - /// Gets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - X509CertificateCollection ClientCertificates { get; } - - /// - /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and - /// overriding certificate errors in the scope of a request. - /// - RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } - } -} diff --git a/src/Seam/Client/ISynchronousSeam.cs b/src/Seam/Client/ISynchronousSeam.cs deleted file mode 100644 index 726bc2b0..00000000 --- a/src/Seam/Client/ISynchronousSeam.cs +++ /dev/null @@ -1,103 +0,0 @@ -namespace Seam.Client -{ - public interface ISynchronousSeam - { - /// - /// Executes a blocking call to some using the GET http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Get( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ); - - /// - /// Executes a blocking call to some using the POST http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Post( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ); - - /// - /// Executes a blocking call to some using the PUT http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Put( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ); - - /// - /// Executes a blocking call to some using the DELETE http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Delete( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ); - - /// - /// Executes a blocking call to some using the HEAD http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Head( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ); - - /// - /// Executes a blocking call to some using the OPTIONS http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Options( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ); - - /// - /// Executes a blocking call to some using the PATCH http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Patch( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ); - } -} diff --git a/src/Seam/Client/Multimap.cs b/src/Seam/Client/Multimap.cs deleted file mode 100644 index 0774a400..00000000 --- a/src/Seam/Client/Multimap.cs +++ /dev/null @@ -1,286 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Seam.Client -{ - /// - /// A dictionary in which one key has many associated values. - /// - /// The type of the key - /// The type of the value associated with the key. - public class Multimap : IDictionary> - { - #region Private Fields - - private readonly Dictionary> _dictionary; - - #endregion Private Fields - - #region Constructors - - /// - /// Empty Constructor. - /// - public Multimap() - { - _dictionary = new Dictionary>(); - } - - /// - /// Constructor with comparer. - /// - /// - public Multimap(IEqualityComparer comparer) - { - _dictionary = new Dictionary>(comparer); - } - - #endregion Constructors - - #region Enumerators - - /// - /// To get the enumerator. - /// - /// Enumerator - public IEnumerator>> GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - - /// - /// To get the enumerator. - /// - /// Enumerator - IEnumerator IEnumerable.GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - - #endregion Enumerators - - #region Public Members - /// - /// Add values to Multimap - /// - /// Key value pair - public void Add(KeyValuePair> item) - { - if (!TryAdd(item.Key, item.Value)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - - /// - /// Add Multimap to Multimap - /// - /// Multimap - public void Add(Multimap multimap) - { - foreach (var item in multimap) - { - if (!TryAdd(item.Key, item.Value)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - } - - /// - /// Clear Multimap - /// - public void Clear() - { - _dictionary.Clear(); - } - - /// - /// Determines whether Multimap contains the specified item. - /// - /// Key value pair - /// Method needs to be implemented - /// true if the Multimap contains the item; otherwise, false. - public bool Contains(KeyValuePair> item) - { - throw new NotImplementedException(); - } - - /// - /// Copy items of the Multimap to an array, - /// starting at a particular array index. - /// - /// The array that is the destination of the items copied - /// from Multimap. The array must have zero-based indexing. - /// The zero-based index in array at which copying begins. - /// Method needs to be implemented - public void CopyTo(KeyValuePair>[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - /// - /// Removes the specified item from the Multimap. - /// - /// Key value pair - /// true if the item is successfully removed; otherwise, false. - /// Method needs to be implemented - public bool Remove(KeyValuePair> item) - { - throw new NotImplementedException(); - } - - /// - /// Gets the number of items contained in the Multimap. - /// - public int Count => _dictionary.Count; - - /// - /// Gets a value indicating whether the Multimap is read-only. - /// - public bool IsReadOnly => false; - - /// - /// Adds an item with the provided key and value to the Multimap. - /// - /// The object to use as the key of the item to add. - /// The object to use as the value of the item to add. - /// Thrown when couldn't add the value to Multimap. - public void Add(TKey key, IList value) - { - if (value != null && value.Count > 0) - { - if (_dictionary.TryGetValue(key, out var list)) - { - foreach (var k in value) - list.Add(k); - } - else - { - list = new List(value); - if (!TryAdd(key, list)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - } - } - - /// - /// Determines whether the Multimap contains an item with the specified key. - /// - /// The key to locate in the Multimap. - /// true if the Multimap contains an item with - /// the key; otherwise, false. - public bool ContainsKey(TKey key) - { - return _dictionary.ContainsKey(key); - } - - /// - /// Removes item with the specified key from the Multimap. - /// - /// The key to locate in the Multimap. - /// true if the item is successfully removed; otherwise, false. - public bool Remove(TKey key) - { - return TryRemove(key, out var _); - } - - /// - /// Gets the value associated with the specified key. - /// - /// The key whose value to get. - /// When this method returns, the value associated with the specified key, if the - /// key is found; otherwise, the default value for the type of the value parameter. - /// This parameter is passed uninitialized. - /// true if the object that implements Multimap contains - /// an item with the specified key; otherwise, false. - public bool TryGetValue(TKey key, out IList value) - { - return _dictionary.TryGetValue(key, out value); - } - - /// - /// Gets or sets the item with the specified key. - /// - /// The key of the item to get or set. - /// The value of the specified key. - public IList this[TKey key] - { - get => _dictionary[key]; - set => _dictionary[key] = value; - } - - /// - /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. - /// - public ICollection Keys => _dictionary.Keys; - - /// - /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. - /// - public ICollection> Values => _dictionary.Values; - - /// - /// Copy the items of the Multimap to an System.Array, - /// starting at a particular System.Array index. - /// - /// The one-dimensional System.Array that is the destination of the items copied - /// from Multimap. The System.Array must have zero-based indexing. - /// The zero-based index in array at which copying begins. - public void CopyTo(Array array, int index) - { - ((ICollection)_dictionary).CopyTo(array, index); - } - - /// - /// Adds an item with the provided key and value to the Multimap. - /// - /// The object to use as the key of the item to add. - /// The object to use as the value of the item to add. - /// Thrown when couldn't add value to Multimap. - public void Add(TKey key, TValue value) - { - if (value != null) - { - if (_dictionary.TryGetValue(key, out var list)) - { - list.Add(value); - } - else - { - list = new List { value }; - if (!TryAdd(key, list)) - throw new InvalidOperationException("Could not add value to Multimap."); - } - } - } - - #endregion Public Members - - #region Private Members - - /** - * Helper method to encapsulate generator differences between dictionary types. - */ - private bool TryRemove(TKey key, out IList value) - { - _dictionary.TryGetValue(key, out value); - return _dictionary.Remove(key); - } - - /** - * Helper method to encapsulate generator differences between dictionary types. - */ - private bool TryAdd(TKey key, IList value) - { - try - { - _dictionary.Add(key, value); - } - catch (ArgumentException) - { - return false; - } - - return true; - } - #endregion Private Members - } -} diff --git a/src/Seam/Client/RequestOptions.cs b/src/Seam/Client/RequestOptions.cs deleted file mode 100644 index 744b7984..00000000 --- a/src/Seam/Client/RequestOptions.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; - -namespace Seam.Client -{ - /// - /// A container for generalized request inputs. This type allows consumers to extend the request functionality - /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). - /// - public class RequestOptions - { - /// - /// Parameters to be bound to path parts of the Request's URL - /// - public Dictionary PathParameters { get; set; } - - /// - /// Query parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap QueryParameters { get; set; } - - /// - /// Header parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap HeaderParameters { get; set; } - - /// - /// Form parameters to be sent along with the request. - /// - public Dictionary FormParameters { get; set; } - - /// - /// File parameters to be sent along with the request. - /// - public Multimap FileParameters { get; set; } - - /// - /// Cookies to be sent along with the request. - /// - public List Cookies { get; set; } - - /// - /// Operation associated with the request path. - /// - public string Operation { get; set; } - - /// - /// Index associated with the operation. - /// - public int OperationIndex { get; set; } - - /// - /// Any data associated with a request body. - /// - public Object Data { get; set; } - - /// - /// Constructs a new instance of - /// - public RequestOptions() - { - PathParameters = new Dictionary(); - QueryParameters = new Multimap(); - HeaderParameters = new Multimap(); - FormParameters = new Dictionary(); - FileParameters = new Multimap(); - Cookies = new List(); - } - } -} diff --git a/src/Seam/Client/RetryConfiguration.cs b/src/Seam/Client/RetryConfiguration.cs deleted file mode 100644 index 7fe646cf..00000000 --- a/src/Seam/Client/RetryConfiguration.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Polly; -using RestSharp; - -namespace Seam.Client -{ - /// - /// Configuration class to set the polly retry policies to be applied to the requests. - /// - public static class RetryConfiguration - { - /// - /// Retry policy - /// - public static Policy RetryPolicy { get; set; } - - /// - /// Async retry policy - /// - public static AsyncPolicy AsyncRetryPolicy { get; set; } - } -} diff --git a/src/Seam/Client/Seam.cs b/src/Seam/Client/Seam.cs deleted file mode 100644 index cbd30058..00000000 --- a/src/Seam/Client/Seam.cs +++ /dev/null @@ -1,1146 +0,0 @@ -/* - * Seam Connect - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; -using System.Web; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Serialization; -using Polly; -using RestSharp; -using RestSharp.Serializers; -using Seam.Model; -using RestSharpMethod = RestSharp.Method; - -namespace Seam.Client -{ - /// - /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. - /// - internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer - { - private readonly IReadableSeamRequestConfiguration _configuration; - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy { OverrideSpecifiedNames = false }, - }, - }; - - public CustomJsonCodec(IReadableSeamRequestConfiguration configuration) - { - _configuration = configuration; - } - - public CustomJsonCodec( - JsonSerializerSettings serializerSettings, - IReadableSeamRequestConfiguration configuration - ) - { - _serializerSettings = serializerSettings; - _configuration = configuration; - } - - /// - /// Serialize the object into a JSON string. - /// - /// Object to be serialized. - /// A JSON string. - public string Serialize(object obj) - { - return JsonConvert.SerializeObject(obj, _serializerSettings); - } - - public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); - - public T Deserialize(RestResponse response) - { - var result = (T)Deserialize(response, typeof(T)); - return result; - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// The HTTP response. - /// Object type. - /// Object representation of the JSON string. - internal object Deserialize(RestResponse response, Type type) - { - if (type == typeof(byte[])) // return byte array - { - return response.RawBytes; - } - - // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) - if (type == typeof(Stream)) - { - var bytes = response.RawBytes; - if (response.Headers != null) - { - var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() - : _configuration.TempFolderPath; - var regex = new Regex( - @"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$" - ); - foreach (var header in response.Headers) - { - var match = regex.Match(header.ToString()); - if (match.Success) - { - string fileName = - filePath - + ClientUtils.SanitizeFilename( - match.Groups[1].Value.Replace("\"", "").Replace("'", "") - ); - File.WriteAllBytes(fileName, bytes); - return new FileStream(fileName, FileMode.Open); - } - } - } - var stream = new MemoryStream(bytes); - return stream; - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse( - response.Content, - null, - System.Globalization.DateTimeStyles.RoundtripKind - ); - } - - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return Convert.ChangeType(response.Content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); - } - catch (Exception e) - { - throw new SeamException(500, e.Message, response.Content); - } - } - - public ISerializer Serializer => this; - public IDeserializer Deserializer => this; - - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; - - public SupportsContentType SupportsContentType => - contentType => - contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) - || contentType.Value.EndsWith( - "javascript", - StringComparison.InvariantCultureIgnoreCase - ); - - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; - - public DataFormat DataFormat => DataFormat.Json; - } - - public partial interface ISeamClient : ISynchronousSeam, IAsynchronousSeam, IDisposable { } - - /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), - /// encapsulating general REST accessor use cases. - /// - public partial class SeamClient : ISeamClient - { - private readonly string _baseUrl; - private readonly string _apiToken; - private readonly int? _timeout; - - /// - /// Specifies the settings on a object. - /// These settings can be adjusted to accommodate custom serialization rules. - /// - public JsonSerializerSettings SerializerSettings { get; set; } = - new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy { OverrideSpecifiedNames = false }, - }, - }; - - /// - /// Allows for extending request processing for generated code. - /// - /// The RestSharp request object - partial void InterceptRequest(RestRequest request); - - /// - /// Allows for extending response processing for generated code. - /// - /// The RestSharp request object - /// The RestSharp response object - partial void InterceptResponse(RestRequest request, RestResponse response); - - /// - /// Initializes a new instance of the - /// - /// The target service's API Token. - /// The request timeout in milliseconds. Defaults to - /// . - /// - public SeamClient(string apiToken, int? timeout = null) - : this(GlobalSeamRequestConfiguration.Instance.BasePath, apiToken, timeout) { } - - /// - /// Initializes a new instance of the - /// - /// The target service's base path in URL format. - /// The target service's API Token. - /// The request timeout in milliseconds. Defaults to - /// . - /// - public SeamClient(string basePath, string apiToken, int? timeout = null) - { - if (string.IsNullOrEmpty(basePath)) - throw new ArgumentException("basePath cannot be empty"); - - if (string.IsNullOrEmpty(apiToken)) - throw new ArgumentException("apiToken cannot be empty"); - - _baseUrl = basePath; - _apiToken = apiToken; - _timeout = timeout; - } - - /// - /// Constructs the RestSharp version of an http method - /// - /// Swagger Client Custom HttpMethod - /// RestSharp's HttpMethod instance. - /// - private RestSharpMethod Method(HttpMethod method) - { - RestSharpMethod other; - switch (method) - { - case HttpMethod.Get: - other = RestSharpMethod.Get; - break; - case HttpMethod.Post: - other = RestSharpMethod.Post; - break; - case HttpMethod.Put: - other = RestSharpMethod.Put; - break; - case HttpMethod.Delete: - other = RestSharpMethod.Delete; - break; - case HttpMethod.Head: - other = RestSharpMethod.Head; - break; - case HttpMethod.Options: - other = RestSharpMethod.Options; - break; - case HttpMethod.Patch: - other = RestSharpMethod.Patch; - break; - default: - throw new ArgumentOutOfRangeException("method", method, null); - } - - return other; - } - - /// - /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. - /// - /// The http verb. - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// [private] A new RestRequest instance. - /// - private RestRequest NewRequest( - HttpMethod method, - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - string apiToken = null - ) - { - if (path == null) - throw new ArgumentNullException("path"); - if (options == null) - throw new ArgumentNullException("options"); - if (configuration == null) - throw new ArgumentNullException("configuration"); - - apiToken ??= _apiToken; - - RestRequest request = new RestRequest(path, Method(method)); - - if (options.PathParameters != null) - { - foreach (var pathParam in options.PathParameters) - { - request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); - } - } - - if (options.QueryParameters != null) - { - foreach (var queryParam in options.QueryParameters) - { - foreach (var value in queryParam.Value) - { - request.AddQueryParameter(queryParam.Key, value); - } - } - } - - if (configuration.DefaultHeaders != null) - { - foreach (var headerParam in configuration.DefaultHeaders) - { - request.AddHeader(headerParam.Key, headerParam.Value); - } - } - - if (apiToken != null) - { - request.AddHeader("Authorization", "Bearer " + apiToken); - } - - if (options.HeaderParameters != null) - { - foreach (var headerParam in options.HeaderParameters) - { - foreach (var value in headerParam.Value) - { - request.AddHeader(headerParam.Key, value); - } - } - } - - if (options.FormParameters != null) - { - foreach (var formParam in options.FormParameters) - { - request.AddParameter(formParam.Key, formParam.Value); - } - } - - if (options.Data != null) - { - if (CarriesDataInQuery(method)) - { - // Uri normalizes a percent-encoded unreserved character back to its literal - // form, so `~` reaches the wire as `~` rather than as `%7E`. Both decode to - // the same param. - var query = StrictUrlSearchParamsSerializer.Serialize( - ToSearchParams(options.Data) - ); - - if (query.Length > 0) - { - request.Resource = $"{path}?{query}"; - } - } - else if (options.Data is Stream stream) - { - var contentType = "application/octet-stream"; - if (options.HeaderParameters != null) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - contentType = contentTypes[0]; - } - - var bytes = ClientUtils.ReadAsBytes(stream); - request.AddParameter(contentType, bytes, ParameterType.RequestBody); - } - else - { - if (options.HeaderParameters != null) - { - IList contentTypes = null; - - if (options.HeaderParameters.ContainsKey("Content-Type")) - { - contentTypes = options.HeaderParameters["Content-Type"]; - } - - if ( - contentTypes == null - || contentTypes.Any(header => header.Contains("application/json")) - ) - { - request.RequestFormat = DataFormat.Json; - } - else - { - // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. - } - } - else - { - // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. - request.RequestFormat = DataFormat.Json; - } - - request.AddJsonBody(options.Data); - } - } - - if (options.FileParameters != null) - { - foreach (var fileParam in options.FileParameters) - { - foreach (var file in fileParam.Value) - { - var bytes = ClientUtils.ReadAsBytes(file); - var fileStream = file as FileStream; - if (fileStream != null) - request.AddFile( - fileParam.Key, - bytes, - System.IO.Path.GetFileName(fileStream.Name) - ); - else - request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); - } - } - } - - return request; - } - - /// - /// Whether the request data travels as URL search params rather than as a body. - /// - private static bool CarriesDataInQuery(HttpMethod method) - { - return method == HttpMethod.Get || method == HttpMethod.Delete; - } - - /// - /// Converts request data to search params through its JSON contract, so a parameter - /// carries the same name and the same value whether it travels in the query or the body. - /// - private IDictionary ToSearchParams(object data) - { - var token = JToken.FromObject(data, JsonSerializer.CreateDefault(SerializerSettings)); - - if (!(ToSearchParamValue(token) is IDictionary parameters)) - { - throw new ArgumentException( - $"Request data must serialize to an object, got {token.Type}", - nameof(data) - ); - } - - return parameters; - } - - /// - /// An unset parameter is absent from the JSON contract, so a null can only be the - /// sentinel and is restored as one. - /// - private static object ToSearchParamValue(JToken token) - { - switch (token.Type) - { - case JTokenType.Object: - var parameters = new Dictionary(); - foreach (var property in ((JObject)token).Properties()) - { - parameters[property.Name] = ToSearchParamValue(property.Value); - } - return parameters; - case JTokenType.Array: - return ((JArray)token).Select(ToSearchParamValue).ToList(); - case JTokenType.Null: - case JTokenType.Undefined: - return Null.Value; - default: - return ((JValue)token).Value; - } - } - - private ApiResponse ToApiResponse(RestResponse response) - { - T result = response.Data; - string rawContent = response.Content; - - var transformed = new ApiResponse( - response.StatusCode, - new Multimap(), - result, - rawContent - ) - { - ErrorText = response.ErrorMessage, - Cookies = new List(), - }; - - if (response.Headers != null) - { - foreach (var responseHeader in response.Headers) - { - transformed.Headers.Add( - responseHeader.Name, - ClientUtils.ParameterToString(responseHeader.Value) - ); - } - } - - if (response.ContentHeaders != null) - { - foreach (var responseHeader in response.ContentHeaders) - { - transformed.Headers.Add( - responseHeader.Name, - ClientUtils.ParameterToString(responseHeader.Value) - ); - } - } - - if (response.Cookies != null) - { - foreach (var responseCookies in response.Cookies.Cast()) - { - transformed.Cookies.Add( - new Cookie( - responseCookies.Name, - responseCookies.Value, - responseCookies.Path, - responseCookies.Domain - ) - ); - } - } - - return transformed; - } - - private ApiResponse Exec( - RestRequest request, - RequestOptions options, - IReadableSeamRequestConfiguration configuration - ) - { - var baseUrl = _baseUrl; - - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - - var timeout = _timeout ?? configuration.Timeout; - - var clientOptions = new RestClientOptions(baseUrl) - { - ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, - Timeout = timeout > 0 ? TimeSpan.FromMilliseconds(timeout) : (TimeSpan?)null, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - // UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = - configuration.RemoteCertificateValidationCallback, - ThrowOnAnyError = false, - }; - - using ( - RestClient client = new RestClient( - clientOptions, - configureSerialization: serializerConfig => - serializerConfig.UseSerializer( - () => new CustomJsonCodec(SerializerSettings, configuration) - ) - ) - ) - { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = - (policyResult.Outcome == OutcomeType.Successful) - ? client.Deserialize(policyResult.Result) - : new RestResponse(request) - { - ErrorException = policyResult.FinalException, - }; - } - else - { - response = client.Execute(request); - } - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(AbstractModelSchema).IsAssignableFrom(typeof(T))) - { - try - { - response.Data = (T) - typeof(T) - .GetMethod("FromJson") - .Invoke(null, new object[] { response.Content }); - } - catch (Exception ex) - { - throw ex.InnerException != null ? ex.InnerException : ex; - } - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - else if (typeof(T).Name == "String") // for string response - { - response.Data = (T)(object)response.Content; - } - - InterceptResponse(request, response); - - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) - result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) - { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version, - }; - - result.Cookies.Add(cookie); - } - } - - var exceptionFactory = SeamRequestConfiguration.DefaultExceptionFactory; - if (exceptionFactory != null) - { - var exception = exceptionFactory(request.Resource, result); - if (exception != null) - { - throw exception; - } - } - - return result; - } - } - - private async Task> ExecAsync( - RestRequest request, - RequestOptions options, - IReadableSeamRequestConfiguration configuration, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ) - { - var baseUrl = _baseUrl; - - var timeout = _timeout ?? configuration.Timeout; - - var clientOptions = new RestClientOptions(baseUrl) - { - ClientCertificates = configuration.ClientCertificates, - Timeout = timeout > 0 ? TimeSpan.FromMilliseconds(timeout) : (TimeSpan?)null, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - ThrowOnAnyError = false, - }; - - using ( - RestClient client = new RestClient( - clientOptions, - configureSerialization: serializerConfig => - serializerConfig.UseSerializer( - () => new CustomJsonCodec(SerializerSettings, configuration) - ) - ) - ) - { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) - { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy - .ExecuteAndCaptureAsync( - (ct) => client.ExecuteAsync(request, ct), - cancellationToken - ) - .ConfigureAwait(false); - response = - (policyResult.Outcome == OutcomeType.Successful) - ? client.Deserialize(policyResult.Result) - : new RestResponse(request) - { - ErrorException = policyResult.FinalException, - }; - } - else - { - response = await client - .ExecuteAsync(request, cancellationToken) - .ConfigureAwait(false); - } - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(AbstractModelSchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) - typeof(T) - .GetMethod("FromJson") - .Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - - InterceptResponse(request, response); - - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) - result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) - { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version, - }; - - result.Cookies.Add(cookie); - } - } - - var exceptionFactory = SeamRequestConfiguration.DefaultExceptionFactory; - if (exceptionFactory != null) - { - var exception = exceptionFactory(request.Resource, result); - if (exception != null) - { - throw exception; - } - } - - return result; - } - } - - #region IAsynchronousClient - /// - /// Make a HTTP GET request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> GetAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return ExecAsync( - NewRequest(HttpMethod.Get, path, options, config), - options, - config, - cancellationToken - ); - } - - /// - /// Make a HTTP POST request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PostAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return ExecAsync( - NewRequest(HttpMethod.Post, path, options, config), - options, - config, - cancellationToken - ); - } - - /// - /// Make a HTTP PUT request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PutAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return ExecAsync( - NewRequest(HttpMethod.Put, path, options, config), - options, - config, - cancellationToken - ); - } - - /// - /// Make a HTTP DELETE request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> DeleteAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return ExecAsync( - NewRequest(HttpMethod.Delete, path, options, config), - options, - config, - cancellationToken - ); - } - - /// - /// Make a HTTP HEAD request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> HeadAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return ExecAsync( - NewRequest(HttpMethod.Head, path, options, config), - options, - config, - cancellationToken - ); - } - - /// - /// Make a HTTP OPTION request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> OptionsAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return ExecAsync( - NewRequest(HttpMethod.Options, path, options, config), - options, - config, - cancellationToken - ); - } - - /// - /// Make a HTTP PATCH request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PatchAsync( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null, - System.Threading.CancellationToken cancellationToken = - default(System.Threading.CancellationToken) - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return ExecAsync( - NewRequest(HttpMethod.Patch, path, options, config), - options, - config, - cancellationToken - ); - } - #endregion IAsynchronousClient - - #region ISynchronousClient - /// - /// Make a HTTP GET request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Get( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); - } - - /// - /// Make a HTTP POST request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Post( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); - } - - /// - /// Make a HTTP PUT request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Put( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); - } - - /// - /// Make a HTTP DELETE request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Delete( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); - } - - /// - /// Make a HTTP HEAD request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Head( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); - } - - /// - /// Make a HTTP OPTION request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Options( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); - } - - /// - /// Make a HTTP PATCH request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalSeamConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Patch( - string path, - RequestOptions options, - IReadableSeamRequestConfiguration configuration = null - ) - { - var config = configuration ?? GlobalSeamRequestConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); - } - - #endregion ISynchronousClient - public void Dispose() { } - } - - [Obsolete("Please use Seam.Client.SeamClient instead")] - public class Seam : SeamClient - { - public Seam(string apiToken, int? timeout = null) - : base(apiToken, timeout) { } - - public Seam(string basePath, string apiToken, int? timeout = null) - : base(basePath, apiToken, timeout) { } - } -} diff --git a/src/Seam/Client/SeamException.cs b/src/Seam/Client/SeamException.cs deleted file mode 100644 index dadf842d..00000000 --- a/src/Seam/Client/SeamException.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; - -namespace Seam.Client -{ - /// - /// API Exception - /// - public class SeamException : Exception - { - /// - /// Gets or sets the error code (HTTP status code) - /// - /// The error code (HTTP status code). - public int ErrorCode { get; set; } - - /// - /// Gets or sets the error content (body json object) - /// - /// The error content (Http response body). - public object ErrorContent { get; private set; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - public Multimap Headers { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public SeamException() { } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - public SeamException(int errorCode, string message) - : base(message) - { - this.ErrorCode = errorCode; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - /// Error content. - /// HTTP Headers. - public SeamException( - int errorCode, - string message, - object errorContent = null, - Multimap headers = null - ) - : base(message) - { - this.ErrorCode = errorCode; - this.ErrorContent = errorContent; - this.Headers = headers; - } - } -} diff --git a/src/Seam/Client/SeamRequestConfiguration.cs b/src/Seam/Client/SeamRequestConfiguration.cs deleted file mode 100644 index 7c972b75..00000000 --- a/src/Seam/Client/SeamRequestConfiguration.cs +++ /dev/null @@ -1,668 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Security; -using System.Reflection; -using System.Security.Cryptography.X509Certificates; -using System.Text; - -namespace Seam.Client -{ - /// - /// Represents a set of configuration settings - /// - public class SeamRequestConfiguration : IReadableSeamRequestConfiguration - { - #region Constants - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "1.0.0"; - - /// - /// Default HTTP timeout (milliseconds) applied to every request. - /// - /// Default HTTP timeout (milliseconds). - public const int DefaultTimeout = 30000; - - /// - /// Identifier for ISO 8601 DateTime Format - /// - /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. - // ReSharper disable once InconsistentNaming - public const string ISO8601_DATETIME_FORMAT = "o"; - - #endregion Constants - - #region Static Members - - /// - /// Default creation of exceptions for a given method name and response object - /// - public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => - { - var status = (int)response.StatusCode; - if (status >= 400) - { - return new SeamException( - status, - string.Format("Error calling {0}: {1}", methodName, response.RawContent), - response.RawContent, - response.Headers - ); - } - if (status == 0) - { - return new SeamException( - status, - string.Format("Error calling {0}: {1}", methodName, response.ErrorText), - response.ErrorText - ); - } - return null; - }; - - #endregion Static Members - - #region Private Members - - /// - /// Defines the base path of the target API server. - /// Example: http://localhost:3000/v1/ - /// - private string _basePath; - - private bool _useDefaultCredentials = false; - - /// - /// Gets or sets the API key based on the authentication name. - /// This is the key and value comprising the "secret" for accessing an API. - /// - /// The API key. - private IDictionary _apiKey; - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - private IDictionary _apiKeyPrefix; - - private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - private string _tempFolderPath = Path.GetTempPath(); - - /// - /// Gets or sets the servers defined in the OpenAPI spec. - /// - /// The servers - private IList> _servers; - - /// - /// Gets or sets the operation servers defined in the OpenAPI spec. - /// - /// The operation servers - private IReadOnlyDictionary< - string, - List> - > _operationServers; - - #endregion Private Members - - #region Constructors - - /// - /// Initializes a new instance of the class - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage( - "ReSharper", - "VirtualMemberCallInConstructor" - )] - public SeamRequestConfiguration() - { - Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); - BasePath = "https://connect.getseam.com"; - DefaultHeaders = new ConcurrentDictionary(); - ApiKey = new ConcurrentDictionary(); - ApiKeyPrefix = new ConcurrentDictionary(); - Servers = new List>() - { - { - new Dictionary - { - { "url", "https://connect.getseam.com" }, - { "description", "No description provided" }, - } - }, - }; - OperationServers = new Dictionary>>() - { }; - - // Setting Timeout has side effects (forces ApiClient creation). - Timeout = DefaultTimeout; - } - - /// - /// Initializes a new instance of the class - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage( - "ReSharper", - "VirtualMemberCallInConstructor" - )] - public SeamRequestConfiguration( - IDictionary defaultHeaders, - // IDictionary apiKey, - // IDictionary apiKeyPrefix, - string basePath = "https://connect.getseam.com" - ) - : this() - { - if (string.IsNullOrWhiteSpace(basePath)) - throw new ArgumentException("The provided basePath is invalid.", "basePath"); - if (defaultHeaders == null) - throw new ArgumentNullException("defaultHeaders"); - // if (apiKey == null) - // throw new ArgumentNullException("apiKey"); - // if (apiKeyPrefix == null) - // throw new ArgumentNullException("apiKeyPrefix"); - - BasePath = basePath; - - foreach (var keyValuePair in defaultHeaders) - { - DefaultHeaders.Add(keyValuePair); - } - - // foreach (var keyValuePair in apiKey) - // { - // ApiKey.Add(keyValuePair); - // } - - // foreach (var keyValuePair in apiKeyPrefix) - // { - // ApiKeyPrefix.Add(keyValuePair); - // } - } - - #endregion Constructors - - #region Properties - - /// - /// Gets or sets the base path for API access. - /// - public virtual string BasePath - { - get { return _basePath; } - set { _basePath = value; } - } - - /// - /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. - /// - public virtual bool UseDefaultCredentials - { - get { return _useDefaultCredentials; } - set { _useDefaultCredentials = value; } - } - - /// - /// Gets or sets the default header. - /// - [Obsolete("Use DefaultHeaders instead.")] - public virtual IDictionary DefaultHeader - { - get { return DefaultHeaders; } - set { DefaultHeaders = value; } - } - - /// - /// Gets or sets the default headers. - /// - public virtual IDictionary DefaultHeaders { get; set; } - - /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Defaults to - /// milliseconds. - /// - public virtual int Timeout { get; set; } - - /// - /// Gets or sets the proxy - /// - /// Proxy. - public virtual WebProxy Proxy { get; set; } - - /// - /// Gets or sets the HTTP user agent. - /// - /// Http user agent. - public virtual string UserAgent { get; set; } - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public virtual string Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public virtual string Password { get; set; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix(string apiKeyIdentifier) - { - string apiKeyValue; - ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); - string apiKeyPrefix; - if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) - { - return apiKeyPrefix + " " + apiKeyValue; - } - - return apiKeyValue; - } - - /// - /// Gets or sets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - public X509CertificateCollection ClientCertificates { get; set; } - - /// - /// Gets or sets the access token for OAuth2 authentication. - /// - /// This helper property simplifies code generation. - /// - /// The access token. - public virtual string ApiToken { get; set; } - - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public virtual string TempFolderPath - { - get { return _tempFolderPath; } - set - { - if (string.IsNullOrEmpty(value)) - { - _tempFolderPath = Path.GetTempPath(); - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - { - Directory.CreateDirectory(value); - } - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - { - _tempFolderPath = value; - } - else - { - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - } - - /// - /// Gets or sets the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public virtual string DateTimeFormat - { - get { return _dateTimeFormat; } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// Whatever you set here will be prepended to the value defined in AddApiKey. - /// - /// An example invocation here might be: - /// - /// ApiKeyPrefix["Authorization"] = "Bearer"; - /// - /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. - /// - /// - /// OAuth2 workflows should set tokens via AccessToken. - /// - /// - /// The prefix of the API key. - public virtual IDictionary ApiKeyPrefix - { - get { return _apiKeyPrefix; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); - } - _apiKeyPrefix = value; - } - } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public virtual IDictionary ApiKey - { - get { return _apiKey; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKey collection may not be null."); - } - _apiKey = value; - } - } - - /// - /// Gets or sets the servers. - /// - /// The servers. - public virtual IList> Servers - { - get { return _servers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Servers may not be null."); - } - _servers = value; - } - } - - /// - /// Gets or sets the operation servers. - /// - /// The operation servers. - public virtual IReadOnlyDictionary< - string, - List> - > OperationServers - { - get { return _operationServers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Operation servers may not be null."); - } - _operationServers = value; - } - } - - /// - /// Returns URL based on server settings without providing values - /// for the variables - /// - /// Array index of the server settings. - /// The server URL. - public string GetServerUrl(int index) - { - return GetServerUrl(Servers, index, null); - } - - /// - /// Returns URL based on server settings. - /// - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - public string GetServerUrl(int index, Dictionary inputVariables) - { - return GetServerUrl(Servers, index, inputVariables); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index) - { - return GetOperationServerUrl(operation, index, null); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The operation server URL. - public string GetOperationServerUrl( - string operation, - int index, - Dictionary inputVariables - ) - { - if ( - operation != null - && OperationServers.TryGetValue(operation, out var operationServer) - ) - { - return GetServerUrl(operationServer, index, inputVariables); - } - - return null; - } - - /// - /// Returns URL based on server settings. - /// - /// Dictionary of server settings. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - private string GetServerUrl( - IList> servers, - int index, - Dictionary inputVariables - ) - { - if (index < 0 || index >= servers.Count) - { - throw new InvalidOperationException( - $"Invalid index {index} when selecting the server. Must be less than {servers.Count}." - ); - } - - if (inputVariables == null) - { - inputVariables = new Dictionary(); - } - - IReadOnlyDictionary server = servers[index]; - string url = (string)server["url"]; - - if (server.ContainsKey("variables")) - { - // go through each variable and assign a value - foreach ( - KeyValuePair variable in (IReadOnlyDictionary) - server["variables"] - ) - { - IReadOnlyDictionary serverVariables = - (IReadOnlyDictionary)(variable.Value); - - if (inputVariables.ContainsKey(variable.Key)) - { - if ( - ((List)serverVariables["enum_values"]).Contains( - inputVariables[variable.Key] - ) - ) - { - url = url.Replace( - "{" + variable.Key + "}", - inputVariables[variable.Key] - ); - } - else - { - throw new InvalidOperationException( - $"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}" - ); - } - } - else - { - // use default value - url = url.Replace( - "{" + variable.Key + "}", - (string)serverVariables["default_value"] - ); - } - } - } - - return url; - } - - /// - /// Gets and Sets the RemoteCertificateValidationCallback - /// - public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } - - #endregion Properties - - #region Methods - - /// - /// Returns a string with essential information for debugging. - /// - public static string ToDebugReport() - { - string report = "C# SDK (Seam) Debug Report:\n"; - report += " OS: " + System.Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 1.0.0\n"; - report += " SDK Package Version: 1.0.0\n"; - - return report; - } - - /// - /// Add Api Key Header. - /// - /// Api Key name. - /// Api Key value. - /// - public void AddApiKey(string key, string value) - { - ApiKey[key] = value; - } - - /// - /// Sets the API key prefix. - /// - /// Api Key name. - /// Api Key value. - public void AddApiKeyPrefix(string key, string value) - { - ApiKeyPrefix[key] = value; - } - - #endregion Methods - - #region Static Members - /// - /// Merge configurations. - /// - /// First configuration. - /// Second configuration. - /// Merged configuration. - public static IReadableSeamRequestConfiguration MergeConfigurations( - IReadableSeamRequestConfiguration first, - IReadableSeamRequestConfiguration second - ) - { - if (second == null) - return first ?? GlobalSeamRequestConfiguration.Instance; - - // Dictionary apiKey = first.ApiKey.ToDictionary( - // kvp => kvp.Key, - // kvp => kvp.Value - // ); - // Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary( - // kvp => kvp.Key, - // kvp => kvp.Value - // ); - Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary( - kvp => kvp.Key, - kvp => kvp.Value - ); - - // foreach (var kvp in second.ApiKey) - // apiKey[kvp.Key] = kvp.Value; - // foreach (var kvp in second.ApiKeyPrefix) - // apiKeyPrefix[kvp.Key] = kvp.Value; - foreach (var kvp in second.DefaultHeaders) - defaultHeaders[kvp.Key] = kvp.Value; - - var config = new SeamRequestConfiguration - { - // ApiKey = apiKey, - // ApiKeyPrefix = apiKeyPrefix, - DefaultHeaders = defaultHeaders, - BasePath = second.BasePath ?? first.BasePath, - Timeout = second.Timeout, - Proxy = second.Proxy ?? first.Proxy, - UserAgent = second.UserAgent ?? first.UserAgent, - // Username = second.Username ?? first.Username, - // Password = second.Password ?? first.Password, - // ApiToken = second.ApiToken ?? first.ApiToken, - TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, - DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, - ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, - // UseDefaultCredentials = second.UseDefaultCredentials, - RemoteCertificateValidationCallback = - second.RemoteCertificateValidationCallback - ?? first.RemoteCertificateValidationCallback, - }; - return config; - } - #endregion Static Members - } -} diff --git a/src/Seam/Exceptions/SeamActionAttemptException.cs b/src/Seam/Exceptions/SeamActionAttemptException.cs new file mode 100644 index 00000000..0c164e2b --- /dev/null +++ b/src/Seam/Exceptions/SeamActionAttemptException.cs @@ -0,0 +1,56 @@ +using System; + +namespace Seam +{ + /// + /// Base class for the exceptions raised while resolving an action attempt. + /// + public abstract class SeamActionAttemptException : SeamException + { + protected SeamActionAttemptException(string message, Models.ActionAttempt actionAttempt) + : base(message) + { + ActionAttempt = actionAttempt; + } + + public Models.ActionAttempt ActionAttempt { get; } + } + + /// + /// Raised when an action attempt finishes in the error state. + /// + public class SeamActionAttemptFailedException : SeamActionAttemptException + { + public SeamActionAttemptFailedException(Models.ActionAttempt actionAttempt) + : base(actionAttempt.Error?.Message ?? "Action attempt failed", actionAttempt) + { + Code = actionAttempt.Error?.Type ?? "unknown_error"; + } + + /// The action attempt error type. + public string Code { get; } + } + + /// + /// Raised when an action attempt does not finish within the timeout. + /// + /// + /// The action attempt it carries is the last one observed, which is still pending. + /// + public class SeamActionAttemptTimeoutException : SeamActionAttemptException + { + public SeamActionAttemptTimeoutException( + Models.ActionAttempt actionAttempt, + TimeSpan timeout + ) + : base( + $"Timed out waiting for action attempt after {timeout.TotalSeconds}s", + actionAttempt + ) + { + Timeout = timeout; + } + + public TimeSpan Timeout { get; } + } +} diff --git a/src/Seam/Exceptions/SeamException.cs b/src/Seam/Exceptions/SeamException.cs new file mode 100644 index 00000000..7a46cb6f --- /dev/null +++ b/src/Seam/Exceptions/SeamException.cs @@ -0,0 +1,21 @@ +using System; + +namespace Seam +{ + /// + /// The root of every exception the Seam SDK raises on its own behalf. + /// + /// + /// Transport failures that are not Seam API errors, such as a gateway returning HTML or a + /// connection reset, surface as the BCL's own + /// rather than a fabricated Seam error. + /// + public abstract class SeamException : Exception + { + protected SeamException(string message) + : base(message) { } + + protected SeamException(string message, Exception innerException) + : base(message, innerException) { } + } +} diff --git a/src/Seam/Exceptions/SeamHttpApiException.cs b/src/Seam/Exceptions/SeamHttpApiException.cs new file mode 100644 index 00000000..7ae7ae4b --- /dev/null +++ b/src/Seam/Exceptions/SeamHttpApiException.cs @@ -0,0 +1,38 @@ +using System.Text.Json; + +namespace Seam +{ + /// + /// Raised when the Seam API returns an error response. + /// + public class SeamHttpApiException : SeamException + { + public SeamHttpApiException( + string code, + string message, + int statusCode, + string? requestId, + JsonElement? data = null + ) + : base(message) + { + Code = code; + StatusCode = statusCode; + RequestId = requestId; + Data = data; + } + + /// The Seam error type, e.g. device_not_found. + public string Code { get; } + + /// The HTTP status code of the error response. + public int StatusCode { get; } + + /// The seam-request-id response header, or null when absent. + public string? RequestId { get; } + + /// Additional error data from the Seam error envelope, when present. + /// Hides to carry the Seam error payload. + public new JsonElement? Data { get; } + } +} diff --git a/src/Seam/Exceptions/SeamHttpInvalidInputException.cs b/src/Seam/Exceptions/SeamHttpInvalidInputException.cs new file mode 100644 index 00000000..db8cbf74 --- /dev/null +++ b/src/Seam/Exceptions/SeamHttpInvalidInputException.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; + +namespace Seam +{ + /// + /// Raised when the Seam API rejects the request parameters. + /// + public class SeamHttpInvalidInputException : SeamHttpApiException + { + private readonly JsonElement? _validationErrors; + + public SeamHttpInvalidInputException( + string message, + int statusCode, + string? requestId, + JsonElement? data = null, + JsonElement? validationErrors = null + ) + : base("invalid_input", message, statusCode, requestId, data) + { + _validationErrors = validationErrors; + } + + /// + /// The validation messages for a request parameter, or an empty list when that parameter + /// has none. + /// + public IReadOnlyList GetValidationErrorMessages(string paramName) + { + if ( + _validationErrors is not { ValueKind: JsonValueKind.Object } validationErrors + || !validationErrors.TryGetProperty(paramName, out var param) + || param.ValueKind != JsonValueKind.Object + || !param.TryGetProperty("_errors", out var errors) + || errors.ValueKind != JsonValueKind.Array + ) + { + return Array.Empty(); + } + + var messages = new List(); + foreach (var error in errors.EnumerateArray()) + { + if (error.ValueKind == JsonValueKind.String) + messages.Add(error.GetString()!); + } + + return messages; + } + } +} diff --git a/src/Seam/Exceptions/SeamHttpUnauthorizedException.cs b/src/Seam/Exceptions/SeamHttpUnauthorizedException.cs new file mode 100644 index 00000000..3640d6f4 --- /dev/null +++ b/src/Seam/Exceptions/SeamHttpUnauthorizedException.cs @@ -0,0 +1,11 @@ +namespace Seam +{ + /// + /// Raised when the Seam API rejects the request credentials. + /// + public class SeamHttpUnauthorizedException : SeamHttpApiException + { + public SeamHttpUnauthorizedException(string? requestId) + : base("unauthorized", "Unauthorized", 401, requestId) { } + } +} diff --git a/src/Seam/Exceptions/SeamInvalidOptionsException.cs b/src/Seam/Exceptions/SeamInvalidOptionsException.cs new file mode 100644 index 00000000..04d70e51 --- /dev/null +++ b/src/Seam/Exceptions/SeamInvalidOptionsException.cs @@ -0,0 +1,11 @@ +namespace Seam +{ + /// + /// Raised when a Seam client is constructed with missing or mutually exclusive options. + /// + public class SeamInvalidOptionsException : SeamException + { + public SeamInvalidOptionsException(string message) + : base($"Seam received invalid options: {message}") { } + } +} diff --git a/src/Seam/Exceptions/SeamInvalidTokenException.cs b/src/Seam/Exceptions/SeamInvalidTokenException.cs new file mode 100644 index 00000000..0dac89bc --- /dev/null +++ b/src/Seam/Exceptions/SeamInvalidTokenException.cs @@ -0,0 +1,12 @@ +namespace Seam +{ + /// + /// Raised when a Seam client is constructed with the wrong kind of token, so the mistake + /// produces a specific error instead of an opaque 401 from the server. + /// + public class SeamInvalidTokenException : SeamException + { + public SeamInvalidTokenException(string message) + : base($"Seam received an invalid token: {message}") { } + } +} diff --git a/src/Seam/Http/Auth.cs b/src/Seam/Http/Auth.cs new file mode 100644 index 00000000..2efdf017 --- /dev/null +++ b/src/Seam/Http/Auth.cs @@ -0,0 +1,144 @@ +using System.Collections.Generic; + +namespace Seam.Http +{ + /// + /// Builds the authorization headers for a Seam client. + /// + /// + /// Two authentication methods are supported: an API key, which is scoped to a single + /// workspace, and a personal access token, which is scoped to a Seam Console user and must + /// name the workspace it acts on. + /// + internal static class Auth + { + public static Dictionary GetAuthHeaders( + string? apiKey, + string? personalAccessToken, + string? workspaceId + ) + { + // The environment is only consulted when no credential was passed at all, so an + // explicit personal access token is not second guessed by a stray SEAM_API_KEY. + if (apiKey == null && personalAccessToken == null) + { + apiKey = Options.GetEnv("SEAM_API_KEY"); + personalAccessToken = Options.GetEnv("SEAM_PERSONAL_ACCESS_TOKEN"); + + if (apiKey != null && personalAccessToken != null) + throw new SeamInvalidOptionsException( + "Both SEAM_API_KEY and SEAM_PERSONAL_ACCESS_TOKEN environment variables are defined. " + + "Please use only one authentication method." + ); + } + + workspaceId ??= Options.GetEnv("SEAM_WORKSPACE_ID"); + + if (Options.IsSeamOptionsWithApiKey(apiKey, personalAccessToken)) + return GetAuthHeadersForApiKey(apiKey!); + + if ( + Options.IsSeamOptionsWithPersonalAccessToken( + personalAccessToken, + apiKey, + workspaceId + ) + ) + { + return GetAuthHeadersForPersonalAccessToken(personalAccessToken!, workspaceId!); + } + + throw new SeamInvalidOptionsException( + "Must specify an ApiKey or PersonalAccessToken. " + + "Attempted reading configuration from the environment, but neither the " + + "SEAM_API_KEY nor the SEAM_PERSONAL_ACCESS_TOKEN environment variable is set." + ); + } + + /// + /// Builds the headers for a client that is not scoped to a workspace, falling back to + /// the environment when no token is given. + /// + public static Dictionary GetAuthHeadersWithoutWorkspace( + string? personalAccessToken + ) + { + personalAccessToken ??= Options.GetEnv("SEAM_PERSONAL_ACCESS_TOKEN"); + + if (personalAccessToken == null) + throw new SeamInvalidOptionsException( + "Must specify a PersonalAccessToken. " + + "Attempted reading configuration from the environment, " + + "but the environment variable SEAM_PERSONAL_ACCESS_TOKEN is not set." + ); + + AssertPersonalAccessToken(personalAccessToken); + + return new Dictionary + { + ["authorization"] = $"Bearer {personalAccessToken}", + }; + } + + public static Dictionary GetAuthHeadersForApiKey(string apiKey) + { + if (Token.IsClientSessionToken(apiKey)) + throw new SeamInvalidTokenException( + "A Client Session Token cannot be used as an ApiKey" + ); + + if (Token.IsJwt(apiKey)) + throw new SeamInvalidTokenException("A JWT cannot be used as an ApiKey"); + + if (Token.IsAccessToken(apiKey)) + throw new SeamInvalidTokenException("An Access Token cannot be used as an ApiKey"); + + if (Token.IsPublishableKey(apiKey)) + throw new SeamInvalidTokenException( + "A Publishable Key cannot be used as an ApiKey" + ); + + if (!Token.IsSeamToken(apiKey)) + throw new SeamInvalidTokenException("Unknown or invalid ApiKey format"); + + return new Dictionary { ["authorization"] = $"Bearer {apiKey}" }; + } + + public static Dictionary GetAuthHeadersForPersonalAccessToken( + string personalAccessToken, + string workspaceId + ) + { + AssertPersonalAccessToken(personalAccessToken); + + return new Dictionary + { + ["authorization"] = $"Bearer {personalAccessToken}", + ["seam-workspace"] = workspaceId, + }; + } + + private static void AssertPersonalAccessToken(string token) + { + if (Token.IsClientSessionToken(token)) + throw new SeamInvalidTokenException( + "A Client Session Token cannot be used as a PersonalAccessToken" + ); + + if (Token.IsJwt(token)) + throw new SeamInvalidTokenException( + "A JWT cannot be used as a PersonalAccessToken" + ); + + if (Token.IsPublishableKey(token)) + throw new SeamInvalidTokenException( + "A Publishable Key cannot be used as a PersonalAccessToken" + ); + + if (!Token.IsAccessToken(token)) + throw new SeamInvalidTokenException( + "Unknown or invalid PersonalAccessToken format" + ); + } + } +} diff --git a/src/Seam/Http/Options.cs b/src/Seam/Http/Options.cs new file mode 100644 index 00000000..05532318 --- /dev/null +++ b/src/Seam/Http/Options.cs @@ -0,0 +1,85 @@ +using System; + +namespace Seam.Http +{ + /// + /// Resolves the API endpoint and validates mutually exclusive authentication options. + /// + internal static class Options + { + public const string DefaultEndpoint = "https://connect.getseam.com"; + + public static string GetEndpoint(string? endpoint = null) => + endpoint ?? GetEnv("SEAM_ENDPOINT") ?? DefaultEndpoint; + + public static bool IsSeamOptionsWithApiKey(string? apiKey, string? personalAccessToken) + { + if (apiKey == null) + return false; + + if (personalAccessToken != null) + throw new SeamInvalidOptionsException( + "The PersonalAccessToken option cannot be used with the ApiKey option" + ); + + return true; + } + + public static bool IsSeamOptionsWithPersonalAccessToken( + string? personalAccessToken, + string? apiKey, + string? workspaceId + ) + { + if (personalAccessToken == null) + return false; + + if (apiKey != null) + throw new SeamInvalidOptionsException( + "The ApiKey option cannot be used with the PersonalAccessToken option" + ); + + if (workspaceId == null) + throw new SeamInvalidOptionsException( + "Must pass a WorkspaceId when using a PersonalAccessToken" + ); + + return true; + } + + /// + /// A preconfigured client carries its own endpoint and authorization, so an option that + /// would configure one is a mistake to combine with it, and is rejected rather than + /// silently ignored. + /// + /// The preconfigured client, or null when not given. + /// The other options by name, where null means not given. + public static void CheckHttpClientOptions( + object? httpClient, + params (string Name, object? Value)[] options + ) + { + if (httpClient == null) + return; + + foreach (var (name, value) in options) + { + if (value != null) + throw new SeamInvalidOptionsException( + $"The {name} option cannot be used with the HttpClient option" + ); + } + } + + /// + /// Reads an environment variable, treating an empty value as unset so that an + /// exported-but-blank variable does not override the default. + /// + public static string? GetEnv(string name) + { + var value = Environment.GetEnvironmentVariable(name); + + return string.IsNullOrEmpty(value) ? null : value; + } + } +} diff --git a/src/Seam/Http/SeamHttpClientFactory.cs b/src/Seam/Http/SeamHttpClientFactory.cs new file mode 100644 index 00000000..e0d3508d --- /dev/null +++ b/src/Seam/Http/SeamHttpClientFactory.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading; + +namespace Seam.Http +{ + /// + /// Builds the a Seam client sends requests with. + /// + /// + /// The client carries the endpoint, the authorization headers, and the + /// seam-sdk-name and seam-sdk-version headers, with retry and per-attempt + /// timeout handlers on its pipeline. The client's own whole-pipeline timeout is disabled so + /// the timeout applies to each attempt rather than the complete sequence of attempts. + /// + internal static class SeamHttpClientFactory + { + public static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(30); + + public const string SdkName = "seamapi/csharp"; + + public static HttpClient Create( + string endpoint, + IReadOnlyDictionary authHeaders, + TimeSpan? timeout, + int? maxRetries, + HttpMessageHandler? httpMessageHandler + ) + { + var handler = new SeamRetryHandler( + maxRetries ?? SeamRetryHandler.DefaultMaxRetries, + new SeamTimeoutHandler( + timeout ?? DefaultTimeout, + httpMessageHandler ?? new SocketsHttpHandler() + ) + ); + + var client = new HttpClient(handler) + { + BaseAddress = new Uri(endpoint), + Timeout = Timeout.InfiniteTimeSpan, + }; + + client.DefaultRequestHeaders.Accept.Add( + new MediaTypeWithQualityHeaderValue("application/json") + ); + + foreach (var (name, value) in authHeaders) + { + client.DefaultRequestHeaders.TryAddWithoutValidation(name, value); + } + + // The SDK headers are set last so they always win. + client.DefaultRequestHeaders.Remove("seam-sdk-name"); + client.DefaultRequestHeaders.TryAddWithoutValidation("seam-sdk-name", SdkName); + client.DefaultRequestHeaders.Remove("seam-sdk-version"); + client.DefaultRequestHeaders.TryAddWithoutValidation( + "seam-sdk-version", + SeamVersion.Value + ); + + return client; + } + } +} diff --git a/src/Seam/Http/SeamHttpTransport.cs b/src/Seam/Http/SeamHttpTransport.cs new file mode 100644 index 00000000..bb160a1a --- /dev/null +++ b/src/Seam/Http/SeamHttpTransport.cs @@ -0,0 +1,286 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; + +namespace Seam.Http +{ + /// + /// Executes Seam API requests: GET and DELETE carry their parameters as URL search + /// parameters per the Seam serialization standard, every other method sends a JSON body, + /// and a Seam error response raises the matching . + /// + /// + /// A response that is not a Seam error envelope, such as a gateway returning HTML, raises + /// the the transport would have raised on its own rather + /// than a fabricated Seam error. + /// + internal sealed class SeamHttpTransport + { + public SeamHttpTransport(HttpClient client) + { + if (client.BaseAddress == null) + throw new SeamInvalidOptionsException( + "The HttpClient option requires a client with a BaseAddress" + ); + + Client = client; + } + + public HttpClient Client { get; } + + public async Task SendAsync( + HttpMethod method, + string path, + object? parameters, + CancellationToken cancellationToken + ) + { + using var response = await ExecuteAsync(method, path, parameters, cancellationToken) + .ConfigureAwait(false); + + var body = await response + .Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + + var result = + body.Length > 0 + ? JsonSerializer.Deserialize(body, SeamJson.Options) + : default; + + return result ?? throw new JsonException($"Seam returned an empty response for {path}"); + } + + public async Task SendAsync( + HttpMethod method, + string path, + object? parameters, + CancellationToken cancellationToken + ) + { + using var response = await ExecuteAsync(method, path, parameters, cancellationToken) + .ConfigureAwait(false); + } + + private async Task ExecuteAsync( + HttpMethod method, + string path, + object? parameters, + CancellationToken cancellationToken + ) + { + using var request = CreateRequest(method, path, parameters); + + var response = await Client.SendAsync(request, cancellationToken).ConfigureAwait(false); + + if (response.IsSuccessStatusCode) + return response; + + using (response) + { + throw await ToExceptionAsync(response, cancellationToken).ConfigureAwait(false); + } + } + + private static HttpRequestMessage CreateRequest( + HttpMethod method, + string path, + object? parameters + ) + { + if (CarriesDataInQuery(method)) + { + var query = + parameters == null + ? "" + : StrictUrlSearchParamsSerializer.Serialize(ToSearchParams(parameters)); + + var uri = query.Length > 0 ? $"{path}?{query}" : path; + + return new HttpRequestMessage(method, uri); + } + + var body = JsonSerializer.Serialize( + parameters ?? new object(), + parameters?.GetType() ?? typeof(object), + SeamJson.Options + ); + + return new HttpRequestMessage(method, path) + { + Content = new StringContent(body, Encoding.UTF8, "application/json"), + }; + } + + private static bool CarriesDataInQuery(HttpMethod method) => + method == HttpMethod.Get || method == HttpMethod.Delete; + + private static async Task ToExceptionAsync( + HttpResponseMessage response, + CancellationToken cancellationToken + ) + { + var statusCode = (int)response.StatusCode; + var requestId = GetRequestId(response); + + if (statusCode == 401) + return new SeamHttpUnauthorizedException(requestId); + + var error = await GetErrorAsync(response, cancellationToken).ConfigureAwait(false); + + if (error is not { } seamError) + { + try + { + response.EnsureSuccessStatusCode(); + } + catch (HttpRequestException exception) + { + return exception; + } + } + else + { + var type = seamError.GetProperty("type").GetString()!; + var message = seamError.GetProperty("message").GetString()!; + JsonElement? data = seamError.TryGetProperty("data", out var dataElement) + ? dataElement + : null; + + if (type == "invalid_input") + { + JsonElement? validationErrors = seamError.TryGetProperty( + "validation_errors", + out var validationErrorsElement + ) + ? validationErrorsElement + : null; + + return new SeamHttpInvalidInputException( + message, + statusCode, + requestId, + data, + validationErrors + ); + } + + return new SeamHttpApiException(type, message, statusCode, requestId, data); + } + + // Unreachable: EnsureSuccessStatusCode always throws for a non-success status. + return new HttpRequestException($"Request failed with status code {statusCode}."); + } + + /// + /// The error from a Seam error envelope, i.e. JSON holding an error object with a + /// string type and message, or null when the response is not one. + /// + private static async Task GetErrorAsync( + HttpResponseMessage response, + CancellationToken cancellationToken + ) + { + var contentType = response.Content.Headers.ContentType?.MediaType; + + if (contentType != "application/json") + return null; + + var body = await response + .Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + + JsonElement root; + try + { + using var document = JsonDocument.Parse(body); + root = document.RootElement.Clone(); + } + catch (JsonException) + { + return null; + } + + if ( + root.ValueKind != JsonValueKind.Object + || !root.TryGetProperty("error", out var error) + || error.ValueKind != JsonValueKind.Object + || !error.TryGetProperty("type", out var type) + || type.ValueKind != JsonValueKind.String + || !error.TryGetProperty("message", out var message) + || message.ValueKind != JsonValueKind.String + ) + { + return null; + } + + return error; + } + + private static string? GetRequestId(HttpResponseMessage response) => + response.Headers.TryGetValues("seam-request-id", out var values) + ? values.FirstOrDefault() + : null; + + /// + /// Converts a request object to search parameters through the JSON contract, so query + /// and body parameters share names and values. + /// + /// + /// An unset parameter is absent from the JSON contract, so a null can only be the + /// sentinel and is restored as one. + /// + internal static IDictionary ToSearchParams(object data) + { + var element = JsonSerializer.SerializeToElement(data, data.GetType(), SeamJson.Options); + + if (ToSearchParamValue(element) is not IDictionary parameters) + throw new ArgumentException( + $"Request data must serialize to an object, got {element.ValueKind}", + nameof(data) + ); + + return parameters; + } + + private static object? ToSearchParamValue(JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + var parameters = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + parameters[property.Name] = ToSearchParamValue(property.Value); + } + return parameters; + case JsonValueKind.Array: + return element.EnumerateArray().Select(ToSearchParamValue).ToList(); + case JsonValueKind.Null: + case JsonValueKind.Undefined: + return Null.Value; + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Number: + if (element.TryGetInt64(out var integer)) + return integer; + if (element.TryGetDecimal(out var dec)) + return dec; + return element.GetDouble(); + default: + throw new InvalidOperationException( + $"Unexpected JSON value kind {element.ValueKind}" + ); + } + } + } +} diff --git a/src/Seam/Http/SeamRetryHandler.cs b/src/Seam/Http/SeamRetryHandler.cs new file mode 100644 index 00000000..74a2c31d --- /dev/null +++ b/src/Seam/Http/SeamRetryHandler.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Seam.Http +{ + /// + /// Retries transient failures for idempotent requests. + /// + /// + /// + /// Only GET, HEAD, OPTIONS, PUT, and DELETE are retried, so a retried request can never + /// duplicate a write: POST and PATCH fail on the first transient error. A request is retried + /// on a transport error, a timed out attempt, a 429, or a 5xx. + /// + /// + /// The delay before each retry is an exponential backoff with jitter, compared with, rather + /// than replaced by, the server's Retry-After so a server asking for a longer wait is + /// honored. + /// + /// + internal sealed class SeamRetryHandler : DelegatingHandler + { + public const int DefaultMaxRetries = 2; + + private const double InitialDelaySeconds = 0.2; + + private const double JitterMultiplier = 1.2; + + private static readonly HashSet IdempotentMethods = + new() + { + HttpMethod.Get, + HttpMethod.Head, + HttpMethod.Options, + HttpMethod.Put, + HttpMethod.Delete, + }; + + private readonly int _maxRetries; + + public SeamRetryHandler(int maxRetries, HttpMessageHandler innerHandler) + : base(innerHandler) + { + _maxRetries = Math.Max(0, maxRetries); + } + + protected override async Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken + ) + { + var maxRetries = IdempotentMethods.Contains(request.Method) ? _maxRetries : 0; + + for (var retryCount = 1; ; retryCount++) + { + HttpResponseMessage? response = null; + Exception? transientException = null; + + try + { + response = await base.SendAsync(request, cancellationToken) + .ConfigureAwait(false); + } + catch (Exception exception) + when (exception is HttpRequestException or TimeoutException) + { + transientException = exception; + } + + if (response != null && !IsRetryableStatus(response)) + return response; + + if (retryCount > maxRetries) + { + if (transientException != null) + throw transientException; + + return response!; + } + + var delay = GetDelay(retryCount, response); + response?.Dispose(); + + await Task.Delay(delay, cancellationToken).ConfigureAwait(false); + } + } + + private static bool IsRetryableStatus(HttpResponseMessage response) + { + var statusCode = (int)response.StatusCode; + + return statusCode == 429 || (statusCode >= 500 && statusCode <= 599); + } + + private static TimeSpan GetDelay(int retryCount, HttpResponseMessage? response) + { + var backoff = InitialDelaySeconds * Math.Pow(2.0, retryCount - 1); + var jitteredBackoff = TimeSpan.FromSeconds( + backoff * (1.0 + Random.Shared.NextDouble() * (JitterMultiplier - 1.0)) + ); + + var retryAfter = GetRetryAfter(response); + + return retryAfter > jitteredBackoff ? retryAfter : jitteredBackoff; + } + + private static TimeSpan GetRetryAfter(HttpResponseMessage? response) + { + var retryAfter = response?.Headers.RetryAfter; + + if (retryAfter == null) + return TimeSpan.Zero; + + if (retryAfter.Delta is { } delta) + return delta; + + if (retryAfter.Date is { } date) + { + var delay = date - DateTimeOffset.UtcNow; + + return delay > TimeSpan.Zero ? delay : TimeSpan.Zero; + } + + return TimeSpan.Zero; + } + } +} diff --git a/src/Seam/Http/SeamTimeoutHandler.cs b/src/Seam/Http/SeamTimeoutHandler.cs new file mode 100644 index 00000000..612e28a1 --- /dev/null +++ b/src/Seam/Http/SeamTimeoutHandler.cs @@ -0,0 +1,55 @@ +using System; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Seam.Http +{ + /// + /// Applies the request timeout to each individual attempt. + /// + /// + /// This handler sits inside so the timeout covers each + /// attempt rather than the complete sequence of attempts, and the owning + /// disables its own whole-pipeline timeout. A timed out attempt + /// throws , distinct from the + /// of a caller's own cancellation. + /// + internal sealed class SeamTimeoutHandler : DelegatingHandler + { + private readonly TimeSpan _timeout; + + public SeamTimeoutHandler(TimeSpan timeout, HttpMessageHandler innerHandler) + : base(innerHandler) + { + _timeout = timeout; + } + + protected override async Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken + ) + { + if (_timeout == Timeout.InfiniteTimeSpan) + return await base.SendAsync(request, cancellationToken).ConfigureAwait(false); + + using var timeoutSource = CancellationTokenSource.CreateLinkedTokenSource( + cancellationToken + ); + timeoutSource.CancelAfter(_timeout); + + try + { + return await base.SendAsync(request, timeoutSource.Token).ConfigureAwait(false); + } + catch (OperationCanceledException exception) + when (!cancellationToken.IsCancellationRequested) + { + throw new TimeoutException( + $"The request did not complete within the timeout of {_timeout.TotalSeconds}s.", + exception + ); + } + } + } +} diff --git a/src/Seam/Http/SeamVersion.cs b/src/Seam/Http/SeamVersion.cs new file mode 100644 index 00000000..5f1523d2 --- /dev/null +++ b/src/Seam/Http/SeamVersion.cs @@ -0,0 +1,28 @@ +using System.Reflection; + +namespace Seam.Http +{ + /// + /// The SDK package version, read from the assembly so it always matches the version the + /// package was built as. + /// + internal static class SeamVersion + { + public static string Value { get; } = Read(); + + private static string Read() + { + var version = typeof(SeamVersion) + .Assembly.GetCustomAttribute() + ?.InformationalVersion; + + if (version == null) + return "unknown"; + + // Strip source-link build metadata, e.g. "1.2.3+abc123" -> "1.2.3". + var metadataStart = version.IndexOf('+'); + + return metadataStart < 0 ? version : version[..metadataStart]; + } + } +} diff --git a/src/Seam/Http/Token.cs b/src/Seam/Http/Token.cs new file mode 100644 index 00000000..4988ba9a --- /dev/null +++ b/src/Seam/Http/Token.cs @@ -0,0 +1,45 @@ +namespace Seam.Http +{ + /// + /// Predicates for recognizing the kinds of token the Seam API issues. + /// + /// + /// Only API keys and personal access tokens authenticate this SDK. The other kinds are + /// recognized so that passing one produces a specific error instead of an opaque 401 from + /// the server. + /// + internal static class Token + { + public const string TokenPrefix = "seam_"; + + public const string AccessTokenPrefix = "seam_at"; + + public const string ClientSessionTokenPrefix = "seam_cst"; + + public const string PublishableKeyPrefix = "seam_pk"; + + public const string JwtPrefix = "ey"; + + public static bool IsSeamToken(string token) => token.StartsWith(TokenPrefix); + + public static bool IsAccessToken(string token) => token.StartsWith(AccessTokenPrefix); + + public static bool IsClientSessionToken(string token) => + token.StartsWith(ClientSessionTokenPrefix); + + public static bool IsPublishableKey(string token) => token.StartsWith(PublishableKeyPrefix); + + public static bool IsJwt(string token) => token.StartsWith(JwtPrefix); + + public static bool IsConsoleSessionToken(string token) => IsJwt(token); + + public static bool IsPersonalAccessToken(string token) => IsAccessToken(token); + + public static bool IsApiKey(string token) => + !IsClientSessionToken(token) + && !IsJwt(token) + && !IsAccessToken(token) + && !IsPublishableKey(token) + && IsSeamToken(token); + } +} diff --git a/src/Seam/Model/AccessCode.cs b/src/Seam/Model/AccessCode.cs deleted file mode 100644 index 30d214f0..00000000 --- a/src/Seam/Model/AccessCode.cs +++ /dev/null @@ -1,3826 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a smart lock [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - /// An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. Using the Seam Access Code API, you can easily generate access codes on the hundreds of door lock models with which we integrate. - /// - /// Seam supports programming two types of access codes: [ongoing](https://docs.seam.co/low-level-apis/smart-locks/access-codes#ongoing-access-codes) and [time-bound](https://docs.seam.co/low-level-apis/smart-locks/access-codes#time-bound-access-codes). To differentiate between the two, refer to the `type` property of the access code. Ongoing codes display as `ongoing`, whereas time-bound codes are labeled `time_bound`. An ongoing access code is active, until it has been removed from the device. To specify an ongoing access code, leave both `starts_at` and `ends_at` empty. A time-bound access code will be programmed at the `starts_at` time and removed at the `ends_at` time. - /// - /// In addition, for certain devices, Seam also supports [offline access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes#offline-access-codes). Offline access (PIN) codes are designed for door locks that might not always maintain an internet connection. For this type of access code, the device manufacturer uses encryption keys (tokens) to create server-based registries of algorithmically-generated offline PIN codes. Because the tokens remain synchronized with the managed devices, the locks do not require an active internet connection—and you do not need to be near the locks—to create an offline access code. Then, owners or managers can share these offline codes with users through a variety of mechanisms, such as messaging applications. That is, lock users do not need to install a smartphone application to receive an offline access code. - /// - /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. - /// - [DataContract(Name = "seamModel_accessCode_model")] - public class AccessCode - { - [JsonConstructorAttribute] - protected AccessCode() { } - - public AccessCode( - string accessCodeId = default, - string? code = default, - string? commonCodeKey = default, - string createdAt = default, - string deviceId = default, - AccessCodeDormakabaOracodeMetadata? dormakabaOracodeMetadata = default, - string? endsAt = default, - List errors = default, - bool? isBackup = default, - bool isBackupAccessCodeAvailable = default, - bool isExternalModificationAllowed = default, - bool isManaged = default, - bool isOfflineAccessCode = default, - bool isOneTimeUse = default, - bool? isScheduledOnDevice = default, - bool? isWaitingForCodeAssignment = default, - string? name = default, - List pendingMutations = default, - string? pulledBackupAccessCodeId = default, - string? startsAt = default, - AccessCode.StatusEnum status = default, - AccessCode.TypeEnum type = default, - List warnings = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - Code = code; - CommonCodeKey = commonCodeKey; - CreatedAt = createdAt; - DeviceId = deviceId; - DormakabaOracodeMetadata = dormakabaOracodeMetadata; - EndsAt = endsAt; - Errors = errors; - IsBackup = isBackup; - IsBackupAccessCodeAvailable = isBackupAccessCodeAvailable; - IsExternalModificationAllowed = isExternalModificationAllowed; - IsManaged = isManaged; - IsOfflineAccessCode = isOfflineAccessCode; - IsOneTimeUse = isOneTimeUse; - IsScheduledOnDevice = isScheduledOnDevice; - IsWaitingForCodeAssignment = isWaitingForCodeAssignment; - Name = name; - PendingMutations = pendingMutations; - PulledBackupAccessCodeId = pulledBackupAccessCodeId; - StartsAt = startsAt; - Status = status; - Type = type; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(AccessCodeErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsBridgeDisconnected), - "bridge_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsSubscriptionRequired), - "subscription_required" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsAuxiliaryHeatRunning), - "auxiliary_heat_running" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsMissingDeviceCredentials), - "missing_device_credentials" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsAugustLockNotAuthorized), - "august_lock_not_authorized" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsEmptyBackupAccessCodePool), - "empty_backup_access_code_pool" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsDeviceDisconnected), - "device_disconnected" - )] - [JsonSubtypes.KnownSubType(typeof(AccessCodeErrorsHubDisconnected), "hub_disconnected")] - [JsonSubtypes.KnownSubType(typeof(AccessCodeErrorsDeviceRemoved), "device_removed")] - [JsonSubtypes.KnownSubType(typeof(AccessCodeErrorsDeviceOffline), "device_offline")] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsDormakabaSitesDisconnected), - "dormakaba_sites_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsInsufficientPermissions), - "insufficient_permissions" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsSaltoKsSubscriptionLimitExceeded), - "salto_ks_subscription_limit_exceeded" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsAccountDisconnected), - "account_disconnected" - )] - [JsonSubtypes.KnownSubType(typeof(AccessCodeErrorsFailedToExpire), "failed_to_expire")] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsFailedToApplyMutations), - "failed_to_apply_mutations" - )] - [JsonSubtypes.KnownSubType(typeof(AccessCodeErrorsFailedToIssue), "failed_to_issue")] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsCodeConstraintsViolated), - "code_constraints_violated" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsAccessCodeInactive), - "access_code_inactive" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsConflictingExternalModification), - "conflicting_external_modification" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsNoSpaceForAccessCodeOnDevice), - "no_space_for_access_code_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsDuplicateCodeOnDevice), - "duplicate_code_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsFailedToRemoveFromDevice), - "failed_to_remove_from_device" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeErrorsFailedToSetOnDevice), - "failed_to_set_on_device" - )] - [JsonSubtypes.KnownSubType(typeof(AccessCodeErrorsProviderIssue), "provider_issue")] - public abstract class AccessCodeErrors - { - public abstract string ErrorCode { get; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_accessCodeErrorsProviderIssue_model")] - public class AccessCodeErrorsProviderIssue : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsProviderIssue() { } - - public AccessCodeErrorsProviderIssue( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "provider_issue"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsFailedToSetOnDevice_model")] - public class AccessCodeErrorsFailedToSetOnDevice : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsFailedToSetOnDevice() { } - - public AccessCodeErrorsFailedToSetOnDevice( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_set_on_device"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsFailedToRemoveFromDevice_model")] - public class AccessCodeErrorsFailedToRemoveFromDevice : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsFailedToRemoveFromDevice() { } - - public AccessCodeErrorsFailedToRemoveFromDevice( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_remove_from_device"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsDuplicateCodeOnDevice_model")] - public class AccessCodeErrorsDuplicateCodeOnDevice : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsDuplicateCodeOnDevice() { } - - public AccessCodeErrorsDuplicateCodeOnDevice( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string? managedAccessCodeId = default, - string message = default, - string? unmanagedAccessCodeId = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - ManagedAccessCodeId = managedAccessCodeId; - Message = message; - UnmanagedAccessCodeId = unmanagedAccessCodeId; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "duplicate_code_on_device"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// ID of the managed access code that conflicts with this managed access code, when Seam can identify it. - /// - [DataMember( - Name = "managed_access_code_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ManagedAccessCodeId { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// ID of the unmanaged access code that conflicts with this managed access code, when Seam can identify it. - /// - [DataMember( - Name = "unmanaged_access_code_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? UnmanagedAccessCodeId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsNoSpaceForAccessCodeOnDevice_model")] - public class AccessCodeErrorsNoSpaceForAccessCodeOnDevice : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsNoSpaceForAccessCodeOnDevice() { } - - public AccessCodeErrorsNoSpaceForAccessCodeOnDevice( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "no_space_for_access_code_on_device"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsConflictingExternalModification_model")] - public class AccessCodeErrorsConflictingExternalModification : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsConflictingExternalModification() { } - - public AccessCodeErrorsConflictingExternalModification( - AccessCodeErrorsConflictingExternalModification.ChangeTypeEnum? changeType = - default, - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default, - List? modifiedFields = - default - ) - { - ChangeType = changeType; - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - ModifiedFields = modifiedFields; - } - - /// - /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ChangeTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "modified")] - Modified = 1, - - [EnumMember(Value = "removed")] - Removed = 2, - } - - /// - /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. - /// - [DataMember(Name = "change_type", IsRequired = false, EmitDefaultValue = false)] - public AccessCodeErrorsConflictingExternalModification.ChangeTypeEnum? ChangeType { get; set; } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "conflicting_external_modification"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// List of fields that were changed externally, with their previous and new values. - /// - [DataMember(Name = "modified_fields", IsRequired = false, EmitDefaultValue = false)] - public List? ModifiedFields { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_accessCodeErrorsConflictingExternalModificationModifiedFields_model" - )] - public class AccessCodeErrorsConflictingExternalModificationModifiedFields - { - [JsonConstructorAttribute] - protected AccessCodeErrorsConflictingExternalModificationModifiedFields() { } - - public AccessCodeErrorsConflictingExternalModificationModifiedFields( - string field = default, - string? from = default, - string? to = default - ) - { - Field = field; - From = from; - To = to; - } - - /// - /// The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). - /// - [DataMember(Name = "field", IsRequired = false, EmitDefaultValue = false)] - public string Field { get; set; } - - /// - /// The previous value of the field. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public string? From { get; set; } - - /// - /// The new value of the field. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public string? To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsAccessCodeInactive_model")] - public class AccessCodeErrorsAccessCodeInactive : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsAccessCodeInactive() { } - - public AccessCodeErrorsAccessCodeInactive( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "access_code_inactive"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsCodeConstraintsViolated_model")] - public class AccessCodeErrorsCodeConstraintsViolated : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsCodeConstraintsViolated() { } - - public AccessCodeErrorsCodeConstraintsViolated( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "code_constraints_violated"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsFailedToIssue_model")] - public class AccessCodeErrorsFailedToIssue : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsFailedToIssue() { } - - public AccessCodeErrorsFailedToIssue( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_issue"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsFailedToApplyMutations_model")] - public class AccessCodeErrorsFailedToApplyMutations : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsFailedToApplyMutations() { } - - public AccessCodeErrorsFailedToApplyMutations( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_apply_mutations"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsFailedToExpire_model")] - public class AccessCodeErrorsFailedToExpire : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsFailedToExpire() { } - - public AccessCodeErrorsFailedToExpire( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_expire"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsAccountDisconnected_model")] - public class AccessCodeErrorsAccountDisconnected : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsAccountDisconnected() { } - - public AccessCodeErrorsAccountDisconnected( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "account_disconnected"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsSaltoKsSubscriptionLimitExceeded_model")] - public class AccessCodeErrorsSaltoKsSubscriptionLimitExceeded : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsSaltoKsSubscriptionLimitExceeded() { } - - public AccessCodeErrorsSaltoKsSubscriptionLimitExceeded( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsInsufficientPermissions_model")] - public class AccessCodeErrorsInsufficientPermissions : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsInsufficientPermissions() { } - - public AccessCodeErrorsInsufficientPermissions( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "insufficient_permissions"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsDormakabaSitesDisconnected_model")] - public class AccessCodeErrorsDormakabaSitesDisconnected : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsDormakabaSitesDisconnected() { } - - public AccessCodeErrorsDormakabaSitesDisconnected( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsDeviceOffline_model")] - public class AccessCodeErrorsDeviceOffline : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsDeviceOffline() { } - - public AccessCodeErrorsDeviceOffline( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_offline"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsDeviceRemoved_model")] - public class AccessCodeErrorsDeviceRemoved : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsDeviceRemoved() { } - - public AccessCodeErrorsDeviceRemoved( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_removed"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsHubDisconnected_model")] - public class AccessCodeErrorsHubDisconnected : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsHubDisconnected() { } - - public AccessCodeErrorsHubDisconnected( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "hub_disconnected"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsDeviceDisconnected_model")] - public class AccessCodeErrorsDeviceDisconnected : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsDeviceDisconnected() { } - - public AccessCodeErrorsDeviceDisconnected( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_disconnected"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsEmptyBackupAccessCodePool_model")] - public class AccessCodeErrorsEmptyBackupAccessCodePool : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsEmptyBackupAccessCodePool() { } - - public AccessCodeErrorsEmptyBackupAccessCodePool( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "empty_backup_access_code_pool"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsAugustLockNotAuthorized_model")] - public class AccessCodeErrorsAugustLockNotAuthorized : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsAugustLockNotAuthorized() { } - - public AccessCodeErrorsAugustLockNotAuthorized( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "august_lock_not_authorized"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsMissingDeviceCredentials_model")] - public class AccessCodeErrorsMissingDeviceCredentials : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsMissingDeviceCredentials() { } - - public AccessCodeErrorsMissingDeviceCredentials( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "missing_device_credentials"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsAuxiliaryHeatRunning_model")] - public class AccessCodeErrorsAuxiliaryHeatRunning : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsAuxiliaryHeatRunning() { } - - public AccessCodeErrorsAuxiliaryHeatRunning( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "auxiliary_heat_running"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsSubscriptionRequired_model")] - public class AccessCodeErrorsSubscriptionRequired : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsSubscriptionRequired() { } - - public AccessCodeErrorsSubscriptionRequired( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "subscription_required"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsBridgeDisconnected_model")] - public class AccessCodeErrorsBridgeDisconnected : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsBridgeDisconnected() { } - - public AccessCodeErrorsBridgeDisconnected( - string createdAt = default, - string errorCode = default, - bool? isBridgeError = default, - bool? isConnectedAccountError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsBridgeError = isBridgeError; - IsConnectedAccountError = isConnectedAccountError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "bridge_disconnected"; - - /// - /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public bool? IsBridgeError { get; set; } - - /// - /// Indicates whether the error is related specifically to the connected account. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsConnectedAccountError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeErrorsUnrecognized_model")] - public class AccessCodeErrorsUnrecognized : AccessCodeErrors - { - [JsonConstructorAttribute] - protected AccessCodeErrorsUnrecognized() { } - - public AccessCodeErrorsUnrecognized( - string errorCode = default, - string message = default - ) - { - ErrorCode = errorCode; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "mutation_code")] - [JsonSubtypes.FallBackSubType(typeof(AccessCodePendingMutationsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AccessCodePendingMutationsUpdatingTimeFrame), - "updating_time_frame" - )] - [JsonSubtypes.KnownSubType(typeof(AccessCodePendingMutationsUpdatingName), "updating_name")] - [JsonSubtypes.KnownSubType(typeof(AccessCodePendingMutationsUpdatingCode), "updating_code")] - [JsonSubtypes.KnownSubType(typeof(AccessCodePendingMutationsDeleting), "deleting")] - [JsonSubtypes.KnownSubType( - typeof(AccessCodePendingMutationsDeferringCreation), - "deferring_creation" - )] - [JsonSubtypes.KnownSubType(typeof(AccessCodePendingMutationsCreating), "creating")] - public abstract class AccessCodePendingMutations - { - public abstract string MutationCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsCreating_model")] - public class AccessCodePendingMutationsCreating : AccessCodePendingMutations - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsCreating() { } - - public AccessCodePendingMutationsCreating( - string createdAt = default, - string message = default, - string mutationCode = default - ) - { - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "creating"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsDeferringCreation_model")] - public class AccessCodePendingMutationsDeferringCreation : AccessCodePendingMutations - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsDeferringCreation() { } - - public AccessCodePendingMutationsDeferringCreation( - string createdAt = default, - string message = default, - string mutationCode = default, - string scheduledAt = default - ) - { - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - ScheduledAt = scheduledAt; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "deferring_creation"; - - /// - /// Date and time at which Seam will attempt to program this access code on the device. - /// - [DataMember(Name = "scheduled_at", IsRequired = false, EmitDefaultValue = false)] - public string ScheduledAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsDeleting_model")] - public class AccessCodePendingMutationsDeleting : AccessCodePendingMutations - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsDeleting() { } - - public AccessCodePendingMutationsDeleting( - string createdAt = default, - string message = default, - string mutationCode = default - ) - { - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "deleting"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUpdatingCode_model")] - public class AccessCodePendingMutationsUpdatingCode : AccessCodePendingMutations - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUpdatingCode() { } - - public AccessCodePendingMutationsUpdatingCode( - string createdAt = default, - AccessCodePendingMutationsUpdatingCodeFrom from = default, - string message = default, - string mutationCode = default, - AccessCodePendingMutationsUpdatingCodeTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous code configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AccessCodePendingMutationsUpdatingCodeFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_code"; - - /// - /// New code configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AccessCodePendingMutationsUpdatingCodeTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUpdatingCodeFrom_model")] - public class AccessCodePendingMutationsUpdatingCodeFrom - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUpdatingCodeFrom() { } - - public AccessCodePendingMutationsUpdatingCodeFrom(string? code = default) - { - Code = code; - } - - /// - /// Previous PIN code. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUpdatingCodeTo_model")] - public class AccessCodePendingMutationsUpdatingCodeTo - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUpdatingCodeTo() { } - - public AccessCodePendingMutationsUpdatingCodeTo(string? code = default) - { - Code = code; - } - - /// - /// New PIN code. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUpdatingName_model")] - public class AccessCodePendingMutationsUpdatingName : AccessCodePendingMutations - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUpdatingName() { } - - public AccessCodePendingMutationsUpdatingName( - string createdAt = default, - AccessCodePendingMutationsUpdatingNameFrom from = default, - string message = default, - string mutationCode = default, - AccessCodePendingMutationsUpdatingNameTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous name configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AccessCodePendingMutationsUpdatingNameFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_name"; - - /// - /// New name configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AccessCodePendingMutationsUpdatingNameTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUpdatingNameFrom_model")] - public class AccessCodePendingMutationsUpdatingNameFrom - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUpdatingNameFrom() { } - - public AccessCodePendingMutationsUpdatingNameFrom(string? name = default) - { - Name = name; - } - - /// - /// Previous access code name. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUpdatingNameTo_model")] - public class AccessCodePendingMutationsUpdatingNameTo - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUpdatingNameTo() { } - - public AccessCodePendingMutationsUpdatingNameTo(string? name = default) - { - Name = name; - } - - /// - /// New access code name. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUpdatingTimeFrame_model")] - public class AccessCodePendingMutationsUpdatingTimeFrame : AccessCodePendingMutations - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUpdatingTimeFrame() { } - - public AccessCodePendingMutationsUpdatingTimeFrame( - string createdAt = default, - AccessCodePendingMutationsUpdatingTimeFrameFrom from = default, - string message = default, - string mutationCode = default, - AccessCodePendingMutationsUpdatingTimeFrameTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous time frame configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AccessCodePendingMutationsUpdatingTimeFrameFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_time_frame"; - - /// - /// New time frame configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AccessCodePendingMutationsUpdatingTimeFrameTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUpdatingTimeFrameFrom_model")] - public class AccessCodePendingMutationsUpdatingTimeFrameFrom - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUpdatingTimeFrameFrom() { } - - public AccessCodePendingMutationsUpdatingTimeFrameFrom( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Previous end time for the access code. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Previous start time for the access code. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUpdatingTimeFrameTo_model")] - public class AccessCodePendingMutationsUpdatingTimeFrameTo - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUpdatingTimeFrameTo() { } - - public AccessCodePendingMutationsUpdatingTimeFrameTo( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// New end time for the access code. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// New start time for the access code. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodePendingMutationsUnrecognized_model")] - public class AccessCodePendingMutationsUnrecognized : AccessCodePendingMutations - { - [JsonConstructorAttribute] - protected AccessCodePendingMutationsUnrecognized() { } - - public AccessCodePendingMutationsUnrecognized( - string mutationCode = default, - string createdAt = default, - string message = default - ) - { - MutationCode = mutationCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "unrecognized"; - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Current status of the access code within the operational lifecycle. Values are `setting`, a transitional phase that indicates that the code is being configured or activated; `set`, which indicates that the code is active and operational; `unset`, which indicates a deactivated or unused state, either before activation or after deliberate deactivation; `removing`, which indicates a transitional period in which the code is being deleted or made inactive; and `unknown`, which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. See also [Lifecycle of Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/lifecycle-of-access-codes). - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "setting")] - Setting = 1, - - [EnumMember(Value = "set")] - Set = 2, - - [EnumMember(Value = "unset")] - Unset = 3, - - [EnumMember(Value = "removing")] - Removing = 4, - - [EnumMember(Value = "unknown")] - Unknown = 5, - } - - /// - /// Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum TypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "time_bound")] - TimeBound = 1, - - [EnumMember(Value = "ongoing")] - Ongoing = 2, - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(AccessCodeWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsUnknownIssueWithAccessCode), - "unknown_issue_with_access_code" - )] - [JsonSubtypes.KnownSubType(typeof(AccessCodeWarningsBeingDeleted), "being_deleted")] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsUsingBackupAccessCode), - "using_backup_access_code" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsManagementTransferred), - "management_transferred" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours), - "igloo_algopin_must_be_used_within_24_hours" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsThirdPartyIntegrationDetected), - "third_party_integration_detected" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsDelayInApplyingMutations), - "delay_in_applying_mutations" - )] - [JsonSubtypes.KnownSubType(typeof(AccessCodeWarningsDelayInIssuing), "delay_in_issuing")] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsDelayInRemovingFromDevice), - "delay_in_removing_from_device" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsDelayInSettingOnDevice), - "delay_in_setting_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsExternalModificationInEffect), - "external_modification_in_effect" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone), - "time_frame_adjusted_for_unknown_time_zone" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessCodeWarningsCodeRotatesPeriodically), - "code_rotates_periodically" - )] - public abstract class AccessCodeWarnings - { - public abstract string WarningCode { get; } - - public abstract string? CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_accessCodeWarningsCodeRotatesPeriodically_model")] - public class AccessCodeWarningsCodeRotatesPeriodically : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsCodeRotatesPeriodically() { } - - public AccessCodeWarningsCodeRotatesPeriodically( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "code_rotates_periodically"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_accessCodeWarningsTimeFrameAdjustedForUnknownTimeZone_model" - )] - public class AccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone() { } - - public AccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "time_frame_adjusted_for_unknown_time_zone"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsExternalModificationInEffect_model")] - public class AccessCodeWarningsExternalModificationInEffect : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsExternalModificationInEffect() { } - - public AccessCodeWarningsExternalModificationInEffect( - AccessCodeWarningsExternalModificationInEffect.ChangeTypeEnum? changeType = default, - string? createdAt = default, - string message = default, - List? modifiedFields = - default, - string warningCode = default - ) - { - ChangeType = changeType; - CreatedAt = createdAt; - Message = message; - ModifiedFields = modifiedFields; - WarningCode = warningCode; - } - - /// - /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ChangeTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "modified")] - Modified = 1, - - [EnumMember(Value = "removed")] - Removed = 2, - } - - /// - /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. - /// - [DataMember(Name = "change_type", IsRequired = false, EmitDefaultValue = false)] - public AccessCodeWarningsExternalModificationInEffect.ChangeTypeEnum? ChangeType { get; set; } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// List of fields that were changed externally, with their previous and new values. - /// - [DataMember(Name = "modified_fields", IsRequired = false, EmitDefaultValue = false)] - public List? ModifiedFields { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "external_modification_in_effect"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_accessCodeWarningsExternalModificationInEffectModifiedFields_model" - )] - public class AccessCodeWarningsExternalModificationInEffectModifiedFields - { - [JsonConstructorAttribute] - protected AccessCodeWarningsExternalModificationInEffectModifiedFields() { } - - public AccessCodeWarningsExternalModificationInEffectModifiedFields( - string field = default, - string? from = default, - string? to = default - ) - { - Field = field; - From = from; - To = to; - } - - /// - /// The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). - /// - [DataMember(Name = "field", IsRequired = false, EmitDefaultValue = false)] - public string Field { get; set; } - - /// - /// The previous value of the field. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public string? From { get; set; } - - /// - /// The new value of the field. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public string? To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsDelayInSettingOnDevice_model")] - public class AccessCodeWarningsDelayInSettingOnDevice : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsDelayInSettingOnDevice() { } - - public AccessCodeWarningsDelayInSettingOnDevice( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_setting_on_device"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsDelayInRemovingFromDevice_model")] - public class AccessCodeWarningsDelayInRemovingFromDevice : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsDelayInRemovingFromDevice() { } - - public AccessCodeWarningsDelayInRemovingFromDevice( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_removing_from_device"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsDelayInIssuing_model")] - public class AccessCodeWarningsDelayInIssuing : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsDelayInIssuing() { } - - public AccessCodeWarningsDelayInIssuing( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_issuing"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsDelayInApplyingMutations_model")] - public class AccessCodeWarningsDelayInApplyingMutations : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsDelayInApplyingMutations() { } - - public AccessCodeWarningsDelayInApplyingMutations( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_applying_mutations"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsThirdPartyIntegrationDetected_model")] - public class AccessCodeWarningsThirdPartyIntegrationDetected : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsThirdPartyIntegrationDetected() { } - - public AccessCodeWarningsThirdPartyIntegrationDetected( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "third_party_integration_detected"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_accessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours_model" - )] - public class AccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours() { } - - public AccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "igloo_algopin_must_be_used_within_24_hours"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsManagementTransferred_model")] - public class AccessCodeWarningsManagementTransferred : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsManagementTransferred() { } - - public AccessCodeWarningsManagementTransferred( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "management_transferred"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsUsingBackupAccessCode_model")] - public class AccessCodeWarningsUsingBackupAccessCode : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsUsingBackupAccessCode() { } - - public AccessCodeWarningsUsingBackupAccessCode( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "using_backup_access_code"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsBeingDeleted_model")] - public class AccessCodeWarningsBeingDeleted : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsBeingDeleted() { } - - public AccessCodeWarningsBeingDeleted( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsUnknownIssueWithAccessCode_model")] - public class AccessCodeWarningsUnknownIssueWithAccessCode : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsUnknownIssueWithAccessCode() { } - - public AccessCodeWarningsUnknownIssueWithAccessCode( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unknown_issue_with_access_code"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeWarningsUnrecognized_model")] - public class AccessCodeWarningsUnrecognized : AccessCodeWarnings - { - [JsonConstructorAttribute] - protected AccessCodeWarningsUnrecognized() { } - - public AccessCodeWarningsUnrecognized( - string warningCode = default, - string? createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Unique identifier for the access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Code used for access. Typically, a numeric or alphanumeric string. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Unique identifier for a group of access codes that share the same code. - /// - [DataMember(Name = "common_code_key", IsRequired = false, EmitDefaultValue = false)] - public string? CommonCodeKey { get; set; } - - /// - /// Date and time at which the access code was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier for the device associated with the access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Metadata for a dormakaba Oracode managed access code. Only present for access codes from dormakaba Oracode devices. - /// - [DataMember( - Name = "dormakaba_oracode_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public AccessCodeDormakabaOracodeMetadata? DormakabaOracodeMetadata { get; set; } - - /// - /// Date and time after which the time-bound access code becomes inactive. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Errors associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Indicates whether the access code is a backup code. - /// - [DataMember(Name = "is_backup", IsRequired = false, EmitDefaultValue = false)] - public bool? IsBackup { get; set; } - - /// - /// Indicates whether a backup access code is available for use if the primary access code is lost or compromised. - /// - [DataMember( - Name = "is_backup_access_code_available", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsBackupAccessCodeAvailable { get; set; } - - /// - /// Indicates whether changes to the access code from external sources are permitted. - /// - [DataMember( - Name = "is_external_modification_allowed", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsExternalModificationAllowed { get; set; } - - /// - /// Indicates whether Seam manages the access code. - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Indicates whether the access code is intended for use in offline scenarios. If `true`, this code can be created on a device without a network connection. - /// - [DataMember(Name = "is_offline_access_code", IsRequired = false, EmitDefaultValue = false)] - public bool IsOfflineAccessCode { get; set; } - - /// - /// Indicates whether the access code can only be used once. If `true`, the code becomes invalid after the first use. - /// - [DataMember(Name = "is_one_time_use", IsRequired = false, EmitDefaultValue = false)] - public bool IsOneTimeUse { get; set; } - - /// - /// Indicates whether the code is set on the device according to a preconfigured schedule. - /// - [DataMember(Name = "is_scheduled_on_device", IsRequired = false, EmitDefaultValue = false)] - public bool? IsScheduledOnDevice { get; set; } - - /// - /// Indicates whether the access code is waiting for a code assignment. - /// - [DataMember( - Name = "is_waiting_for_code_assignment", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsWaitingForCodeAssignment { get; set; } - - /// - /// Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Collection of pending mutations for the access code. Indicates changes that Seam is in the process of pushing to the device. - /// - [DataMember(Name = "pending_mutations", IsRequired = false, EmitDefaultValue = false)] - public List PendingMutations { get; set; } - - /// - /// Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code. - /// - [DataMember( - Name = "pulled_backup_access_code_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? PulledBackupAccessCodeId { get; set; } - - /// - /// Date and time at which the time-bound access code becomes active. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Current status of the access code within the operational lifecycle. Values are `setting`, a transitional phase that indicates that the code is being configured or activated; `set`, which indicates that the code is active and operational; `unset`, which indicates a deactivated or unused state, either before activation or after deliberate deactivation; `removing`, which indicates a transitional period in which the code is being deleted or made inactive; and `unknown`, which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. See also [Lifecycle of Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/lifecycle-of-access-codes). - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public AccessCode.StatusEnum Status { get; set; } - - /// - /// Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public AccessCode.TypeEnum Type { get; set; } - - /// - /// Warnings associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// Unique identifier for the Seam workspace associated with the access code. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessCodeDormakabaOracodeMetadata_model")] - public class AccessCodeDormakabaOracodeMetadata - { - [JsonConstructorAttribute] - protected AccessCodeDormakabaOracodeMetadata() { } - - public AccessCodeDormakabaOracodeMetadata( - bool? isCancellable = default, - bool? isEarlyCheckinAble = default, - bool? isExtendable = default, - bool? isOverridable = default, - string? siteName = default, - float? stayId = default, - string? userLevelId = default, - string? userLevelName = default - ) - { - IsCancellable = isCancellable; - IsEarlyCheckinAble = isEarlyCheckinAble; - IsExtendable = isExtendable; - IsOverridable = isOverridable; - SiteName = siteName; - StayId = stayId; - UserLevelId = userLevelId; - UserLevelName = userLevelName; - } - - /// - /// Indicates whether the stay can be cancelled via the Dormakaba Oracode API. - /// - [DataMember(Name = "is_cancellable", IsRequired = false, EmitDefaultValue = false)] - public bool? IsCancellable { get; set; } - - /// - /// Indicates whether early check-in is available for this stay. - /// - [DataMember(Name = "is_early_checkin_able", IsRequired = false, EmitDefaultValue = false)] - public bool? IsEarlyCheckinAble { get; set; } - - /// - /// Indicates whether the stay can be extended via the Dormakaba Oracode API. - /// - [DataMember(Name = "is_extendable", IsRequired = false, EmitDefaultValue = false)] - public bool? IsExtendable { get; set; } - - /// - /// Indicates whether the access code can be overridden. When false, the maximum number of overrides has been reached. - /// - [DataMember(Name = "is_overridable", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOverridable { get; set; } - - /// - /// Dormakaba Oracode site name associated with this access code. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - /// - /// Dormakaba Oracode stay ID associated with this access code. - /// - [DataMember(Name = "stay_id", IsRequired = false, EmitDefaultValue = false)] - public float? StayId { get; set; } - - /// - /// Dormakaba Oracode user level ID associated with this access code. - /// - [DataMember(Name = "user_level_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserLevelId { get; set; } - - /// - /// Dormakaba Oracode user level name associated with this access code. - /// - [DataMember(Name = "user_level_name", IsRequired = false, EmitDefaultValue = false)] - public string? UserLevelName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/AccessGrant.cs b/src/Seam/Model/AccessGrant.cs deleted file mode 100644 index 1e7409fb..00000000 --- a/src/Seam/Model/AccessGrant.cs +++ /dev/null @@ -1,1446 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an Access Grant. Access Grants enable you to grant a user identity access to spaces, entrances, and devices through one or more access methods, such as mobile keys, plastic cards, and PIN codes. You can create an Access Grant for an existing user identity, or you can create a new user identity *while* creating the new Access Grant. - /// - [DataContract(Name = "seamModel_accessGrant_model")] - public class AccessGrant - { - [JsonConstructorAttribute] - protected AccessGrant() { } - - public AccessGrant( - string accessGrantId = default, - string? accessGrantKey = default, - List accessMethodIds = default, - string? clientSessionToken = default, - string createdAt = default, - string? customizationProfileId = default, - string displayName = default, - string displayStatus = default, - string? endsAt = default, - List errors = default, - string? instantKeyUrl = default, - List locationIds = default, - string? name = default, - List pendingMutations = default, - List requestedAccessMethods = default, - string? reservationKey = default, - List spaceIds = default, - string startsAt = default, - string userIdentityId = default, - List warnings = default, - string workspaceId = default - ) - { - AccessGrantId = accessGrantId; - AccessGrantKey = accessGrantKey; - AccessMethodIds = accessMethodIds; - ClientSessionToken = clientSessionToken; - CreatedAt = createdAt; - CustomizationProfileId = customizationProfileId; - DisplayName = displayName; - DisplayStatus = displayStatus; - EndsAt = endsAt; - Errors = errors; - InstantKeyUrl = instantKeyUrl; - LocationIds = locationIds; - Name = name; - PendingMutations = pendingMutations; - RequestedAccessMethods = requestedAccessMethods; - ReservationKey = reservationKey; - SpaceIds = spaceIds; - StartsAt = startsAt; - UserIdentityId = userIdentityId; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(AccessGrantErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AccessGrantErrorsCannotCreateRequestedAccessMethods), - "cannot_create_requested_access_methods" - )] - public abstract class AccessGrantErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_accessGrantErrorsCannotCreateRequestedAccessMethods_model")] - public class AccessGrantErrorsCannotCreateRequestedAccessMethods : AccessGrantErrors - { - [JsonConstructorAttribute] - protected AccessGrantErrorsCannotCreateRequestedAccessMethods() { } - - public AccessGrantErrorsCannotCreateRequestedAccessMethods( - string createdAt = default, - string errorCode = default, - string message = default, - List? missingDeviceIds = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - MissingDeviceIds = missingDeviceIds; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "cannot_create_requested_access_methods"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// IDs of the devices that did not receive an access code at grant creation. Use these to identify which specific devices failed when the message reports a partial failure. - /// - [DataMember(Name = "missing_device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? MissingDeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantErrorsUnrecognized_model")] - public class AccessGrantErrorsUnrecognized : AccessGrantErrors - { - [JsonConstructorAttribute] - protected AccessGrantErrorsUnrecognized() { } - - public AccessGrantErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "mutation_code")] - [JsonSubtypes.FallBackSubType(typeof(AccessGrantPendingMutationsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AccessGrantPendingMutationsUpdatingAccessTimes), - "updating_access_times" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessGrantPendingMutationsUpdatingSpaces), - "updating_spaces" - )] - public abstract class AccessGrantPendingMutations - { - public abstract string MutationCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_accessGrantPendingMutationsUpdatingSpaces_model")] - public class AccessGrantPendingMutationsUpdatingSpaces : AccessGrantPendingMutations - { - [JsonConstructorAttribute] - protected AccessGrantPendingMutationsUpdatingSpaces() { } - - public AccessGrantPendingMutationsUpdatingSpaces( - string createdAt = default, - AccessGrantPendingMutationsUpdatingSpacesFrom from = default, - string message = default, - string mutationCode = default, - AccessGrantPendingMutationsUpdatingSpacesTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous location configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AccessGrantPendingMutationsUpdatingSpacesFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_spaces"; - - /// - /// New location configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AccessGrantPendingMutationsUpdatingSpacesTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantPendingMutationsUpdatingSpacesFrom_model")] - public class AccessGrantPendingMutationsUpdatingSpacesFrom - { - [JsonConstructorAttribute] - protected AccessGrantPendingMutationsUpdatingSpacesFrom() { } - - public AccessGrantPendingMutationsUpdatingSpacesFrom(List deviceIds = default) - { - DeviceIds = deviceIds; - } - - /// - /// Previous device IDs where access codes existed. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantPendingMutationsUpdatingSpacesTo_model")] - public class AccessGrantPendingMutationsUpdatingSpacesTo - { - [JsonConstructorAttribute] - protected AccessGrantPendingMutationsUpdatingSpacesTo() { } - - public AccessGrantPendingMutationsUpdatingSpacesTo( - string? commonCodeKey = default, - List deviceIds = default - ) - { - CommonCodeKey = commonCodeKey; - DeviceIds = deviceIds; - } - - /// - /// Common code key to ensure PIN code reuse across devices. - /// - [DataMember(Name = "common_code_key", IsRequired = false, EmitDefaultValue = false)] - public string? CommonCodeKey { get; set; } - - /// - /// New device IDs where access codes should be created. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantPendingMutationsUpdatingAccessTimes_model")] - public class AccessGrantPendingMutationsUpdatingAccessTimes : AccessGrantPendingMutations - { - [JsonConstructorAttribute] - protected AccessGrantPendingMutationsUpdatingAccessTimes() { } - - public AccessGrantPendingMutationsUpdatingAccessTimes( - List accessMethodIds = default, - string createdAt = default, - AccessGrantPendingMutationsUpdatingAccessTimesFrom from = default, - string message = default, - string mutationCode = default, - AccessGrantPendingMutationsUpdatingAccessTimesTo to = default - ) - { - AccessMethodIds = accessMethodIds; - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// IDs of the access methods being updated. - /// - [DataMember(Name = "access_method_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessMethodIds { get; set; } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous access time configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AccessGrantPendingMutationsUpdatingAccessTimesFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_access_times"; - - /// - /// New access time configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AccessGrantPendingMutationsUpdatingAccessTimesTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantPendingMutationsUpdatingAccessTimesFrom_model")] - public class AccessGrantPendingMutationsUpdatingAccessTimesFrom - { - [JsonConstructorAttribute] - protected AccessGrantPendingMutationsUpdatingAccessTimesFrom() { } - - public AccessGrantPendingMutationsUpdatingAccessTimesFrom( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Previous end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Previous start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantPendingMutationsUpdatingAccessTimesTo_model")] - public class AccessGrantPendingMutationsUpdatingAccessTimesTo - { - [JsonConstructorAttribute] - protected AccessGrantPendingMutationsUpdatingAccessTimesTo() { } - - public AccessGrantPendingMutationsUpdatingAccessTimesTo( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// New end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// New start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantPendingMutationsUnrecognized_model")] - public class AccessGrantPendingMutationsUnrecognized : AccessGrantPendingMutations - { - [JsonConstructorAttribute] - protected AccessGrantPendingMutationsUnrecognized() { } - - public AccessGrantPendingMutationsUnrecognized( - string mutationCode = default, - string createdAt = default, - string message = default - ) - { - MutationCode = mutationCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "unrecognized"; - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(AccessGrantWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AccessGrantWarningsDeviceTimeConstraintsViolated), - "device_time_constraints_violated" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessGrantWarningsDeviceDoesNotSupportAccessCodes), - "device_does_not_support_access_codes" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessGrantWarningsRequestedCodeUnavailable), - "requested_code_unavailable" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessGrantWarningsUpdatingAccessTimes), - "updating_access_times" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessGrantWarningsOverprovisionedAccess), - "overprovisioned_access" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessGrantWarningsUnderprovisionedAccess), - "underprovisioned_access" - )] - [JsonSubtypes.KnownSubType(typeof(AccessGrantWarningsBeingDeleted), "being_deleted")] - public abstract class AccessGrantWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_accessGrantWarningsBeingDeleted_model")] - public class AccessGrantWarningsBeingDeleted : AccessGrantWarnings - { - [JsonConstructorAttribute] - protected AccessGrantWarningsBeingDeleted() { } - - public AccessGrantWarningsBeingDeleted( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantWarningsUnderprovisionedAccess_model")] - public class AccessGrantWarningsUnderprovisionedAccess : AccessGrantWarnings - { - [JsonConstructorAttribute] - protected AccessGrantWarningsUnderprovisionedAccess() { } - - public AccessGrantWarningsUnderprovisionedAccess( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "underprovisioned_access"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantWarningsOverprovisionedAccess_model")] - public class AccessGrantWarningsOverprovisionedAccess : AccessGrantWarnings - { - [JsonConstructorAttribute] - protected AccessGrantWarningsOverprovisionedAccess() { } - - public AccessGrantWarningsOverprovisionedAccess( - string createdAt = default, - List? failedDevices = - default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - FailedDevices = failedDevices; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Devices whose access codes could not be revoked during reconciliation. Present when the provider does not support revoking an offline access code (e.g. Dormakaba oracode with exhausted override budget). - /// - [DataMember(Name = "failed_devices", IsRequired = false, EmitDefaultValue = false)] - public List? FailedDevices { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "overprovisioned_access"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_accessGrantWarningsOverprovisionedAccessFailedDevices_model" - )] - public class AccessGrantWarningsOverprovisionedAccessFailedDevices - { - [JsonConstructorAttribute] - protected AccessGrantWarningsOverprovisionedAccessFailedDevices() { } - - public AccessGrantWarningsOverprovisionedAccessFailedDevices( - string deviceId = default, - string errorCode = default, - string message = default - ) - { - DeviceId = deviceId; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Device whose access code could not be revoked. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`). - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Human-readable description of why revocation failed. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantWarningsUpdatingAccessTimes_model")] - public class AccessGrantWarningsUpdatingAccessTimes : AccessGrantWarnings - { - [JsonConstructorAttribute] - protected AccessGrantWarningsUpdatingAccessTimes() { } - - public AccessGrantWarningsUpdatingAccessTimes( - List accessMethodIds = default, - string createdAt = default, - string message = default, - string warningCode = default - ) - { - AccessMethodIds = accessMethodIds; - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// IDs of the access methods being updated. - /// - [DataMember(Name = "access_method_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessMethodIds { get; set; } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "updating_access_times"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantWarningsRequestedCodeUnavailable_model")] - public class AccessGrantWarningsRequestedCodeUnavailable : AccessGrantWarnings - { - [JsonConstructorAttribute] - protected AccessGrantWarningsRequestedCodeUnavailable() { } - - public AccessGrantWarningsRequestedCodeUnavailable( - string createdAt = default, - string deviceId = default, - string message = default, - string newCode = default, - string originalCode = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - DeviceId = deviceId; - Message = message; - NewCode = newCode; - OriginalCode = originalCode; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device where the requested code was unavailable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// The new PIN code that was assigned instead. - /// - [DataMember(Name = "new_code", IsRequired = false, EmitDefaultValue = false)] - public string NewCode { get; set; } - - /// - /// The originally requested PIN code that was unavailable. - /// - [DataMember(Name = "original_code", IsRequired = false, EmitDefaultValue = false)] - public string OriginalCode { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "requested_code_unavailable"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantWarningsDeviceDoesNotSupportAccessCodes_model")] - public class AccessGrantWarningsDeviceDoesNotSupportAccessCodes : AccessGrantWarnings - { - [JsonConstructorAttribute] - protected AccessGrantWarningsDeviceDoesNotSupportAccessCodes() { } - - public AccessGrantWarningsDeviceDoesNotSupportAccessCodes( - string createdAt = default, - string deviceId = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - DeviceId = deviceId; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device that does not support access codes. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "device_does_not_support_access_codes"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantWarningsDeviceTimeConstraintsViolated_model")] - public class AccessGrantWarningsDeviceTimeConstraintsViolated : AccessGrantWarnings - { - [JsonConstructorAttribute] - protected AccessGrantWarningsDeviceTimeConstraintsViolated() { } - - public AccessGrantWarningsDeviceTimeConstraintsViolated( - string createdAt = default, - string deviceId = default, - string message = default, - AccessGrantWarningsDeviceTimeConstraintsViolated.ReasonEnum reason = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - DeviceId = deviceId; - Message = message; - Reason = reason; - WarningCode = warningCode; - } - - /// - /// Specific reason why the grant's times are not programmable on the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ReasonEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "duration_exceeds_max")] - DurationExceedsMax = 1, - - [EnumMember(Value = "times_do_not_match_slots")] - TimesDoNotMatchSlots = 2, - - [EnumMember(Value = "ongoing_not_supported")] - OngoingNotSupported = 3, - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device whose time constraints the access grant violates. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// Specific reason why the grant's times are not programmable on the device. - /// - [DataMember(Name = "reason", IsRequired = false, EmitDefaultValue = false)] - public AccessGrantWarningsDeviceTimeConstraintsViolated.ReasonEnum Reason { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "device_time_constraints_violated"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantWarningsUnrecognized_model")] - public class AccessGrantWarningsUnrecognized : AccessGrantWarnings - { - [JsonConstructorAttribute] - protected AccessGrantWarningsUnrecognized() { } - - public AccessGrantWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// ID of the Access Grant. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// Unique key for the access grant within the workspace. - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// IDs of the access methods created for the Access Grant. - /// - [DataMember(Name = "access_method_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessMethodIds { get; set; } - - /// - /// Client Session Token. Only returned if the Access Grant has a mobile_key access method. - /// - [DataMember(Name = "client_session_token", IsRequired = false, EmitDefaultValue = false)] - public string? ClientSessionToken { get; set; } - - /// - /// Date and time at which the Access Grant was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// ID of the customization profile associated with the Access Grant. - /// - [DataMember( - Name = "customization_profile_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomizationProfileId { get; set; } - - /// - /// Display name of the Access Grant. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Human-readable sentence answering whether the user can currently get in, for example `Awaiting encoding` on an access method or `Upcoming` here. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read `starts_at`, `ends_at`, `errors`, and the access methods' own fields. - /// - [DataMember(Name = "display_status", IsRequired = false, EmitDefaultValue = false)] - public string DisplayStatus { get; set; } - - /// - /// Date and time at which the Access Grant ends. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Errors associated with the [access grant](https://docs.seam.co/use-cases/granting-access). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Instant Key URL. Only returned if the Access Grant has a single mobile_key access_method. - /// - [DataMember(Name = "instant_key_url", IsRequired = false, EmitDefaultValue = false)] - public string? InstantKeyUrl { get; set; } - - [Obsolete("Use `space_ids`.")] - [DataMember(Name = "location_ids", IsRequired = false, EmitDefaultValue = false)] - public List LocationIds { get; set; } - - /// - /// Name of the Access Grant. If not provided, the display name will be computed. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// List of pending mutations for the access grant. This shows updates that are in progress. - /// - [DataMember(Name = "pending_mutations", IsRequired = false, EmitDefaultValue = false)] - public List PendingMutations { get; set; } - - /// - /// Access methods that the user requested for the Access Grant. - /// - [DataMember( - Name = "requested_access_methods", - IsRequired = false, - EmitDefaultValue = false - )] - public List RequestedAccessMethods { get; set; } - - /// - /// Reservation key for the access grant. - /// - [DataMember(Name = "reservation_key", IsRequired = false, EmitDefaultValue = false)] - public string? ReservationKey { get; set; } - - /// - /// IDs of the spaces to which the Access Grant gives access. - /// - [DataMember(Name = "space_ids", IsRequired = false, EmitDefaultValue = false)] - public List SpaceIds { get; set; } - - /// - /// Date and time at which the Access Grant starts. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string StartsAt { get; set; } - - /// - /// ID of user identity to which the Access Grant gives access. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - /// - /// Warnings associated with the [access grant](https://docs.seam.co/use-cases/granting-access). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the Seam workspace associated with the Access Grant. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessGrantRequestedAccessMethods_model")] - public class AccessGrantRequestedAccessMethods - { - [JsonConstructorAttribute] - protected AccessGrantRequestedAccessMethods() { } - - public AccessGrantRequestedAccessMethods( - string? code = default, - List createdAccessMethodIds = default, - string createdAt = default, - string displayName = default, - int? instantKeyMaxUseCount = default, - AccessGrantRequestedAccessMethods.ModeEnum mode = default - ) - { - Code = code; - CreatedAccessMethodIds = createdAccessMethodIds; - CreatedAt = createdAt; - DisplayName = displayName; - InstantKeyMaxUseCount = instantKeyMaxUseCount; - Mode = mode; - } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// Specific PIN code to use for this access method. Only applicable when mode is 'code'. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// IDs of the access methods created for the requested access method. - /// - [DataMember( - Name = "created_access_method_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List CreatedAccessMethodIds { get; set; } - - /// - /// Date and time at which the requested access method was added to the Access Grant. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name of the access method. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Maximum number of times the instant key can be used. Only applicable when mode is 'mobile_key'. Defaults to 1 if not specified. - /// - [DataMember( - Name = "instant_key_max_use_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int? InstantKeyMaxUseCount { get; set; } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "mode", IsRequired = false, EmitDefaultValue = false)] - public AccessGrantRequestedAccessMethods.ModeEnum Mode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/AccessMethod.cs b/src/Seam/Model/AccessMethod.cs deleted file mode 100644 index f8635235..00000000 --- a/src/Seam/Model/AccessMethod.cs +++ /dev/null @@ -1,1162 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an access method for an Access Grant. Access methods describe the modes of access, such as PIN codes, plastic cards, and mobile keys. For a mobile key, the access method also stores the URL for the associated Instant Key. - /// - [DataContract(Name = "seamModel_accessMethod_model")] - public class AccessMethod - { - [JsonConstructorAttribute] - protected AccessMethod() { } - - public AccessMethod( - string accessMethodId = default, - string? clientSessionToken = default, - string? code = default, - string createdAt = default, - string? customizationProfileId = default, - string displayName = default, - string displayStatus = default, - List errors = default, - string? instantKeyUrl = default, - bool? isAssignmentRequired = default, - bool? isEncodingRequired = default, - bool isIssued = default, - bool? isReadyForAssignment = default, - bool? isReadyForEncoding = default, - string? issuedAt = default, - AccessMethod.ModeEnum mode = default, - List pendingMutations = default, - List warnings = default, - string workspaceId = default - ) - { - AccessMethodId = accessMethodId; - ClientSessionToken = clientSessionToken; - Code = code; - CreatedAt = createdAt; - CustomizationProfileId = customizationProfileId; - DisplayName = displayName; - DisplayStatus = displayStatus; - Errors = errors; - InstantKeyUrl = instantKeyUrl; - IsAssignmentRequired = isAssignmentRequired; - IsEncodingRequired = isEncodingRequired; - IsIssued = isIssued; - IsReadyForAssignment = isReadyForAssignment; - IsReadyForEncoding = isReadyForEncoding; - IssuedAt = issuedAt; - Mode = mode; - PendingMutations = pendingMutations; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(AccessMethodErrorsUnrecognized))] - [JsonSubtypes.KnownSubType(typeof(AccessMethodErrorsFailedToIssue), "failed_to_issue")] - public abstract class AccessMethodErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_accessMethodErrorsFailedToIssue_model")] - public class AccessMethodErrorsFailedToIssue : AccessMethodErrors - { - [JsonConstructorAttribute] - protected AccessMethodErrorsFailedToIssue() { } - - public AccessMethodErrorsFailedToIssue( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_issue"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodErrorsUnrecognized_model")] - public class AccessMethodErrorsUnrecognized : AccessMethodErrors - { - [JsonConstructorAttribute] - protected AccessMethodErrorsUnrecognized() { } - - public AccessMethodErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - [JsonConverter(typeof(JsonSubtypes), "mutation_code")] - [JsonSubtypes.FallBackSubType(typeof(AccessMethodPendingMutationsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AccessMethodPendingMutationsUpdatingAccessTimes), - "updating_access_times" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessMethodPendingMutationsRevokingAccess), - "revoking_access" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessMethodPendingMutationsProvisioningAccess), - "provisioning_access" - )] - public abstract class AccessMethodPendingMutations - { - public abstract string MutationCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsProvisioningAccess_model")] - public class AccessMethodPendingMutationsProvisioningAccess : AccessMethodPendingMutations - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsProvisioningAccess() { } - - public AccessMethodPendingMutationsProvisioningAccess( - string createdAt = default, - AccessMethodPendingMutationsProvisioningAccessFrom from = default, - string message = default, - string mutationCode = default, - AccessMethodPendingMutationsProvisioningAccessTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous device configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AccessMethodPendingMutationsProvisioningAccessFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "provisioning_access"; - - /// - /// New device configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AccessMethodPendingMutationsProvisioningAccessTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsProvisioningAccessFrom_model")] - public class AccessMethodPendingMutationsProvisioningAccessFrom - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsProvisioningAccessFrom() { } - - public AccessMethodPendingMutationsProvisioningAccessFrom( - List deviceIds = default - ) - { - DeviceIds = deviceIds; - } - - /// - /// Previous device IDs where access was provisioned. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsProvisioningAccessTo_model")] - public class AccessMethodPendingMutationsProvisioningAccessTo - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsProvisioningAccessTo() { } - - public AccessMethodPendingMutationsProvisioningAccessTo( - List deviceIds = default - ) - { - DeviceIds = deviceIds; - } - - /// - /// New device IDs where access is being provisioned. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsRevokingAccess_model")] - public class AccessMethodPendingMutationsRevokingAccess : AccessMethodPendingMutations - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsRevokingAccess() { } - - public AccessMethodPendingMutationsRevokingAccess( - string createdAt = default, - AccessMethodPendingMutationsRevokingAccessFrom from = default, - string message = default, - string mutationCode = default, - AccessMethodPendingMutationsRevokingAccessTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous device configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AccessMethodPendingMutationsRevokingAccessFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "revoking_access"; - - /// - /// New device configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AccessMethodPendingMutationsRevokingAccessTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsRevokingAccessFrom_model")] - public class AccessMethodPendingMutationsRevokingAccessFrom - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsRevokingAccessFrom() { } - - public AccessMethodPendingMutationsRevokingAccessFrom(List deviceIds = default) - { - DeviceIds = deviceIds; - } - - /// - /// Previous device IDs where access existed. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsRevokingAccessTo_model")] - public class AccessMethodPendingMutationsRevokingAccessTo - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsRevokingAccessTo() { } - - public AccessMethodPendingMutationsRevokingAccessTo(List deviceIds = default) - { - DeviceIds = deviceIds; - } - - /// - /// New device IDs where access should remain. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsUpdatingAccessTimes_model")] - public class AccessMethodPendingMutationsUpdatingAccessTimes : AccessMethodPendingMutations - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsUpdatingAccessTimes() { } - - public AccessMethodPendingMutationsUpdatingAccessTimes( - string createdAt = default, - AccessMethodPendingMutationsUpdatingAccessTimesFrom from = default, - string message = default, - string mutationCode = default, - AccessMethodPendingMutationsUpdatingAccessTimesTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous access time configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AccessMethodPendingMutationsUpdatingAccessTimesFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_access_times"; - - /// - /// New access time configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AccessMethodPendingMutationsUpdatingAccessTimesTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsUpdatingAccessTimesFrom_model")] - public class AccessMethodPendingMutationsUpdatingAccessTimesFrom - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsUpdatingAccessTimesFrom() { } - - public AccessMethodPendingMutationsUpdatingAccessTimesFrom( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Previous end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Previous start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsUpdatingAccessTimesTo_model")] - public class AccessMethodPendingMutationsUpdatingAccessTimesTo - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsUpdatingAccessTimesTo() { } - - public AccessMethodPendingMutationsUpdatingAccessTimesTo( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// New end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// New start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodPendingMutationsUnrecognized_model")] - public class AccessMethodPendingMutationsUnrecognized : AccessMethodPendingMutations - { - [JsonConstructorAttribute] - protected AccessMethodPendingMutationsUnrecognized() { } - - public AccessMethodPendingMutationsUnrecognized( - string mutationCode = default, - string createdAt = default, - string message = default - ) - { - MutationCode = mutationCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "unrecognized"; - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(AccessMethodWarningsUnrecognized))] - [JsonSubtypes.KnownSubType(typeof(AccessMethodWarningsDelayInIssuing), "delay_in_issuing")] - [JsonSubtypes.KnownSubType( - typeof(AccessMethodWarningsPulledBackupAccessCode), - "pulled_backup_access_code" - )] - [JsonSubtypes.KnownSubType( - typeof(AccessMethodWarningsUpdatingAccessTimes), - "updating_access_times" - )] - [JsonSubtypes.KnownSubType(typeof(AccessMethodWarningsBeingDeleted), "being_deleted")] - public abstract class AccessMethodWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_accessMethodWarningsBeingDeleted_model")] - public class AccessMethodWarningsBeingDeleted : AccessMethodWarnings - { - [JsonConstructorAttribute] - protected AccessMethodWarningsBeingDeleted() { } - - public AccessMethodWarningsBeingDeleted( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodWarningsUpdatingAccessTimes_model")] - public class AccessMethodWarningsUpdatingAccessTimes : AccessMethodWarnings - { - [JsonConstructorAttribute] - protected AccessMethodWarningsUpdatingAccessTimes() { } - - public AccessMethodWarningsUpdatingAccessTimes( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "updating_access_times"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodWarningsPulledBackupAccessCode_model")] - public class AccessMethodWarningsPulledBackupAccessCode : AccessMethodWarnings - { - [JsonConstructorAttribute] - protected AccessMethodWarningsPulledBackupAccessCode() { } - - public AccessMethodWarningsPulledBackupAccessCode( - string createdAt = default, - string message = default, - string? originalAccessMethodId = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - OriginalAccessMethodId = originalAccessMethodId; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// ID of the original access method from which this backup access method was split, if applicable. - /// - [DataMember( - Name = "original_access_method_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? OriginalAccessMethodId { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "pulled_backup_access_code"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodWarningsDelayInIssuing_model")] - public class AccessMethodWarningsDelayInIssuing : AccessMethodWarnings - { - [JsonConstructorAttribute] - protected AccessMethodWarningsDelayInIssuing() { } - - public AccessMethodWarningsDelayInIssuing( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_issuing"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_accessMethodWarningsUnrecognized_model")] - public class AccessMethodWarningsUnrecognized : AccessMethodWarnings - { - [JsonConstructorAttribute] - protected AccessMethodWarningsUnrecognized() { } - - public AccessMethodWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// ID of the access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// Token of the client session associated with the access method. - /// - [DataMember(Name = "client_session_token", IsRequired = false, EmitDefaultValue = false)] - public string? ClientSessionToken { get; set; } - - /// - /// The actual PIN code for code access methods. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Date and time at which the access method was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// ID of the customization profile associated with the access method. - /// - [DataMember( - Name = "customization_profile_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomizationProfileId { get; set; } - - /// - /// Display name of the access method. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Human-readable sentence describing where the access method sits in its relationship with the device or access system, for example `Awaiting encoding`. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read `is_issued`, `errors`, and `pending_mutations`. - /// - [DataMember(Name = "display_status", IsRequired = false, EmitDefaultValue = false)] - public string DisplayStatus { get; set; } - - /// - /// Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// URL of the Instant Key for mobile key access methods. - /// - [DataMember(Name = "instant_key_url", IsRequired = false, EmitDefaultValue = false)] - public string? InstantKeyUrl { get; set; } - - /// - /// Indicates whether an existing card credential must be assigned to this access method before it can be issued. Only applies to card-mode access methods on systems that support credential assignment. - /// - [DataMember(Name = "is_assignment_required", IsRequired = false, EmitDefaultValue = false)] - public bool? IsAssignmentRequired { get; set; } - - /// - /// Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method. - /// - [DataMember(Name = "is_encoding_required", IsRequired = false, EmitDefaultValue = false)] - public bool? IsEncodingRequired { get; set; } - - /// - /// Indicates whether the access method has been issued. - /// - [DataMember(Name = "is_issued", IsRequired = false, EmitDefaultValue = false)] - public bool IsIssued { get; set; } - - /// - /// Indicates whether the access method is ready for card assignment. This is true when the access method is in card mode, has not yet been issued, and the system supports credential assignment. - /// - [DataMember(Name = "is_ready_for_assignment", IsRequired = false, EmitDefaultValue = false)] - public bool? IsReadyForAssignment { get; set; } - - /// - /// Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. - /// - [DataMember(Name = "is_ready_for_encoding", IsRequired = false, EmitDefaultValue = false)] - public bool? IsReadyForEncoding { get; set; } - - /// - /// Date and time at which the access method was issued. - /// - [DataMember(Name = "issued_at", IsRequired = false, EmitDefaultValue = false)] - public string? IssuedAt { get; set; } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "mode", IsRequired = false, EmitDefaultValue = false)] - public AccessMethod.ModeEnum Mode { get; set; } - - /// - /// Pending mutations for the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). Indicates operations that are in progress. - /// - [DataMember(Name = "pending_mutations", IsRequired = false, EmitDefaultValue = false)] - public List PendingMutations { get; set; } - - /// - /// Warnings associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the Seam workspace associated with the access method. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/AcsAccessGroup.cs b/src/Seam/Model/AcsAccessGroup.cs deleted file mode 100644 index 3398e6e1..00000000 --- a/src/Seam/Model/AcsAccessGroup.cs +++ /dev/null @@ -1,1455 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Group that defines the entrances to which a set of users has access and, in some cases, the access schedule for these entrances and users. - /// - /// Some access control systems use [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups), which are sets of users, combined with sets of permissions. These permissions include both the set of areas or assets that the users can access and the schedule during which the users can access these areas or assets. Instead of assigning access rights individually to each access control system user, which can be time-consuming and error-prone, administrators can assign users to an access group, thereby ensuring that the users inherit all the permissions associated with the access group. Using access groups streamlines the process of managing large numbers of access control system users, especially in bigger organizations or complexes. - /// - /// To learn whether your access control system supports access groups, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). - /// - [DataContract(Name = "seamModel_acsAccessGroup_model")] - public class AcsAccessGroup - { - [JsonConstructorAttribute] - protected AcsAccessGroup() { } - - public AcsAccessGroup( - AcsAccessGroup.AccessGroupTypeEnum accessGroupType = default, - string accessGroupTypeDisplayName = default, - AcsAccessGroupAccessSchedule? accessSchedule = default, - string acsAccessGroupId = default, - string acsSystemId = default, - string connectedAccountId = default, - string createdAt = default, - string displayName = default, - List errors = default, - AcsAccessGroup.ExternalTypeEnum externalType = default, - string externalTypeDisplayName = default, - bool isManaged = default, - string name = default, - List pendingMutations = default, - List warnings = default, - string workspaceId = default - ) - { - AccessGroupType = accessGroupType; - AccessGroupTypeDisplayName = accessGroupTypeDisplayName; - AccessSchedule = accessSchedule; - AcsAccessGroupId = acsAccessGroupId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DisplayName = displayName; - Errors = errors; - ExternalType = externalType; - ExternalTypeDisplayName = externalTypeDisplayName; - IsManaged = isManaged; - Name = name; - PendingMutations = pendingMutations; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AccessGroupTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "pti_unit")] - PtiUnit = 1, - - [EnumMember(Value = "pti_access_level")] - PtiAccessLevel = 2, - - [EnumMember(Value = "salto_ks_access_group")] - SaltoKsAccessGroup = 3, - - [EnumMember(Value = "brivo_group")] - BrivoGroup = 4, - - [EnumMember(Value = "salto_space_group")] - SaltoSpaceGroup = 5, - - [EnumMember(Value = "dormakaba_community_access_group")] - DormakabaCommunityAccessGroup = 6, - - [EnumMember(Value = "dormakaba_ambiance_access_group")] - DormakabaAmbianceAccessGroup = 7, - - [EnumMember(Value = "avigilon_alta_group")] - AvigilonAltaGroup = 8, - - [EnumMember(Value = "kisi_access_group")] - KisiAccessGroup = 9, - - [EnumMember(Value = "akiles_member_group")] - AkilesMemberGroup = 10, - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(AcsAccessGroupErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AcsAccessGroupErrorsFailedToCreateOnAcsSystem), - "failed_to_create_on_acs_system" - )] - public abstract class AcsAccessGroupErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_acsAccessGroupErrorsFailedToCreateOnAcsSystem_model")] - public class AcsAccessGroupErrorsFailedToCreateOnAcsSystem : AcsAccessGroupErrors - { - [JsonConstructorAttribute] - protected AcsAccessGroupErrorsFailedToCreateOnAcsSystem() { } - - public AcsAccessGroupErrorsFailedToCreateOnAcsSystem( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_create_on_acs_system"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsAccessGroupErrorsUnrecognized_model")] - public class AcsAccessGroupErrorsUnrecognized : AcsAccessGroupErrors - { - [JsonConstructorAttribute] - protected AcsAccessGroupErrorsUnrecognized() { } - - public AcsAccessGroupErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Brand-specific terminology for the access group type. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExternalTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "pti_unit")] - PtiUnit = 1, - - [EnumMember(Value = "pti_access_level")] - PtiAccessLevel = 2, - - [EnumMember(Value = "salto_ks_access_group")] - SaltoKsAccessGroup = 3, - - [EnumMember(Value = "brivo_group")] - BrivoGroup = 4, - - [EnumMember(Value = "salto_space_group")] - SaltoSpaceGroup = 5, - - [EnumMember(Value = "dormakaba_community_access_group")] - DormakabaCommunityAccessGroup = 6, - - [EnumMember(Value = "dormakaba_ambiance_access_group")] - DormakabaAmbianceAccessGroup = 7, - - [EnumMember(Value = "avigilon_alta_group")] - AvigilonAltaGroup = 8, - - [EnumMember(Value = "kisi_access_group")] - KisiAccessGroup = 9, - - [EnumMember(Value = "akiles_member_group")] - AkilesMemberGroup = 10, - } - - [JsonConverter(typeof(JsonSubtypes), "mutation_code")] - [JsonSubtypes.FallBackSubType(typeof(AcsAccessGroupPendingMutationsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AcsAccessGroupPendingMutationsDeferringUserMembershipUpdate), - "deferring_user_membership_update" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsAccessGroupPendingMutationsUpdatingEntranceMembership), - "updating_entrance_membership" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsAccessGroupPendingMutationsUpdatingUserMembership), - "updating_user_membership" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsAccessGroupPendingMutationsUpdatingAccessSchedule), - "updating_access_schedule" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsAccessGroupPendingMutationsUpdatingGroupInformation), - "updating_group_information" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsAccessGroupPendingMutationsDeferringDeletion), - "deferring_deletion" - )] - [JsonSubtypes.KnownSubType(typeof(AcsAccessGroupPendingMutationsDeleting), "deleting")] - [JsonSubtypes.KnownSubType(typeof(AcsAccessGroupPendingMutationsCreating), "creating")] - public abstract class AcsAccessGroupPendingMutations - { - public abstract string MutationCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_acsAccessGroupPendingMutationsCreating_model")] - public class AcsAccessGroupPendingMutationsCreating : AcsAccessGroupPendingMutations - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsCreating() { } - - public AcsAccessGroupPendingMutationsCreating( - string createdAt = default, - string message = default, - string mutationCode = default - ) - { - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "creating"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsAccessGroupPendingMutationsDeleting_model")] - public class AcsAccessGroupPendingMutationsDeleting : AcsAccessGroupPendingMutations - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsDeleting() { } - - public AcsAccessGroupPendingMutationsDeleting( - string createdAt = default, - string message = default, - string mutationCode = default - ) - { - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "deleting"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsAccessGroupPendingMutationsDeferringDeletion_model")] - public class AcsAccessGroupPendingMutationsDeferringDeletion - : AcsAccessGroupPendingMutations - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsDeferringDeletion() { } - - public AcsAccessGroupPendingMutationsDeferringDeletion( - string createdAt = default, - string message = default, - string mutationCode = default - ) - { - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "deferring_deletion"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingGroupInformation_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingGroupInformation - : AcsAccessGroupPendingMutations - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingGroupInformation() { } - - public AcsAccessGroupPendingMutationsUpdatingGroupInformation( - string createdAt = default, - AcsAccessGroupPendingMutationsUpdatingGroupInformationFrom from = default, - string message = default, - string mutationCode = default, - AcsAccessGroupPendingMutationsUpdatingGroupInformationTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Old access group information. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupPendingMutationsUpdatingGroupInformationFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_group_information"; - - /// - /// New access group information. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupPendingMutationsUpdatingGroupInformationTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingGroupInformationFrom_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingGroupInformationFrom - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingGroupInformationFrom() { } - - public AcsAccessGroupPendingMutationsUpdatingGroupInformationFrom( - string? name = default - ) - { - Name = name; - } - - /// - /// Name of the access group. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingGroupInformationTo_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingGroupInformationTo - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingGroupInformationTo() { } - - public AcsAccessGroupPendingMutationsUpdatingGroupInformationTo(string? name = default) - { - Name = name; - } - - /// - /// Name of the access group. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingAccessSchedule_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingAccessSchedule - : AcsAccessGroupPendingMutations - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingAccessSchedule() { } - - public AcsAccessGroupPendingMutationsUpdatingAccessSchedule( - string createdAt = default, - AcsAccessGroupPendingMutationsUpdatingAccessScheduleFrom from = default, - string message = default, - string mutationCode = default, - AcsAccessGroupPendingMutationsUpdatingAccessScheduleTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Old access schedule information. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupPendingMutationsUpdatingAccessScheduleFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_access_schedule"; - - /// - /// New access schedule information. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupPendingMutationsUpdatingAccessScheduleTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingAccessScheduleFrom_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingAccessScheduleFrom - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingAccessScheduleFrom() { } - - public AcsAccessGroupPendingMutationsUpdatingAccessScheduleFrom( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Ending time for the access schedule. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Starting time for the access schedule. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingAccessScheduleTo_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingAccessScheduleTo - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingAccessScheduleTo() { } - - public AcsAccessGroupPendingMutationsUpdatingAccessScheduleTo( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Ending time for the access schedule. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Starting time for the access schedule. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingUserMembership_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingUserMembership - : AcsAccessGroupPendingMutations - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingUserMembership() { } - - public AcsAccessGroupPendingMutationsUpdatingUserMembership( - string createdAt = default, - AcsAccessGroupPendingMutationsUpdatingUserMembershipFrom from = default, - string message = default, - string mutationCode = default, - AcsAccessGroupPendingMutationsUpdatingUserMembershipTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Old user membership. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupPendingMutationsUpdatingUserMembershipFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_user_membership"; - - /// - /// New user membership. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupPendingMutationsUpdatingUserMembershipTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingUserMembershipFrom_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingUserMembershipFrom - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingUserMembershipFrom() { } - - public AcsAccessGroupPendingMutationsUpdatingUserMembershipFrom( - string? acsUserId = default - ) - { - AcsUserId = acsUserId; - } - - /// - /// Old user ID. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingUserMembershipTo_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingUserMembershipTo - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingUserMembershipTo() { } - - public AcsAccessGroupPendingMutationsUpdatingUserMembershipTo( - string? acsUserId = default - ) - { - AcsUserId = acsUserId; - } - - /// - /// New user ID. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingEntranceMembership_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingEntranceMembership - : AcsAccessGroupPendingMutations - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingEntranceMembership() { } - - public AcsAccessGroupPendingMutationsUpdatingEntranceMembership( - string createdAt = default, - AcsAccessGroupPendingMutationsUpdatingEntranceMembershipFrom from = default, - string message = default, - string mutationCode = default, - AcsAccessGroupPendingMutationsUpdatingEntranceMembershipTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Old entrance membership. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupPendingMutationsUpdatingEntranceMembershipFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_entrance_membership"; - - /// - /// New entrance membership. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupPendingMutationsUpdatingEntranceMembershipTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingEntranceMembershipFrom_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingEntranceMembershipFrom - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingEntranceMembershipFrom() { } - - public AcsAccessGroupPendingMutationsUpdatingEntranceMembershipFrom( - string? acsEntranceId = default - ) - { - AcsEntranceId = acsEntranceId; - } - - /// - /// Old entrance ID. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsEntranceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsUpdatingEntranceMembershipTo_model" - )] - public class AcsAccessGroupPendingMutationsUpdatingEntranceMembershipTo - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUpdatingEntranceMembershipTo() { } - - public AcsAccessGroupPendingMutationsUpdatingEntranceMembershipTo( - string? acsEntranceId = default - ) - { - AcsEntranceId = acsEntranceId; - } - - /// - /// New entrance ID. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsEntranceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsAccessGroupPendingMutationsDeferringUserMembershipUpdate_model" - )] - public class AcsAccessGroupPendingMutationsDeferringUserMembershipUpdate - : AcsAccessGroupPendingMutations - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsDeferringUserMembershipUpdate() { } - - public AcsAccessGroupPendingMutationsDeferringUserMembershipUpdate( - string acsUserId = default, - string createdAt = default, - string message = default, - string mutationCode = default, - AcsAccessGroupPendingMutationsDeferringUserMembershipUpdate.VariantEnum variant = - default - ) - { - AcsUserId = acsUserId; - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - Variant = variant; - } - - /// - /// Whether the user is scheduled to be added to or removed from this access group. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum VariantEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "adding")] - Adding = 1, - - [EnumMember(Value = "removing")] - Removing = 2, - } - - /// - /// ID of the user involved in the scheduled change. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsUserId { get; set; } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "deferring_user_membership_update"; - - /// - /// Whether the user is scheduled to be added to or removed from this access group. - /// - [DataMember(Name = "variant", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupPendingMutationsDeferringUserMembershipUpdate.VariantEnum Variant { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsAccessGroupPendingMutationsUnrecognized_model")] - public class AcsAccessGroupPendingMutationsUnrecognized : AcsAccessGroupPendingMutations - { - [JsonConstructorAttribute] - protected AcsAccessGroupPendingMutationsUnrecognized() { } - - public AcsAccessGroupPendingMutationsUnrecognized( - string mutationCode = default, - string createdAt = default, - string message = default - ) - { - MutationCode = mutationCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "unrecognized"; - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [Obsolete("Use `external_type`.")] - [DataMember(Name = "access_group_type", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroup.AccessGroupTypeEnum AccessGroupType { get; set; } - - [Obsolete("Use `external_type_display_name`.")] - [DataMember( - Name = "access_group_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string AccessGroupTypeDisplayName { get; set; } - - /// - /// `starts_at` and `ends_at` timestamps for the access group's access. - /// - [DataMember(Name = "access_schedule", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupAccessSchedule? AccessSchedule { get; set; } - - /// - /// ID of the access group. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - /// - /// ID of the access control system that contains the access group. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account that contains the access group. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the access group was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name for the access group. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Errors associated with the `acs_access_group`. - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Brand-specific terminology for the access group type. - /// - [DataMember(Name = "external_type", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroup.ExternalTypeEnum ExternalType { get; set; } - - /// - /// Display name that corresponds to the brand-specific terminology for the access group type. - /// - [DataMember( - Name = "external_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string ExternalTypeDisplayName { get; set; } - - /// - /// Indicates whether Seam manages the access group. - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Name of the access group. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Collection of pending mutations for the access group. Represents operations that have been requested but not yet completed on the integrated access system. - /// - [DataMember(Name = "pending_mutations", IsRequired = false, EmitDefaultValue = false)] - public List PendingMutations { get; set; } - - /// - /// Warnings associated with the `acs_access_group`. - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the access group. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsAccessGroupAccessSchedule_model")] - public class AcsAccessGroupAccessSchedule - { - [JsonConstructorAttribute] - protected AcsAccessGroupAccessSchedule() { } - - public AcsAccessGroupAccessSchedule(string? endsAt = default, string startsAt = default) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsAccessGroupWarnings_model")] - public class AcsAccessGroupWarnings - { - [JsonConstructorAttribute] - protected AcsAccessGroupWarnings() { } - - public AcsAccessGroupWarnings( - string createdAt = default, - string message = default, - AcsAccessGroupWarnings.WarningCodeEnum warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum WarningCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "unknown_issue_with_acs_access_group")] - UnknownIssueWithAcsAccessGroup = 1, - - [EnumMember(Value = "being_deleted")] - BeingDeleted = 2, - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public AcsAccessGroupWarnings.WarningCodeEnum WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/AcsCredential.cs b/src/Seam/Model/AcsCredential.cs deleted file mode 100644 index 6d821eb1..00000000 --- a/src/Seam/Model/AcsCredential.cs +++ /dev/null @@ -1,1134 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Means by which an [access control system user](https://docs.seam.co/low-level-apis/access-systems/user-management) gains access at an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). The `acs_credential` object represents a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) that provides an ACS user access within an [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - /// An access control system generally uses digital means of access to authorize a user trying to get through a specific entrance. Examples of credentials include plastic key cards, mobile keys, biometric identifiers, and PIN codes. The electronic nature of these credentials, as well as the fact that access is centralized, enables both the rapid provisioning and rescinding of access and the ability to compile access audit logs. - /// - /// For each `acs_credential`, you define the access method. You can also specify additional properties, such as a PIN code, depending on the credential type. - /// - /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach. Use the lower-level ACS credential API directly only when you specifically need to manage individual credentials. - /// - [DataContract(Name = "seamModel_acsCredential_model")] - public class AcsCredential - { - [JsonConstructorAttribute] - protected AcsCredential() { } - - public AcsCredential( - AcsCredential.AccessMethodEnum accessMethod = default, - string acsCredentialId = default, - string? acsCredentialPoolId = default, - string acsSystemId = default, - string? acsUserId = default, - AcsCredentialAkilesMetadata? akilesMetadata = default, - AcsCredentialAssaAbloyVostioMetadata? assaAbloyVostioMetadata = default, - string? cardNumber = default, - string? code = default, - string connectedAccountId = default, - string createdAt = default, - string displayName = default, - string? endsAt = default, - List errors = default, - AcsCredential.ExternalTypeEnum? externalType = default, - string? externalTypeDisplayName = default, - bool? isIssued = default, - bool? isLatestDesiredStateSyncedWithProvider = default, - bool isManaged = default, - bool? isMultiPhoneSyncCredential = default, - bool? isOneTimeUse = default, - string? issuedAt = default, - string? latestDesiredStateSyncedWithProviderAt = default, - string? parentAcsCredentialId = default, - string? startsAt = default, - string? userIdentityId = default, - AcsCredentialVisionlineMetadata? visionlineMetadata = default, - List warnings = default, - string workspaceId = default - ) - { - AccessMethod = accessMethod; - AcsCredentialId = acsCredentialId; - AcsCredentialPoolId = acsCredentialPoolId; - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - AkilesMetadata = akilesMetadata; - AssaAbloyVostioMetadata = assaAbloyVostioMetadata; - CardNumber = cardNumber; - Code = code; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DisplayName = displayName; - EndsAt = endsAt; - Errors = errors; - ExternalType = externalType; - ExternalTypeDisplayName = externalTypeDisplayName; - IsIssued = isIssued; - IsLatestDesiredStateSyncedWithProvider = isLatestDesiredStateSyncedWithProvider; - IsManaged = isManaged; - IsMultiPhoneSyncCredential = isMultiPhoneSyncCredential; - IsOneTimeUse = isOneTimeUse; - IssuedAt = issuedAt; - LatestDesiredStateSyncedWithProviderAt = latestDesiredStateSyncedWithProviderAt; - ParentAcsCredentialId = parentAcsCredentialId; - StartsAt = startsAt; - UserIdentityId = userIdentityId; - VisionlineMetadata = visionlineMetadata; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - /// - /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AccessMethodEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExternalTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "pti_card")] - PtiCard = 1, - - [EnumMember(Value = "brivo_credential")] - BrivoCredential = 2, - - [EnumMember(Value = "hid_credential")] - HidCredential = 3, - - [EnumMember(Value = "visionline_card")] - VisionlineCard = 4, - - [EnumMember(Value = "salto_ks_credential")] - SaltoKsCredential = 5, - - [EnumMember(Value = "assa_abloy_vostio_key")] - AssaAbloyVostioKey = 6, - - [EnumMember(Value = "salto_space_key")] - SaltoSpaceKey = 7, - - [EnumMember(Value = "latch_access")] - LatchAccess = 8, - - [EnumMember(Value = "dormakaba_ambiance_credential")] - DormakabaAmbianceCredential = 9, - - [EnumMember(Value = "hotek_card")] - HotekCard = 10, - - [EnumMember(Value = "salto_ks_tag")] - SaltoKsTag = 11, - - [EnumMember(Value = "avigilon_alta_credential")] - AvigilonAltaCredential = 12, - - [EnumMember(Value = "kisi_credential")] - KisiCredential = 13, - - [EnumMember(Value = "akiles_credential")] - AkilesCredential = 14, - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(AcsCredentialWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AcsCredentialWarningsRequestedCodeUnavailable), - "requested_code_unavailable" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsCredentialWarningsNeedsToBeReissued), - "needs_to_be_reissued" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsCredentialWarningsUnknownIssueWithAcsCredential), - "unknown_issue_with_acs_credential" - )] - [JsonSubtypes.KnownSubType(typeof(AcsCredentialWarningsBeingDeleted), "being_deleted")] - [JsonSubtypes.KnownSubType( - typeof(AcsCredentialWarningsScheduleModified), - "schedule_modified" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsCredentialWarningsScheduleExternallyModified), - "schedule_externally_modified" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsCredentialWarningsWaitingToBeIssued), - "waiting_to_be_issued" - )] - public abstract class AcsCredentialWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_acsCredentialWarningsWaitingToBeIssued_model")] - public class AcsCredentialWarningsWaitingToBeIssued : AcsCredentialWarnings - { - [JsonConstructorAttribute] - protected AcsCredentialWarningsWaitingToBeIssued() { } - - public AcsCredentialWarningsWaitingToBeIssued( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "waiting_to_be_issued"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialWarningsScheduleExternallyModified_model")] - public class AcsCredentialWarningsScheduleExternallyModified : AcsCredentialWarnings - { - [JsonConstructorAttribute] - protected AcsCredentialWarningsScheduleExternallyModified() { } - - public AcsCredentialWarningsScheduleExternallyModified( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "schedule_externally_modified"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialWarningsScheduleModified_model")] - public class AcsCredentialWarningsScheduleModified : AcsCredentialWarnings - { - [JsonConstructorAttribute] - protected AcsCredentialWarningsScheduleModified() { } - - public AcsCredentialWarningsScheduleModified( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "schedule_modified"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialWarningsBeingDeleted_model")] - public class AcsCredentialWarningsBeingDeleted : AcsCredentialWarnings - { - [JsonConstructorAttribute] - protected AcsCredentialWarningsBeingDeleted() { } - - public AcsCredentialWarningsBeingDeleted( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialWarningsUnknownIssueWithAcsCredential_model")] - public class AcsCredentialWarningsUnknownIssueWithAcsCredential : AcsCredentialWarnings - { - [JsonConstructorAttribute] - protected AcsCredentialWarningsUnknownIssueWithAcsCredential() { } - - public AcsCredentialWarningsUnknownIssueWithAcsCredential( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unknown_issue_with_acs_credential"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialWarningsNeedsToBeReissued_model")] - public class AcsCredentialWarningsNeedsToBeReissued : AcsCredentialWarnings - { - [JsonConstructorAttribute] - protected AcsCredentialWarningsNeedsToBeReissued() { } - - public AcsCredentialWarningsNeedsToBeReissued( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "needs_to_be_reissued"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialWarningsRequestedCodeUnavailable_model")] - public class AcsCredentialWarningsRequestedCodeUnavailable : AcsCredentialWarnings - { - [JsonConstructorAttribute] - protected AcsCredentialWarningsRequestedCodeUnavailable() { } - - public AcsCredentialWarningsRequestedCodeUnavailable( - string createdAt = default, - string message = default, - string newCode = default, - string originalCode = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - NewCode = newCode; - OriginalCode = originalCode; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// The PIN code that was assigned instead. - /// - [DataMember(Name = "new_code", IsRequired = false, EmitDefaultValue = false)] - public string NewCode { get; set; } - - /// - /// The originally requested PIN code that could not be used. - /// - [DataMember(Name = "original_code", IsRequired = false, EmitDefaultValue = false)] - public string OriginalCode { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "requested_code_unavailable"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialWarningsUnrecognized_model")] - public class AcsCredentialWarningsUnrecognized : AcsCredentialWarnings - { - [JsonConstructorAttribute] - protected AcsCredentialWarningsUnrecognized() { } - - public AcsCredentialWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "access_method", IsRequired = false, EmitDefaultValue = false)] - public AcsCredential.AccessMethodEnum AccessMethod { get; set; } - - /// - /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the credential pool to which the credential belongs. - /// - [DataMember(Name = "acs_credential_pool_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialPoolId { get; set; } - - /// - /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// Akiles-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "akiles_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsCredentialAkilesMetadata? AkilesMetadata { get; set; } - - /// - /// Vostio-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember( - Name = "assa_abloy_vostio_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public AcsCredentialAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; set; } - - /// - /// Number of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "card_number", IsRequired = false, EmitDefaultValue = false)] - public string? CardNumber { get; set; } - - /// - /// Access (PIN) code for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// ID of the [connected account](https://docs.seam.co/core-concepts/connected-accounts) to which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name that corresponds to the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Errors associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. - /// - [DataMember(Name = "external_type", IsRequired = false, EmitDefaultValue = false)] - public AcsCredential.ExternalTypeEnum? ExternalType { get; set; } - - /// - /// Display name that corresponds to the brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. - /// - [DataMember( - Name = "external_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ExternalTypeDisplayName { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been encoded onto a card. - /// - [DataMember(Name = "is_issued", IsRequired = false, EmitDefaultValue = false)] - public bool? IsIssued { get; set; } - - /// - /// Indicates whether the latest state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been synced from Seam to the provider. - /// - [DataMember( - Name = "is_latest_desired_state_synced_with_provider", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsLatestDesiredStateSyncedWithProvider { get; set; } - - /// - /// Indicates whether Seam manages the credential. - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). - /// - [DataMember( - Name = "is_multi_phone_sync_credential", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsMultiPhoneSyncCredential { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) can only be used once. If `true`, the code becomes invalid after the first use. - /// - [DataMember(Name = "is_one_time_use", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOneTimeUse { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was encoded onto a card. - /// - [DataMember(Name = "issued_at", IsRequired = false, EmitDefaultValue = false)] - public string? IssuedAt { get; set; } - - /// - /// Date and time at which the state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was most recently synced from Seam to the provider. - /// - [DataMember( - Name = "latest_desired_state_synced_with_provider_at", - IsRequired = false, - EmitDefaultValue = false - )] - public string? LatestDesiredStateSyncedWithProviderAt { get; set; } - - /// - /// ID of the parent [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember( - Name = "parent_acs_credential_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ParentAcsCredentialId { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// ID of the [user identity](https://docs.seam.co/api/user_identities) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "visionline_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsCredentialVisionlineMetadata? VisionlineMetadata { get; set; } - - /// - /// Warnings associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialAkilesMetadata_model")] - public class AcsCredentialAkilesMetadata - { - [JsonConstructorAttribute] - protected AcsCredentialAkilesMetadata() { } - - public AcsCredentialAkilesMetadata(string? memberPinId = default) - { - MemberPinId = memberPinId; - } - - /// - /// ID of the Akiles member PIN. - /// - [DataMember(Name = "member_pin_id", IsRequired = false, EmitDefaultValue = false)] - public string? MemberPinId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialAssaAbloyVostioMetadata_model")] - public class AcsCredentialAssaAbloyVostioMetadata - { - [JsonConstructorAttribute] - protected AcsCredentialAssaAbloyVostioMetadata() { } - - public AcsCredentialAssaAbloyVostioMetadata( - bool? autoJoin = default, - List? doorNames = default, - string? endpointId = default, - string? keyId = default, - string? keyIssuingRequestId = default, - List? overrideGuestAcsEntranceIds = default - ) - { - AutoJoin = autoJoin; - DoorNames = doorNames; - EndpointId = endpointId; - KeyId = keyId; - KeyIssuingRequestId = keyIssuingRequestId; - OverrideGuestAcsEntranceIds = overrideGuestAcsEntranceIds; - } - - /// - /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. - /// - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - /// - /// Names of the doors to which to grant access in the Vostio access system. - /// - [DataMember(Name = "door_names", IsRequired = false, EmitDefaultValue = false)] - public List? DoorNames { get; set; } - - /// - /// Endpoint ID in the Vostio access system. - /// - [DataMember(Name = "endpoint_id", IsRequired = false, EmitDefaultValue = false)] - public string? EndpointId { get; set; } - - /// - /// Key ID in the Vostio access system. - /// - [DataMember(Name = "key_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeyId { get; set; } - - /// - /// Key issuing request ID in the Vostio access system. - /// - [DataMember(Name = "key_issuing_request_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeyIssuingRequestId { get; set; } - - /// - /// IDs of the guest entrances to override in the Vostio access system. - /// - [DataMember( - Name = "override_guest_acs_entrance_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? OverrideGuestAcsEntranceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialErrors_model")] - public class AcsCredentialErrors - { - [JsonConstructorAttribute] - protected AcsCredentialErrors() { } - - public AcsCredentialErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsCredentialVisionlineMetadata_model")] - public class AcsCredentialVisionlineMetadata - { - [JsonConstructorAttribute] - protected AcsCredentialVisionlineMetadata() { } - - public AcsCredentialVisionlineMetadata( - bool? autoJoin = default, - AcsCredentialVisionlineMetadata.CardFunctionTypeEnum? cardFunctionType = default, - string? cardId = default, - List? commonAcsEntranceIds = default, - string? credentialId = default, - List? guestAcsEntranceIds = default, - bool? isValid = default, - List? joinerAcsCredentialIds = default - ) - { - AutoJoin = autoJoin; - CardFunctionType = cardFunctionType; - CardId = cardId; - CommonAcsEntranceIds = commonAcsEntranceIds; - CredentialId = credentialId; - GuestAcsEntranceIds = guestAcsEntranceIds; - IsValid = isValid; - JoinerAcsCredentialIds = joinerAcsCredentialIds; - } - - /// - /// Card function type in the Visionline access system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum CardFunctionTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "guest")] - Guest = 1, - - [EnumMember(Value = "staff")] - Staff = 2, - } - - /// - /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. - /// - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - /// - /// Card function type in the Visionline access system. - /// - [DataMember(Name = "card_function_type", IsRequired = false, EmitDefaultValue = false)] - public AcsCredentialVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; set; } - - /// - /// ID of the card in the Visionline access system. - /// - [DataMember(Name = "card_id", IsRequired = false, EmitDefaultValue = false)] - public string? CardId { get; set; } - - /// - /// Common entrance IDs in the Visionline access system. - /// - [DataMember(Name = "common_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAcsEntranceIds { get; set; } - - /// - /// ID of the credential in the Visionline access system. - /// - [DataMember(Name = "credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? CredentialId { get; set; } - - /// - /// Guest entrance IDs in the Visionline access system. - /// - [DataMember(Name = "guest_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? GuestAcsEntranceIds { get; set; } - - /// - /// Indicates whether the credential is valid. - /// - [DataMember(Name = "is_valid", IsRequired = false, EmitDefaultValue = false)] - public bool? IsValid { get; set; } - - /// - /// IDs of the credentials to which you want to join. - /// - [DataMember( - Name = "joiner_acs_credential_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? JoinerAcsCredentialIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/AcsEncoder.cs b/src/Seam/Model/AcsEncoder.cs deleted file mode 100644 index 196d35b7..00000000 --- a/src/Seam/Model/AcsEncoder.cs +++ /dev/null @@ -1,181 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a hardware device that encodes [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) data onto physical cards within an [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - /// Some access control systems require credentials to be encoded onto plastic key cards using a card encoder. This process involves the following two key steps: - /// - /// 1. Credential creation - /// Configure the access parameters for the credential. - /// 2. Card encoding - /// Write the credential data onto the card using a compatible card encoder. - /// - /// Separately, the Seam API also supports card scanning, which enables you to scan and read the encoded data on a card. You can use this action to confirm consistency with access control system records or diagnose discrepancies if needed. - /// - /// See [Working with Card Encoders and Scanners](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - /// To verify if your access control system requires a card encoder, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). - /// - [DataContract(Name = "seamModel_acsEncoder_model")] - public class AcsEncoder - { - [JsonConstructorAttribute] - protected AcsEncoder() { } - - public AcsEncoder( - string acsEncoderId = default, - string acsSystemId = default, - string connectedAccountId = default, - string createdAt = default, - string displayName = default, - List errors = default, - string workspaceId = default - ) - { - AcsEncoderId = acsEncoderId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DisplayName = displayName; - Errors = errors; - WorkspaceId = workspaceId; - } - - /// - /// ID of the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - [DataMember(Name = "acs_encoder_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - /// - /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account that contains the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name for the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Errors associated with the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// ID of the workspace that contains the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEncoderErrors_model")] - public class AcsEncoderErrors - { - [JsonConstructorAttribute] - protected AcsEncoderErrors() { } - - public AcsEncoderErrors( - string createdAt = default, - AcsEncoderErrors.ErrorCodeEnum errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ErrorCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "acs_encoder_removed")] - AcsEncoderRemoved = 1, - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public AcsEncoderErrors.ErrorCodeEnum ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/AcsEntrance.cs b/src/Seam/Model/AcsEntrance.cs deleted file mode 100644 index 26ce81fd..00000000 --- a/src/Seam/Model/AcsEntrance.cs +++ /dev/null @@ -1,1538 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) within an [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - /// In an access control system, an entrance is a secured door, gate, zone, or other method of entry. You can list details for all the `acs_entrance` resources in your workspace or get these details for a specific `acs_entrance`. You can also list all entrances associated with a specific credential, and you can list all credentials associated with a specific entrance. - /// - [DataContract(Name = "seamModel_acsEntrance_model")] - public class AcsEntrance - { - [JsonConstructorAttribute] - protected AcsEntrance() { } - - public AcsEntrance( - string acsEntranceId = default, - string acsSystemId = default, - AcsEntranceAkilesMetadata? akilesMetadata = default, - AcsEntranceAssaAbloyVostioMetadata? assaAbloyVostioMetadata = default, - AcsEntranceAvigilonAltaMetadata? avigilonAltaMetadata = default, - AcsEntranceBrivoMetadata? brivoMetadata = default, - bool? canBelongToReservation = default, - bool? canUnlockWithCard = default, - bool? canUnlockWithCloudKey = default, - bool? canUnlockWithCode = default, - bool? canUnlockWithMobileKey = default, - string connectedAccountId = default, - string createdAt = default, - string displayName = default, - AcsEntranceDormakabaAmbianceMetadata? dormakabaAmbianceMetadata = default, - AcsEntranceDormakabaCommunityMetadata? dormakabaCommunityMetadata = default, - List errors = default, - AcsEntranceHotekMetadata? hotekMetadata = default, - bool? isLocked = default, - AcsEntranceLatchMetadata? latchMetadata = default, - AcsEntranceSaltoKsMetadata? saltoKsMetadata = default, - AcsEntranceSaltoSpaceMetadata? saltoSpaceMetadata = default, - List spaceIds = default, - AcsEntranceVisionlineMetadata? visionlineMetadata = default, - List warnings = default - ) - { - AcsEntranceId = acsEntranceId; - AcsSystemId = acsSystemId; - AkilesMetadata = akilesMetadata; - AssaAbloyVostioMetadata = assaAbloyVostioMetadata; - AvigilonAltaMetadata = avigilonAltaMetadata; - BrivoMetadata = brivoMetadata; - CanBelongToReservation = canBelongToReservation; - CanUnlockWithCard = canUnlockWithCard; - CanUnlockWithCloudKey = canUnlockWithCloudKey; - CanUnlockWithCode = canUnlockWithCode; - CanUnlockWithMobileKey = canUnlockWithMobileKey; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DisplayName = displayName; - DormakabaAmbianceMetadata = dormakabaAmbianceMetadata; - DormakabaCommunityMetadata = dormakabaCommunityMetadata; - Errors = errors; - HotekMetadata = hotekMetadata; - IsLocked = isLocked; - LatchMetadata = latchMetadata; - SaltoKsMetadata = saltoKsMetadata; - SaltoSpaceMetadata = saltoSpaceMetadata; - SpaceIds = spaceIds; - VisionlineMetadata = visionlineMetadata; - Warnings = warnings; - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(AcsEntranceWarningsUnrecognized))] - [JsonSubtypes.KnownSubType(typeof(AcsEntranceWarningsPrivacyMode), "privacy_mode")] - [JsonSubtypes.KnownSubType( - typeof(AcsEntranceWarningsSaltoKsPrivacyMode), - "salto_ks_privacy_mode" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsEntranceWarningsEntranceSetupRequired), - "entrance_setup_required" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsEntranceWarningsEntranceSharesZone), - "entrance_shares_zone" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsEntranceWarningsSaltoKsEntranceAccessCodeSupportRemoved), - "salto_ks_entrance_access_code_support_removed" - )] - public abstract class AcsEntranceWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract( - Name = "seamModel_acsEntranceWarningsSaltoKsEntranceAccessCodeSupportRemoved_model" - )] - public class AcsEntranceWarningsSaltoKsEntranceAccessCodeSupportRemoved - : AcsEntranceWarnings - { - [JsonConstructorAttribute] - protected AcsEntranceWarningsSaltoKsEntranceAccessCodeSupportRemoved() { } - - public AcsEntranceWarningsSaltoKsEntranceAccessCodeSupportRemoved( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "salto_ks_entrance_access_code_support_removed"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceWarningsEntranceSharesZone_model")] - public class AcsEntranceWarningsEntranceSharesZone : AcsEntranceWarnings - { - [JsonConstructorAttribute] - protected AcsEntranceWarningsEntranceSharesZone() { } - - public AcsEntranceWarningsEntranceSharesZone( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "entrance_shares_zone"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceWarningsEntranceSetupRequired_model")] - public class AcsEntranceWarningsEntranceSetupRequired : AcsEntranceWarnings - { - [JsonConstructorAttribute] - protected AcsEntranceWarningsEntranceSetupRequired() { } - - public AcsEntranceWarningsEntranceSetupRequired( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "entrance_setup_required"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceWarningsSaltoKsPrivacyMode_model")] - public class AcsEntranceWarningsSaltoKsPrivacyMode : AcsEntranceWarnings - { - [JsonConstructorAttribute] - protected AcsEntranceWarningsSaltoKsPrivacyMode() { } - - public AcsEntranceWarningsSaltoKsPrivacyMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "salto_ks_privacy_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceWarningsPrivacyMode_model")] - public class AcsEntranceWarningsPrivacyMode : AcsEntranceWarnings - { - [JsonConstructorAttribute] - protected AcsEntranceWarningsPrivacyMode() { } - - public AcsEntranceWarningsPrivacyMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "privacy_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceWarningsUnrecognized_model")] - public class AcsEntranceWarningsUnrecognized : AcsEntranceWarnings - { - [JsonConstructorAttribute] - protected AcsEntranceWarningsUnrecognized() { } - - public AcsEntranceWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// ID of the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - /// - /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// Akiles-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "akiles_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceAkilesMetadata? AkilesMetadata { get; set; } - - /// - /// ASSA ABLOY Vostio-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember( - Name = "assa_abloy_vostio_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public AcsEntranceAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; set; } - - /// - /// Avigilon Alta-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "avigilon_alta_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceAvigilonAltaMetadata? AvigilonAltaMetadata { get; set; } - - /// - /// Brivo-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "brivo_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceBrivoMetadata? BrivoMetadata { get; set; } - - /// - /// Indicates whether the ACS entrance can belong to a reservation via an access_grant.reservation_key. - /// - [DataMember( - Name = "can_belong_to_reservation", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanBelongToReservation { get; set; } - - /// - /// Indicates whether the ACS entrance can be unlocked with card credentials. - /// - [DataMember(Name = "can_unlock_with_card", IsRequired = false, EmitDefaultValue = false)] - public bool? CanUnlockWithCard { get; set; } - - /// - /// Indicates whether the ACS entrance can be unlocked with cloud key credentials. - /// - [DataMember( - Name = "can_unlock_with_cloud_key", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanUnlockWithCloudKey { get; set; } - - /// - /// Indicates whether the ACS entrance can be unlocked with pin codes. - /// - [DataMember(Name = "can_unlock_with_code", IsRequired = false, EmitDefaultValue = false)] - public bool? CanUnlockWithCode { get; set; } - - /// - /// Indicates whether the ACS entrance can be unlocked with mobile key credentials. - /// - [DataMember( - Name = "can_unlock_with_mobile_key", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanUnlockWithMobileKey { get; set; } - - /// - /// ID of the [connected account](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name for the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// dormakaba Ambiance-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember( - Name = "dormakaba_ambiance_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public AcsEntranceDormakabaAmbianceMetadata? DormakabaAmbianceMetadata { get; set; } - - /// - /// dormakaba Community-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember( - Name = "dormakaba_community_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public AcsEntranceDormakabaCommunityMetadata? DormakabaCommunityMetadata { get; set; } - - /// - /// Errors associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Hotek-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "hotek_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceHotekMetadata? HotekMetadata { get; set; } - - /// - /// Indicates whether the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) is currently locked. - /// - [DataMember(Name = "is_locked", IsRequired = false, EmitDefaultValue = false)] - public bool? IsLocked { get; set; } - - /// - /// Latch-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "latch_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceLatchMetadata? LatchMetadata { get; set; } - - /// - /// Salto KS-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "salto_ks_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceSaltoKsMetadata? SaltoKsMetadata { get; set; } - - /// - /// Salto Space-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "salto_space_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceSaltoSpaceMetadata? SaltoSpaceMetadata { get; set; } - - /// - /// IDs of the spaces that the entrance is in. - /// - [DataMember(Name = "space_ids", IsRequired = false, EmitDefaultValue = false)] - public List SpaceIds { get; set; } - - /// - /// Visionline-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "visionline_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceVisionlineMetadata? VisionlineMetadata { get; set; } - - /// - /// Warnings associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceAkilesMetadata_model")] - public class AcsEntranceAkilesMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceAkilesMetadata() { } - - public AcsEntranceAkilesMetadata( - List? actions = default, - string? gadgetId = default, - string? siteId = default, - string? siteName = default - ) - { - Actions = actions; - GadgetId = gadgetId; - SiteId = siteId; - SiteName = siteName; - } - - /// - /// Actions the gadget exposes (for example, open). - /// - [DataMember(Name = "actions", IsRequired = false, EmitDefaultValue = false)] - public List? Actions { get; set; } - - /// - /// ID of the Akiles gadget. - /// - [DataMember(Name = "gadget_id", IsRequired = false, EmitDefaultValue = false)] - public string? GadgetId { get; set; } - - /// - /// ID of the Akiles site the gadget belongs to. - /// - [DataMember(Name = "site_id", IsRequired = false, EmitDefaultValue = false)] - public string? SiteId { get; set; } - - /// - /// Name of the Akiles site the gadget belongs to. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceAkilesMetadataActions_model")] - public class AcsEntranceAkilesMetadataActions - { - [JsonConstructorAttribute] - protected AcsEntranceAkilesMetadataActions() { } - - public AcsEntranceAkilesMetadataActions(string? id = default, string? name = default) - { - Id = id; - Name = name; - } - - /// - /// ID of the gadget action. - /// - [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] - public string? Id { get; set; } - - /// - /// Name of the gadget action. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceAssaAbloyVostioMetadata_model")] - public class AcsEntranceAssaAbloyVostioMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceAssaAbloyVostioMetadata() { } - - public AcsEntranceAssaAbloyVostioMetadata( - string? doorName = default, - float? doorNumber = default, - AcsEntranceAssaAbloyVostioMetadata.DoorTypeEnum? doorType = default, - string? pmsId = default, - bool? standOpen = default - ) - { - DoorName = doorName; - DoorNumber = doorNumber; - DoorType = doorType; - PmsId = pmsId; - StandOpen = standOpen; - } - - /// - /// Type of the door in the Vostio access system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DoorTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "CommonDoor")] - CommonDoor = 1, - - [EnumMember(Value = "EntranceDoor")] - EntranceDoor = 2, - - [EnumMember(Value = "GuestDoor")] - GuestDoor = 3, - - [EnumMember(Value = "Elevator")] - Elevator = 4, - } - - /// - /// Name of the door in the Vostio access system. - /// - [DataMember(Name = "door_name", IsRequired = false, EmitDefaultValue = false)] - public string? DoorName { get; set; } - - /// - /// Number of the door in the Vostio access system. - /// - [DataMember(Name = "door_number", IsRequired = false, EmitDefaultValue = false)] - public float? DoorNumber { get; set; } - - /// - /// Type of the door in the Vostio access system. - /// - [DataMember(Name = "door_type", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceAssaAbloyVostioMetadata.DoorTypeEnum? DoorType { get; set; } - - /// - /// PMS ID of the door in the Vostio access system. - /// - [DataMember(Name = "pms_id", IsRequired = false, EmitDefaultValue = false)] - public string? PmsId { get; set; } - - /// - /// Indicates whether keys are allowed to set the door in stand open mode in the Vostio access system. - /// - [DataMember(Name = "stand_open", IsRequired = false, EmitDefaultValue = false)] - public bool? StandOpen { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceAvigilonAltaMetadata_model")] - public class AcsEntranceAvigilonAltaMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceAvigilonAltaMetadata() { } - - public AcsEntranceAvigilonAltaMetadata( - string? entryName = default, - float? entryRelaysTotalCount = default, - string? orgName = default, - float? siteId = default, - string? siteName = default, - float? zoneId = default, - string? zoneName = default - ) - { - EntryName = entryName; - EntryRelaysTotalCount = entryRelaysTotalCount; - OrgName = orgName; - SiteId = siteId; - SiteName = siteName; - ZoneId = zoneId; - ZoneName = zoneName; - } - - /// - /// Entry name for an Avigilon Alta system. - /// - [DataMember(Name = "entry_name", IsRequired = false, EmitDefaultValue = false)] - public string? EntryName { get; set; } - - /// - /// Total count of entry relays for an Avigilon Alta system. - /// - [DataMember( - Name = "entry_relays_total_count", - IsRequired = false, - EmitDefaultValue = false - )] - public float? EntryRelaysTotalCount { get; set; } - - /// - /// Organization name for an Avigilon Alta system. - /// - [DataMember(Name = "org_name", IsRequired = false, EmitDefaultValue = false)] - public string? OrgName { get; set; } - - /// - /// Site ID for an Avigilon Alta system. - /// - [DataMember(Name = "site_id", IsRequired = false, EmitDefaultValue = false)] - public float? SiteId { get; set; } - - /// - /// Site name for an Avigilon Alta system. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - /// - /// Zone ID for an Avigilon Alta system. - /// - [DataMember(Name = "zone_id", IsRequired = false, EmitDefaultValue = false)] - public float? ZoneId { get; set; } - - /// - /// Zone name for an Avigilon Alta system. - /// - [DataMember(Name = "zone_name", IsRequired = false, EmitDefaultValue = false)] - public string? ZoneName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceBrivoMetadata_model")] - public class AcsEntranceBrivoMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceBrivoMetadata() { } - - public AcsEntranceBrivoMetadata( - string? accessPointId = default, - float? siteId = default, - string? siteName = default - ) - { - AccessPointId = accessPointId; - SiteId = siteId; - SiteName = siteName; - } - - /// - /// ID of the access point in the Brivo access system. - /// - [DataMember(Name = "access_point_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessPointId { get; set; } - - /// - /// ID of the site that the access point belongs to. - /// - [DataMember(Name = "site_id", IsRequired = false, EmitDefaultValue = false)] - public float? SiteId { get; set; } - - /// - /// Name of the site that the access point belongs to. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceDormakabaAmbianceMetadata_model")] - public class AcsEntranceDormakabaAmbianceMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceDormakabaAmbianceMetadata() { } - - public AcsEntranceDormakabaAmbianceMetadata(string? accessPointName = default) - { - AccessPointName = accessPointName; - } - - /// - /// Name of the access point in the dormakaba Ambiance access system. - /// - [DataMember(Name = "access_point_name", IsRequired = false, EmitDefaultValue = false)] - public string? AccessPointName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceDormakabaCommunityMetadata_model")] - public class AcsEntranceDormakabaCommunityMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceDormakabaCommunityMetadata() { } - - public AcsEntranceDormakabaCommunityMetadata(string? accessPointProfile = default) - { - AccessPointProfile = accessPointProfile; - } - - /// - /// Type of access point profile in the dormakaba Community access system. - /// - [DataMember(Name = "access_point_profile", IsRequired = false, EmitDefaultValue = false)] - public string? AccessPointProfile { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceErrors_model")] - public class AcsEntranceErrors - { - [JsonConstructorAttribute] - protected AcsEntranceErrors() { } - - public AcsEntranceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceHotekMetadata_model")] - public class AcsEntranceHotekMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceHotekMetadata() { } - - public AcsEntranceHotekMetadata( - string? commonAreaName = default, - string? commonAreaNumber = default, - string? roomNumber = default - ) - { - CommonAreaName = commonAreaName; - CommonAreaNumber = commonAreaNumber; - RoomNumber = roomNumber; - } - - /// - /// Display name of the entrance. - /// - [DataMember(Name = "common_area_name", IsRequired = false, EmitDefaultValue = false)] - public string? CommonAreaName { get; set; } - - /// - /// Display name of the entrance. - /// - [DataMember(Name = "common_area_number", IsRequired = false, EmitDefaultValue = false)] - public string? CommonAreaNumber { get; set; } - - /// - /// Room number of the entrance. - /// - [DataMember(Name = "room_number", IsRequired = false, EmitDefaultValue = false)] - public string? RoomNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceLatchMetadata_model")] - public class AcsEntranceLatchMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceLatchMetadata() { } - - public AcsEntranceLatchMetadata( - string? accessibilityType = default, - string? doorName = default, - string? doorType = default, - bool? isConnected = default - ) - { - AccessibilityType = accessibilityType; - DoorName = doorName; - DoorType = doorType; - IsConnected = isConnected; - } - - /// - /// Accessibility type in the Latch access system. - /// - [DataMember(Name = "accessibility_type", IsRequired = false, EmitDefaultValue = false)] - public string? AccessibilityType { get; set; } - - /// - /// Name of the door in the Latch access system. - /// - [DataMember(Name = "door_name", IsRequired = false, EmitDefaultValue = false)] - public string? DoorName { get; set; } - - /// - /// Type of the door in the Latch access system. - /// - [DataMember(Name = "door_type", IsRequired = false, EmitDefaultValue = false)] - public string? DoorType { get; set; } - - /// - /// Indicates whether the entrance is connected. - /// - [DataMember(Name = "is_connected", IsRequired = false, EmitDefaultValue = false)] - public bool? IsConnected { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceSaltoKsMetadata_model")] - public class AcsEntranceSaltoKsMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceSaltoKsMetadata() { } - - public AcsEntranceSaltoKsMetadata( - string? batteryLevel = default, - string? doorName = default, - bool? intrusionAlarm = default, - bool? leftOpenAlarm = default, - string? lockType = default, - string? lockedState = default, - bool? online = default, - bool? privacyMode = default - ) - { - BatteryLevel = batteryLevel; - DoorName = doorName; - IntrusionAlarm = intrusionAlarm; - LeftOpenAlarm = leftOpenAlarm; - LockType = lockType; - LockedState = lockedState; - Online = online; - PrivacyMode = privacyMode; - } - - /// - /// Battery level of the door access device. - /// - [DataMember(Name = "battery_level", IsRequired = false, EmitDefaultValue = false)] - public string? BatteryLevel { get; set; } - - /// - /// Name of the door in the Salto KS access system. - /// - [DataMember(Name = "door_name", IsRequired = false, EmitDefaultValue = false)] - public string? DoorName { get; set; } - - /// - /// Indicates whether an intrusion alarm is active on the door. - /// - [DataMember(Name = "intrusion_alarm", IsRequired = false, EmitDefaultValue = false)] - public bool? IntrusionAlarm { get; set; } - - /// - /// Indicates whether the door is left open. - /// - [DataMember(Name = "left_open_alarm", IsRequired = false, EmitDefaultValue = false)] - public bool? LeftOpenAlarm { get; set; } - - /// - /// Type of the lock in the Salto KS access system. - /// - [DataMember(Name = "lock_type", IsRequired = false, EmitDefaultValue = false)] - public string? LockType { get; set; } - - /// - /// Locked state of the door in the Salto KS access system. - /// - [DataMember(Name = "locked_state", IsRequired = false, EmitDefaultValue = false)] - public string? LockedState { get; set; } - - /// - /// Indicates whether the door access device is online. - /// - [DataMember(Name = "online", IsRequired = false, EmitDefaultValue = false)] - public bool? Online { get; set; } - - /// - /// Indicates whether privacy mode is enabled for the lock. - /// - [DataMember(Name = "privacy_mode", IsRequired = false, EmitDefaultValue = false)] - public bool? PrivacyMode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceSaltoSpaceMetadata_model")] - public class AcsEntranceSaltoSpaceMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceSaltoSpaceMetadata() { } - - public AcsEntranceSaltoSpaceMetadata( - bool? auditOnKeys = default, - string? doorDescription = default, - string? doorId = default, - string? doorName = default, - string? roomDescription = default, - string? roomName = default - ) - { - AuditOnKeys = auditOnKeys; - DoorDescription = doorDescription; - DoorId = doorId; - DoorName = doorName; - RoomDescription = roomDescription; - RoomName = roomName; - } - - /// - /// Indicates whether AuditOnKeys is enabled for the door in the Salto Space access system. - /// - [DataMember(Name = "audit_on_keys", IsRequired = false, EmitDefaultValue = false)] - public bool? AuditOnKeys { get; set; } - - /// - /// Description of the door in the Salto Space access system. - /// - [DataMember(Name = "door_description", IsRequired = false, EmitDefaultValue = false)] - public string? DoorDescription { get; set; } - - /// - /// Door ID in the Salto Space access system. - /// - [DataMember(Name = "door_id", IsRequired = false, EmitDefaultValue = false)] - public string? DoorId { get; set; } - - /// - /// Name of the door in the Salto Space access system. - /// - [DataMember(Name = "door_name", IsRequired = false, EmitDefaultValue = false)] - public string? DoorName { get; set; } - - /// - /// Description of the room in the Salto Space access system. - /// - [DataMember(Name = "room_description", IsRequired = false, EmitDefaultValue = false)] - public string? RoomDescription { get; set; } - - /// - /// Name of the room in the Salto Space access system. - /// - [DataMember(Name = "room_name", IsRequired = false, EmitDefaultValue = false)] - public string? RoomName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceVisionlineMetadata_model")] - public class AcsEntranceVisionlineMetadata - { - [JsonConstructorAttribute] - protected AcsEntranceVisionlineMetadata() { } - - public AcsEntranceVisionlineMetadata( - AcsEntranceVisionlineMetadata.DoorCategoryEnum? doorCategory = default, - string? doorName = default, - List? profiles = default - ) - { - DoorCategory = doorCategory; - DoorName = doorName; - Profiles = profiles; - } - - /// - /// Category of the door in the Visionline access system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DoorCategoryEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "entrance")] - Entrance = 1, - - [EnumMember(Value = "guest")] - Guest = 2, - - [EnumMember(Value = "elevator reader")] - ElevatorReader = 3, - - [EnumMember(Value = "common")] - Common = 4, - - [EnumMember(Value = "common (PMS)")] - CommonPms = 5, - } - - /// - /// Category of the door in the Visionline access system. - /// - [DataMember(Name = "door_category", IsRequired = false, EmitDefaultValue = false)] - public AcsEntranceVisionlineMetadata.DoorCategoryEnum? DoorCategory { get; set; } - - /// - /// Name of the door in the Visionline access system. - /// - [DataMember(Name = "door_name", IsRequired = false, EmitDefaultValue = false)] - public string? DoorName { get; set; } - - /// - /// Profile for the door in the Visionline access system. - /// - [DataMember(Name = "profiles", IsRequired = false, EmitDefaultValue = false)] - public List? Profiles { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsEntranceVisionlineMetadataProfiles_model")] - public class AcsEntranceVisionlineMetadataProfiles - { - [JsonConstructorAttribute] - protected AcsEntranceVisionlineMetadataProfiles() { } - - public AcsEntranceVisionlineMetadataProfiles( - string? visionlineDoorProfileId = default, - AcsEntranceVisionlineMetadataProfiles.VisionlineDoorProfileTypeEnum? visionlineDoorProfileType = - default - ) - { - VisionlineDoorProfileId = visionlineDoorProfileId; - VisionlineDoorProfileType = visionlineDoorProfileType; - } - - /// - /// Door profile type in the Visionline access system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum VisionlineDoorProfileTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "BLE")] - Ble = 1, - - [EnumMember(Value = "commonDoor")] - CommonDoor = 2, - - [EnumMember(Value = "touch")] - Touch = 3, - } - - /// - /// Door profile ID in the Visionline access system. - /// - [DataMember( - Name = "visionline_door_profile_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? VisionlineDoorProfileId { get; set; } - - /// - /// Door profile type in the Visionline access system. - /// - [DataMember( - Name = "visionline_door_profile_type", - IsRequired = false, - EmitDefaultValue = false - )] - public AcsEntranceVisionlineMetadataProfiles.VisionlineDoorProfileTypeEnum? VisionlineDoorProfileType { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/AcsSystem.cs b/src/Seam/Model/AcsSystem.cs deleted file mode 100644 index 364eb5e0..00000000 --- a/src/Seam/Model/AcsSystem.cs +++ /dev/null @@ -1,1304 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - /// Within an `acs_system`, create [`acs_user`s](https://docs.seam.co/api/acs/users/object) and [`acs_credential`s](https://docs.seam.co/api/acs/credentials/object) to grant access to the `acs_user`s. - /// - /// For details about the resources associated with an access control system, see the [access control systems namespace](https://docs.seam.co/api/acs). - /// - [DataContract(Name = "seamModel_acsSystem_model")] - public class AcsSystem - { - [JsonConstructorAttribute] - protected AcsSystem() { } - - public AcsSystem( - float? acsAccessGroupCount = default, - string acsSystemId = default, - float? acsUserCount = default, - string connectedAccountId = default, - List connectedAccountIds = default, - string createdAt = default, - string? defaultCredentialManagerAcsSystemId = default, - List errors = default, - AcsSystem.ExternalTypeEnum? externalType = default, - string? externalTypeDisplayName = default, - string imageAltText = default, - string imageUrl = default, - bool isCredentialManager = default, - AcsSystemLocation location = default, - string name = default, - AcsSystem.SystemTypeEnum? systemType = default, - string? systemTypeDisplayName = default, - AcsSystemVisionlineMetadata? visionlineMetadata = default, - List warnings = default, - string workspaceId = default - ) - { - AcsAccessGroupCount = acsAccessGroupCount; - AcsSystemId = acsSystemId; - AcsUserCount = acsUserCount; - ConnectedAccountId = connectedAccountId; - ConnectedAccountIds = connectedAccountIds; - CreatedAt = createdAt; - DefaultCredentialManagerAcsSystemId = defaultCredentialManagerAcsSystemId; - Errors = errors; - ExternalType = externalType; - ExternalTypeDisplayName = externalTypeDisplayName; - ImageAltText = imageAltText; - ImageUrl = imageUrl; - IsCredentialManager = isCredentialManager; - Location = location; - Name = name; - SystemType = systemType; - SystemTypeDisplayName = systemTypeDisplayName; - VisionlineMetadata = visionlineMetadata; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(AcsSystemErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemErrorsProviderServiceUnavailable), - "provider_service_unavailable" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemErrorsSaltoKsCertificationExpired), - "salto_ks_certification_expired" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemErrorsAccountDisconnected), - "account_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemErrorsAcsSystemDisconnected), - "acs_system_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemErrorsInsufficientPermissions), - "insufficient_permissions" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemErrorsSaltoKsSubscriptionLimitExceeded), - "salto_ks_subscription_limit_exceeded" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemErrorsVisionlineInstanceUnreachable), - "visionline_instance_unreachable" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemErrorsBridgeDisconnected), - "bridge_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemErrorsSeamBridgeDisconnected), - "seam_bridge_disconnected" - )] - public abstract class AcsSystemErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_acsSystemErrorsSeamBridgeDisconnected_model")] - public class AcsSystemErrorsSeamBridgeDisconnected : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsSeamBridgeDisconnected() { } - - public AcsSystemErrorsSeamBridgeDisconnected( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "seam_bridge_disconnected"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemErrorsBridgeDisconnected_model")] - public class AcsSystemErrorsBridgeDisconnected : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsBridgeDisconnected() { } - - public AcsSystemErrorsBridgeDisconnected( - string createdAt = default, - string errorCode = default, - bool? isBridgeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsBridgeError = isBridgeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "bridge_disconnected"; - - /// - /// Indicates whether the error is related to the [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public bool? IsBridgeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemErrorsVisionlineInstanceUnreachable_model")] - public class AcsSystemErrorsVisionlineInstanceUnreachable : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsVisionlineInstanceUnreachable() { } - - public AcsSystemErrorsVisionlineInstanceUnreachable( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "visionline_instance_unreachable"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemErrorsSaltoKsSubscriptionLimitExceeded_model")] - public class AcsSystemErrorsSaltoKsSubscriptionLimitExceeded : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsSaltoKsSubscriptionLimitExceeded() { } - - public AcsSystemErrorsSaltoKsSubscriptionLimitExceeded( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemErrorsInsufficientPermissions_model")] - public class AcsSystemErrorsInsufficientPermissions : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsInsufficientPermissions() { } - - public AcsSystemErrorsInsufficientPermissions( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "insufficient_permissions"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemErrorsAcsSystemDisconnected_model")] - public class AcsSystemErrorsAcsSystemDisconnected : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsAcsSystemDisconnected() { } - - public AcsSystemErrorsAcsSystemDisconnected( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "acs_system_disconnected"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemErrorsAccountDisconnected_model")] - public class AcsSystemErrorsAccountDisconnected : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsAccountDisconnected() { } - - public AcsSystemErrorsAccountDisconnected( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "account_disconnected"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemErrorsSaltoKsCertificationExpired_model")] - public class AcsSystemErrorsSaltoKsCertificationExpired : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsSaltoKsCertificationExpired() { } - - public AcsSystemErrorsSaltoKsCertificationExpired( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "salto_ks_certification_expired"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemErrorsProviderServiceUnavailable_model")] - public class AcsSystemErrorsProviderServiceUnavailable : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsProviderServiceUnavailable() { } - - public AcsSystemErrorsProviderServiceUnavailable( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "provider_service_unavailable"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemErrorsUnrecognized_model")] - public class AcsSystemErrorsUnrecognized : AcsSystemErrors - { - [JsonConstructorAttribute] - protected AcsSystemErrorsUnrecognized() { } - - public AcsSystemErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Brand-specific terminology for the [access control system](https://docs.seam.co/low-level-apis/access-systems) type. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExternalTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "pti_site")] - PtiSite = 1, - - [EnumMember(Value = "avigilon_alta_org")] - AvigilonAltaOrg = 2, - - [EnumMember(Value = "salto_ks_site")] - SaltoKsSite = 3, - - [EnumMember(Value = "salto_space_system")] - SaltoSpaceSystem = 4, - - [EnumMember(Value = "brivo_account")] - BrivoAccount = 5, - - [EnumMember(Value = "hid_credential_manager_organization")] - HidCredentialManagerOrganization = 6, - - [EnumMember(Value = "visionline_system")] - VisionlineSystem = 7, - - [EnumMember(Value = "assa_abloy_credential_service")] - AssaAbloyCredentialService = 8, - - [EnumMember(Value = "latch_building")] - LatchBuilding = 9, - - [EnumMember(Value = "dormakaba_community_site")] - DormakabaCommunitySite = 10, - - [EnumMember(Value = "dormakaba_ambiance_site")] - DormakabaAmbianceSite = 11, - - [EnumMember(Value = "legic_connect_credential_service")] - LegicConnectCredentialService = 12, - - [EnumMember(Value = "assa_abloy_vostio")] - AssaAbloyVostio = 13, - - [EnumMember(Value = "assa_abloy_vostio_credential_service")] - AssaAbloyVostioCredentialService = 14, - - [EnumMember(Value = "hotek_site")] - HotekSite = 15, - - [EnumMember(Value = "kisi_organization")] - KisiOrganization = 16, - - [EnumMember(Value = "akiles_organization")] - AkilesOrganization = 17, - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum SystemTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "pti_site")] - PtiSite = 1, - - [EnumMember(Value = "avigilon_alta_org")] - AvigilonAltaOrg = 2, - - [EnumMember(Value = "salto_ks_site")] - SaltoKsSite = 3, - - [EnumMember(Value = "salto_space_system")] - SaltoSpaceSystem = 4, - - [EnumMember(Value = "brivo_account")] - BrivoAccount = 5, - - [EnumMember(Value = "hid_credential_manager_organization")] - HidCredentialManagerOrganization = 6, - - [EnumMember(Value = "visionline_system")] - VisionlineSystem = 7, - - [EnumMember(Value = "assa_abloy_credential_service")] - AssaAbloyCredentialService = 8, - - [EnumMember(Value = "latch_building")] - LatchBuilding = 9, - - [EnumMember(Value = "dormakaba_community_site")] - DormakabaCommunitySite = 10, - - [EnumMember(Value = "dormakaba_ambiance_site")] - DormakabaAmbianceSite = 11, - - [EnumMember(Value = "legic_connect_credential_service")] - LegicConnectCredentialService = 12, - - [EnumMember(Value = "assa_abloy_vostio")] - AssaAbloyVostio = 13, - - [EnumMember(Value = "assa_abloy_vostio_credential_service")] - AssaAbloyVostioCredentialService = 14, - - [EnumMember(Value = "hotek_site")] - HotekSite = 15, - - [EnumMember(Value = "kisi_organization")] - KisiOrganization = 16, - - [EnumMember(Value = "akiles_organization")] - AkilesOrganization = 17, - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(AcsSystemWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemWarningsUnknownIssueWithAcsSystem), - "unknown_issue_with_acs_system" - )] - [JsonSubtypes.KnownSubType(typeof(AcsSystemWarningsSetupRequired), "setup_required")] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemWarningsTimeZoneDoesNotMatchLocation), - "time_zone_does_not_match_location" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsSystemWarningsSaltoKsSubscriptionLimitAlmostReached), - "salto_ks_subscription_limit_almost_reached" - )] - public abstract class AcsSystemWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract( - Name = "seamModel_acsSystemWarningsSaltoKsSubscriptionLimitAlmostReached_model" - )] - public class AcsSystemWarningsSaltoKsSubscriptionLimitAlmostReached : AcsSystemWarnings - { - [JsonConstructorAttribute] - protected AcsSystemWarningsSaltoKsSubscriptionLimitAlmostReached() { } - - public AcsSystemWarningsSaltoKsSubscriptionLimitAlmostReached( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "salto_ks_subscription_limit_almost_reached"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemWarningsTimeZoneDoesNotMatchLocation_model")] - public class AcsSystemWarningsTimeZoneDoesNotMatchLocation : AcsSystemWarnings - { - [JsonConstructorAttribute] - protected AcsSystemWarningsTimeZoneDoesNotMatchLocation() { } - - public AcsSystemWarningsTimeZoneDoesNotMatchLocation( - string createdAt = default, - string message = default, - List? misconfiguredAcsEntranceIds = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - MisconfiguredAcsEntranceIds = misconfiguredAcsEntranceIds; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [Obsolete("this field is deprecated.")] - [DataMember( - Name = "misconfigured_acs_entrance_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? MisconfiguredAcsEntranceIds { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "time_zone_does_not_match_location"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemWarningsSetupRequired_model")] - public class AcsSystemWarningsSetupRequired : AcsSystemWarnings - { - [JsonConstructorAttribute] - protected AcsSystemWarningsSetupRequired() { } - - public AcsSystemWarningsSetupRequired( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "setup_required"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemWarningsUnknownIssueWithAcsSystem_model")] - public class AcsSystemWarningsUnknownIssueWithAcsSystem : AcsSystemWarnings - { - [JsonConstructorAttribute] - protected AcsSystemWarningsUnknownIssueWithAcsSystem() { } - - public AcsSystemWarningsUnknownIssueWithAcsSystem( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unknown_issue_with_acs_system"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemWarningsUnrecognized_model")] - public class AcsSystemWarningsUnrecognized : AcsSystemWarnings - { - [JsonConstructorAttribute] - protected AcsSystemWarningsUnrecognized() { } - - public AcsSystemWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Number of access groups in the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "acs_access_group_count", IsRequired = false, EmitDefaultValue = false)] - public float? AcsAccessGroupCount { get; set; } - - /// - /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// Number of users in the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "acs_user_count", IsRequired = false, EmitDefaultValue = false)] - public float? AcsUserCount { get; set; } - - /// - /// ID of the connected account associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [Obsolete("Use `connected_account_id`.")] - [DataMember(Name = "connected_account_ids", IsRequired = false, EmitDefaultValue = false)] - public List ConnectedAccountIds { get; set; } - - /// - /// Date and time at which the [access control system](https://docs.seam.co/low-level-apis/access-systems) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// ID of the default credential manager `acs_system` for this [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember( - Name = "default_credential_manager_acs_system_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DefaultCredentialManagerAcsSystemId { get; set; } - - /// - /// Errors associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Brand-specific terminology for the [access control system](https://docs.seam.co/low-level-apis/access-systems) type. - /// - [DataMember(Name = "external_type", IsRequired = false, EmitDefaultValue = false)] - public AcsSystem.ExternalTypeEnum? ExternalType { get; set; } - - /// - /// Display name that corresponds to the brand-specific terminology for the [access control system](https://docs.seam.co/low-level-apis/access-systems) type. - /// - [DataMember( - Name = "external_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ExternalTypeDisplayName { get; set; } - - /// - /// Alternative text for the [access control system](https://docs.seam.co/low-level-apis/access-systems) image. - /// - [DataMember(Name = "image_alt_text", IsRequired = false, EmitDefaultValue = false)] - public string ImageAltText { get; set; } - - /// - /// URL for the image that represents the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "image_url", IsRequired = false, EmitDefaultValue = false)] - public string ImageUrl { get; set; } - - /// - /// Indicates whether the `acs_system` is a credential manager. - /// - [DataMember(Name = "is_credential_manager", IsRequired = false, EmitDefaultValue = false)] - public bool IsCredentialManager { get; set; } - - /// - /// Location information for the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "location", IsRequired = false, EmitDefaultValue = false)] - public AcsSystemLocation Location { get; set; } - - /// - /// Name of the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string Name { get; set; } - - [Obsolete("Use `external_type`.")] - [DataMember(Name = "system_type", IsRequired = false, EmitDefaultValue = false)] - public AcsSystem.SystemTypeEnum? SystemType { get; set; } - - [Obsolete("Use `external_type_display_name`.")] - [DataMember( - Name = "system_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string? SystemTypeDisplayName { get; set; } - - /// - /// Visionline-specific metadata for the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "visionline_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsSystemVisionlineMetadata? VisionlineMetadata { get; set; } - - /// - /// Warnings associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the [access control system](https://docs.seam.co/low-level-apis/access-systems). - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemLocation_model")] - public class AcsSystemLocation - { - [JsonConstructorAttribute] - protected AcsSystemLocation() { } - - public AcsSystemLocation(string? timeZone = default) - { - TimeZone = timeZone; - } - - /// - /// Time zone in which the [access control system](https://docs.seam.co/low-level-apis/access-systems) is located. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsSystemVisionlineMetadata_model")] - public class AcsSystemVisionlineMetadata - { - [JsonConstructorAttribute] - protected AcsSystemVisionlineMetadata() { } - - public AcsSystemVisionlineMetadata( - string? lanAddress = default, - string? mobileAccessUuid = default, - string? systemId = default - ) - { - LanAddress = lanAddress; - MobileAccessUuid = mobileAccessUuid; - SystemId = systemId; - } - - /// - /// IP address or hostname of the main Visionline server relative to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge) on the local network. - /// - [DataMember(Name = "lan_address", IsRequired = false, EmitDefaultValue = false)] - public string? LanAddress { get; set; } - - /// - /// Keyset loaded into a reader. Mobile keys and reader administration tools securely authenticate only with readers programmed with a matching keyset. - /// - [DataMember(Name = "mobile_access_uuid", IsRequired = false, EmitDefaultValue = false)] - public string? MobileAccessUuid { get; set; } - - /// - /// Unique ID assigned by the ASSA ABLOY licensing team that identifies each hotel in your credential manager. - /// - [DataMember(Name = "system_id", IsRequired = false, EmitDefaultValue = false)] - public string? SystemId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/AcsUser.cs b/src/Seam/Model/AcsUser.cs deleted file mode 100644 index 9df18f7b..00000000 --- a/src/Seam/Model/AcsUser.cs +++ /dev/null @@ -1,2271 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a [user](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access system](https://docs.seam.co/low-level-apis/access-systems). - /// - /// An access system user typically refers to an individual who requires access, like an employee or resident. Each user can possess multiple credentials that serve as their keys or identifiers for access. The type of credential can vary widely. For example, in the Salto system, a user can have a PIN code, a mobile app account, and a fob. In other platforms, it is not uncommon for a user to have more than one of the same credential type, such as multiple key cards. Additionally, these credentials can have a schedule or validity period. - /// - /// For details about how to configure users in your access system, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). - /// - [DataContract(Name = "seamModel_acsUser_model")] - public class AcsUser - { - [JsonConstructorAttribute] - protected AcsUser() { } - - public AcsUser( - AcsUserAccessSchedule? accessSchedule = default, - string acsSystemId = default, - string acsUserId = default, - string connectedAccountId = default, - string createdAt = default, - string displayName = default, - string? email = default, - string? emailAddress = default, - List errors = default, - AcsUser.ExternalTypeEnum? externalType = default, - string? externalTypeDisplayName = default, - string? fullName = default, - string? hidAcsSystemId = default, - bool isManaged = default, - bool? isSuspended = default, - List? pendingMutations = default, - string? phoneNumber = default, - AcsUserSaltoKsMetadata? saltoKsMetadata = default, - AcsUserSaltoSpaceMetadata? saltoSpaceMetadata = default, - string? userIdentityEmailAddress = default, - string? userIdentityFullName = default, - string? userIdentityId = default, - string? userIdentityPhoneNumber = default, - List warnings = default, - string workspaceId = default - ) - { - AccessSchedule = accessSchedule; - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DisplayName = displayName; - Email = email; - EmailAddress = emailAddress; - Errors = errors; - ExternalType = externalType; - ExternalTypeDisplayName = externalTypeDisplayName; - FullName = fullName; - HidAcsSystemId = hidAcsSystemId; - IsManaged = isManaged; - IsSuspended = isSuspended; - PendingMutations = pendingMutations; - PhoneNumber = phoneNumber; - SaltoKsMetadata = saltoKsMetadata; - SaltoSpaceMetadata = saltoSpaceMetadata; - UserIdentityEmailAddress = userIdentityEmailAddress; - UserIdentityFullName = userIdentityFullName; - UserIdentityId = userIdentityId; - UserIdentityPhoneNumber = userIdentityPhoneNumber; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(AcsUserErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AcsUserErrorsLatchConflictWithResidentUser), - "latch_conflict_with_resident_user" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserErrorsFailedToDeleteOnAcsSystem), - "failed_to_delete_on_acs_system" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserErrorsFailedToUpdateOnAcsSystem), - "failed_to_update_on_acs_system" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserErrorsFailedToCreateOnAcsSystem), - "failed_to_create_on_acs_system" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserErrorsSaltoKsSubscriptionLimitExceeded), - "salto_ks_subscription_limit_exceeded" - )] - [JsonSubtypes.KnownSubType(typeof(AcsUserErrorsDeletedExternally), "deleted_externally")] - public abstract class AcsUserErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_acsUserErrorsDeletedExternally_model")] - public class AcsUserErrorsDeletedExternally : AcsUserErrors - { - [JsonConstructorAttribute] - protected AcsUserErrorsDeletedExternally() { } - - public AcsUserErrorsDeletedExternally( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "deleted_externally"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserErrorsSaltoKsSubscriptionLimitExceeded_model")] - public class AcsUserErrorsSaltoKsSubscriptionLimitExceeded : AcsUserErrors - { - [JsonConstructorAttribute] - protected AcsUserErrorsSaltoKsSubscriptionLimitExceeded() { } - - public AcsUserErrorsSaltoKsSubscriptionLimitExceeded( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserErrorsFailedToCreateOnAcsSystem_model")] - public class AcsUserErrorsFailedToCreateOnAcsSystem : AcsUserErrors - { - [JsonConstructorAttribute] - protected AcsUserErrorsFailedToCreateOnAcsSystem() { } - - public AcsUserErrorsFailedToCreateOnAcsSystem( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_create_on_acs_system"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserErrorsFailedToUpdateOnAcsSystem_model")] - public class AcsUserErrorsFailedToUpdateOnAcsSystem : AcsUserErrors - { - [JsonConstructorAttribute] - protected AcsUserErrorsFailedToUpdateOnAcsSystem() { } - - public AcsUserErrorsFailedToUpdateOnAcsSystem( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_update_on_acs_system"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserErrorsFailedToDeleteOnAcsSystem_model")] - public class AcsUserErrorsFailedToDeleteOnAcsSystem : AcsUserErrors - { - [JsonConstructorAttribute] - protected AcsUserErrorsFailedToDeleteOnAcsSystem() { } - - public AcsUserErrorsFailedToDeleteOnAcsSystem( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_delete_on_acs_system"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserErrorsLatchConflictWithResidentUser_model")] - public class AcsUserErrorsLatchConflictWithResidentUser : AcsUserErrors - { - [JsonConstructorAttribute] - protected AcsUserErrorsLatchConflictWithResidentUser() { } - - public AcsUserErrorsLatchConflictWithResidentUser( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "latch_conflict_with_resident_user"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserErrorsUnrecognized_model")] - public class AcsUserErrorsUnrecognized : AcsUserErrors - { - [JsonConstructorAttribute] - protected AcsUserErrorsUnrecognized() { } - - public AcsUserErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Brand-specific terminology for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) type. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExternalTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "pti_user")] - PtiUser = 1, - - [EnumMember(Value = "brivo_user")] - BrivoUser = 2, - - [EnumMember(Value = "hid_credential_manager_user")] - HidCredentialManagerUser = 3, - - [EnumMember(Value = "salto_site_user")] - SaltoSiteUser = 4, - - [EnumMember(Value = "latch_user")] - LatchUser = 5, - - [EnumMember(Value = "dormakaba_community_user")] - DormakabaCommunityUser = 6, - - [EnumMember(Value = "salto_space_user")] - SaltoSpaceUser = 7, - - [EnumMember(Value = "avigilon_alta_user")] - AvigilonAltaUser = 8, - - [EnumMember(Value = "kisi_user")] - KisiUser = 9, - } - - [JsonConverter(typeof(JsonSubtypes), "mutation_code")] - [JsonSubtypes.FallBackSubType(typeof(AcsUserPendingMutationsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(AcsUserPendingMutationsUpdatingCredentialAssignment), - "updating_credential_assignment" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserPendingMutationsDeferringGroupMembershipUpdate), - "deferring_group_membership_update" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserPendingMutationsUpdatingGroupMembership), - "updating_group_membership" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserPendingMutationsUpdatingSuspensionState), - "updating_suspension_state" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserPendingMutationsUpdatingAccessSchedule), - "updating_access_schedule" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserPendingMutationsUpdatingUserInformation), - "updating_user_information" - )] - [JsonSubtypes.KnownSubType( - typeof(AcsUserPendingMutationsDeferringCreation), - "deferring_creation" - )] - [JsonSubtypes.KnownSubType(typeof(AcsUserPendingMutationsDeleting), "deleting")] - [JsonSubtypes.KnownSubType(typeof(AcsUserPendingMutationsCreating), "creating")] - public abstract class AcsUserPendingMutations - { - public abstract string MutationCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsCreating_model")] - public class AcsUserPendingMutationsCreating : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsCreating() { } - - public AcsUserPendingMutationsCreating( - string createdAt = default, - string message = default, - string mutationCode = default - ) - { - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "creating"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsDeleting_model")] - public class AcsUserPendingMutationsDeleting : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsDeleting() { } - - public AcsUserPendingMutationsDeleting( - string createdAt = default, - string message = default, - string mutationCode = default - ) - { - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "deleting"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsDeferringCreation_model")] - public class AcsUserPendingMutationsDeferringCreation : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsDeferringCreation() { } - - public AcsUserPendingMutationsDeferringCreation( - string createdAt = default, - string message = default, - string mutationCode = default, - string? scheduledAt = default - ) - { - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - ScheduledAt = scheduledAt; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "deferring_creation"; - - /// - /// Optional: When the user creation is scheduled to occur. - /// - [DataMember(Name = "scheduled_at", IsRequired = false, EmitDefaultValue = false)] - public string? ScheduledAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingUserInformation_model")] - public class AcsUserPendingMutationsUpdatingUserInformation : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingUserInformation() { } - - public AcsUserPendingMutationsUpdatingUserInformation( - string createdAt = default, - AcsUserPendingMutationsUpdatingUserInformationFrom from = default, - string message = default, - string mutationCode = default, - AcsUserPendingMutationsUpdatingUserInformationTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Old access system user information. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingUserInformationFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_user_information"; - - /// - /// New access system user information. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingUserInformationTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingUserInformationFrom_model")] - public class AcsUserPendingMutationsUpdatingUserInformationFrom - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingUserInformationFrom() { } - - public AcsUserPendingMutationsUpdatingUserInformationFrom( - string? emailAddress = default, - string? fullName = default, - string? phoneNumber = default - ) - { - EmailAddress = emailAddress; - FullName = fullName; - PhoneNumber = phoneNumber; - } - - /// - /// Email address of the access system user. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Full name of the access system user. - /// - [DataMember(Name = "full_name", IsRequired = false, EmitDefaultValue = false)] - public string? FullName { get; set; } - - /// - /// Phone number of the access system user. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingUserInformationTo_model")] - public class AcsUserPendingMutationsUpdatingUserInformationTo - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingUserInformationTo() { } - - public AcsUserPendingMutationsUpdatingUserInformationTo( - string? emailAddress = default, - string? fullName = default, - string? phoneNumber = default - ) - { - EmailAddress = emailAddress; - FullName = fullName; - PhoneNumber = phoneNumber; - } - - /// - /// Email address of the access system user. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Full name of the access system user. - /// - [DataMember(Name = "full_name", IsRequired = false, EmitDefaultValue = false)] - public string? FullName { get; set; } - - /// - /// Phone number of the access system user. - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingAccessSchedule_model")] - public class AcsUserPendingMutationsUpdatingAccessSchedule : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingAccessSchedule() { } - - public AcsUserPendingMutationsUpdatingAccessSchedule( - string createdAt = default, - AcsUserPendingMutationsUpdatingAccessScheduleFrom from = default, - string message = default, - string mutationCode = default, - AcsUserPendingMutationsUpdatingAccessScheduleTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Old access schedule information. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingAccessScheduleFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_access_schedule"; - - /// - /// New access schedule information. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingAccessScheduleTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingAccessScheduleFrom_model")] - public class AcsUserPendingMutationsUpdatingAccessScheduleFrom - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingAccessScheduleFrom() { } - - public AcsUserPendingMutationsUpdatingAccessScheduleFrom( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Starting time for the access schedule. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Starting time for the access schedule. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingAccessScheduleTo_model")] - public class AcsUserPendingMutationsUpdatingAccessScheduleTo - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingAccessScheduleTo() { } - - public AcsUserPendingMutationsUpdatingAccessScheduleTo( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Starting time for the access schedule. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Starting time for the access schedule. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingSuspensionState_model")] - public class AcsUserPendingMutationsUpdatingSuspensionState : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingSuspensionState() { } - - public AcsUserPendingMutationsUpdatingSuspensionState( - string createdAt = default, - AcsUserPendingMutationsUpdatingSuspensionStateFrom from = default, - string message = default, - string mutationCode = default, - AcsUserPendingMutationsUpdatingSuspensionStateTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Old user suspension state information. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingSuspensionStateFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_suspension_state"; - - /// - /// New user suspension state information. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingSuspensionStateTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingSuspensionStateFrom_model")] - public class AcsUserPendingMutationsUpdatingSuspensionStateFrom - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingSuspensionStateFrom() { } - - public AcsUserPendingMutationsUpdatingSuspensionStateFrom(bool isSuspended = default) - { - IsSuspended = isSuspended; - } - - [DataMember(Name = "is_suspended", IsRequired = false, EmitDefaultValue = false)] - public bool IsSuspended { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingSuspensionStateTo_model")] - public class AcsUserPendingMutationsUpdatingSuspensionStateTo - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingSuspensionStateTo() { } - - public AcsUserPendingMutationsUpdatingSuspensionStateTo(bool isSuspended = default) - { - IsSuspended = isSuspended; - } - - [DataMember(Name = "is_suspended", IsRequired = false, EmitDefaultValue = false)] - public bool IsSuspended { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingGroupMembership_model")] - public class AcsUserPendingMutationsUpdatingGroupMembership : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingGroupMembership() { } - - public AcsUserPendingMutationsUpdatingGroupMembership( - string createdAt = default, - AcsUserPendingMutationsUpdatingGroupMembershipFrom from = default, - string message = default, - string mutationCode = default, - AcsUserPendingMutationsUpdatingGroupMembershipTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Old access group membership. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingGroupMembershipFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_group_membership"; - - /// - /// New access group membership. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingGroupMembershipTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingGroupMembershipFrom_model")] - public class AcsUserPendingMutationsUpdatingGroupMembershipFrom - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingGroupMembershipFrom() { } - - public AcsUserPendingMutationsUpdatingGroupMembershipFrom( - string? acsAccessGroupId = default - ) - { - AcsAccessGroupId = acsAccessGroupId; - } - - /// - /// Old access group ID. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsAccessGroupId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingGroupMembershipTo_model")] - public class AcsUserPendingMutationsUpdatingGroupMembershipTo - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingGroupMembershipTo() { } - - public AcsUserPendingMutationsUpdatingGroupMembershipTo( - string? acsAccessGroupId = default - ) - { - AcsAccessGroupId = acsAccessGroupId; - } - - /// - /// New access group ID. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsAccessGroupId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsUserPendingMutationsDeferringGroupMembershipUpdate_model" - )] - public class AcsUserPendingMutationsDeferringGroupMembershipUpdate : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsDeferringGroupMembershipUpdate() { } - - public AcsUserPendingMutationsDeferringGroupMembershipUpdate( - string acsAccessGroupId = default, - string createdAt = default, - string message = default, - string mutationCode = default, - AcsUserPendingMutationsDeferringGroupMembershipUpdate.VariantEnum variant = default - ) - { - AcsAccessGroupId = acsAccessGroupId; - CreatedAt = createdAt; - Message = message; - MutationCode = mutationCode; - Variant = variant; - } - - /// - /// Whether the user is scheduled to be added to or removed from the access group. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum VariantEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "adding")] - Adding = 1, - - [EnumMember(Value = "removing")] - Removing = 2, - } - - /// - /// ID of the access group involved in the scheduled change. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "deferring_group_membership_update"; - - /// - /// Whether the user is scheduled to be added to or removed from the access group. - /// - [DataMember(Name = "variant", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsDeferringGroupMembershipUpdate.VariantEnum Variant { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUpdatingCredentialAssignment_model")] - public class AcsUserPendingMutationsUpdatingCredentialAssignment : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingCredentialAssignment() { } - - public AcsUserPendingMutationsUpdatingCredentialAssignment( - string createdAt = default, - AcsUserPendingMutationsUpdatingCredentialAssignmentFrom from = default, - string message = default, - string mutationCode = default, - AcsUserPendingMutationsUpdatingCredentialAssignmentTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous credential assignment. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingCredentialAssignmentFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_credential_assignment"; - - /// - /// New credential assignment. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public AcsUserPendingMutationsUpdatingCredentialAssignmentTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsUserPendingMutationsUpdatingCredentialAssignmentFrom_model" - )] - public class AcsUserPendingMutationsUpdatingCredentialAssignmentFrom - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingCredentialAssignmentFrom() { } - - public AcsUserPendingMutationsUpdatingCredentialAssignmentFrom( - string? acsCredentialId = default - ) - { - AcsCredentialId = acsCredentialId; - } - - /// - /// Previous credential ID. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_acsUserPendingMutationsUpdatingCredentialAssignmentTo_model" - )] - public class AcsUserPendingMutationsUpdatingCredentialAssignmentTo - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUpdatingCredentialAssignmentTo() { } - - public AcsUserPendingMutationsUpdatingCredentialAssignmentTo( - string? acsCredentialId = default - ) - { - AcsCredentialId = acsCredentialId; - } - - /// - /// New credential ID. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserPendingMutationsUnrecognized_model")] - public class AcsUserPendingMutationsUnrecognized : AcsUserPendingMutations - { - [JsonConstructorAttribute] - protected AcsUserPendingMutationsUnrecognized() { } - - public AcsUserPendingMutationsUnrecognized( - string mutationCode = default, - string createdAt = default, - string message = default - ) - { - MutationCode = mutationCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "unrecognized"; - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(AcsUserWarningsUnrecognized))] - [JsonSubtypes.KnownSubType(typeof(AcsUserWarningsLatchResidentUser), "latch_resident_user")] - [JsonSubtypes.KnownSubType( - typeof(AcsUserWarningsUnknownIssueWithAcsUser), - "unknown_issue_with_acs_user" - )] - [JsonSubtypes.KnownSubType(typeof(AcsUserWarningsAcsUserInactive), "acs_user_inactive")] - [JsonSubtypes.KnownSubType( - typeof(AcsUserWarningsSaltoKsUserNotSubscribed), - "salto_ks_user_not_subscribed" - )] - [JsonSubtypes.KnownSubType(typeof(AcsUserWarningsBeingDeleted), "being_deleted")] - public abstract class AcsUserWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_acsUserWarningsBeingDeleted_model")] - public class AcsUserWarningsBeingDeleted : AcsUserWarnings - { - [JsonConstructorAttribute] - protected AcsUserWarningsBeingDeleted() { } - - public AcsUserWarningsBeingDeleted( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserWarningsSaltoKsUserNotSubscribed_model")] - public class AcsUserWarningsSaltoKsUserNotSubscribed : AcsUserWarnings - { - [JsonConstructorAttribute] - protected AcsUserWarningsSaltoKsUserNotSubscribed() { } - - public AcsUserWarningsSaltoKsUserNotSubscribed( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "salto_ks_user_not_subscribed"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserWarningsAcsUserInactive_model")] - public class AcsUserWarningsAcsUserInactive : AcsUserWarnings - { - [JsonConstructorAttribute] - protected AcsUserWarningsAcsUserInactive() { } - - public AcsUserWarningsAcsUserInactive( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "acs_user_inactive"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserWarningsUnknownIssueWithAcsUser_model")] - public class AcsUserWarningsUnknownIssueWithAcsUser : AcsUserWarnings - { - [JsonConstructorAttribute] - protected AcsUserWarningsUnknownIssueWithAcsUser() { } - - public AcsUserWarningsUnknownIssueWithAcsUser( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unknown_issue_with_acs_user"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserWarningsLatchResidentUser_model")] - public class AcsUserWarningsLatchResidentUser : AcsUserWarnings - { - [JsonConstructorAttribute] - protected AcsUserWarningsLatchResidentUser() { } - - public AcsUserWarningsLatchResidentUser( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "latch_resident_user"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserWarningsUnrecognized_model")] - public class AcsUserWarningsUnrecognized : AcsUserWarnings - { - [JsonConstructorAttribute] - protected AcsUserWarningsUnrecognized() { } - - public AcsUserWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// `starts_at` and `ends_at` timestamps for the [access system user's](https://docs.seam.co/low-level-apis/access-systems/user-management) access. - /// - [DataMember(Name = "access_schedule", IsRequired = false, EmitDefaultValue = false)] - public AcsUserAccessSchedule? AccessSchedule { get; set; } - - /// - /// ID of the [access system](https://docs.seam.co/low-level-apis/access-systems) that contains the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsUserId { get; set; } - - /// - /// The ID of the connected account that is associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - [Obsolete("use email_address.")] - [DataMember(Name = "email", IsRequired = false, EmitDefaultValue = false)] - public string? Email { get; set; } - - /// - /// Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Errors associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Brand-specific terminology for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) type. - /// - [DataMember(Name = "external_type", IsRequired = false, EmitDefaultValue = false)] - public AcsUser.ExternalTypeEnum? ExternalType { get; set; } - - /// - /// Display name that corresponds to the brand-specific terminology for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) type. - /// - [DataMember( - Name = "external_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ExternalTypeDisplayName { get; set; } - - /// - /// Full name of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "full_name", IsRequired = false, EmitDefaultValue = false)] - public string? FullName { get; set; } - - /// - /// ID of the HID access control system associated with the user. - /// - [DataMember(Name = "hid_acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? HidAcsSystemId { get; set; } - - /// - /// Indicates whether Seam manages the access system user. - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Indicates whether the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) is currently [suspended](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users). - /// - [DataMember(Name = "is_suspended", IsRequired = false, EmitDefaultValue = false)] - public bool? IsSuspended { get; set; } - - /// - /// Pending mutations associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Seam is in the process of pushing these mutations to the integrated access system. - /// - [DataMember(Name = "pending_mutations", IsRequired = false, EmitDefaultValue = false)] - public List? PendingMutations { get; set; } - - /// - /// Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// Salto KS-specific metadata associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "salto_ks_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsUserSaltoKsMetadata? SaltoKsMetadata { get; set; } - - /// - /// Salto Space-specific metadata associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "salto_space_metadata", IsRequired = false, EmitDefaultValue = false)] - public AcsUserSaltoSpaceMetadata? SaltoSpaceMetadata { get; set; } - - /// - /// Email address of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember( - Name = "user_identity_email_address", - IsRequired = false, - EmitDefaultValue = false - )] - public string? UserIdentityEmailAddress { get; set; } - - /// - /// Full name of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "user_identity_full_name", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityFullName { get; set; } - - /// - /// ID of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Phone number of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). - /// - [DataMember( - Name = "user_identity_phone_number", - IsRequired = false, - EmitDefaultValue = false - )] - public string? UserIdentityPhoneNumber { get; set; } - - /// - /// Warnings associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserAccessSchedule_model")] - public class AcsUserAccessSchedule - { - [JsonConstructorAttribute] - protected AcsUserAccessSchedule() { } - - public AcsUserAccessSchedule(string? endsAt = default, string startsAt = default) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserSaltoKsMetadata_model")] - public class AcsUserSaltoKsMetadata - { - [JsonConstructorAttribute] - protected AcsUserSaltoKsMetadata() { } - - public AcsUserSaltoKsMetadata(bool? isSubscribed = default) - { - IsSubscribed = isSubscribed; - } - - /// - /// Indicates whether the user holds an active subscription slot on the Salto KS site. Only subscribed users can unlock doors and count against the site's user-subscription limit. A user may not be subscribed because their access schedule has not started or has ended, the site has reached its subscription limit, or they were manually unsubscribed. This is distinct from `is_suspended`, which reflects whether the user has been explicitly blocked. - /// - [DataMember(Name = "is_subscribed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsSubscribed { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_acsUserSaltoSpaceMetadata_model")] - public class AcsUserSaltoSpaceMetadata - { - [JsonConstructorAttribute] - protected AcsUserSaltoSpaceMetadata() { } - - public AcsUserSaltoSpaceMetadata(bool? auditOpenings = default, string? userId = default) - { - AuditOpenings = auditOpenings; - UserId = userId; - } - - /// - /// Indicates whether AuditOpenings is enabled for the user in the Salto Space access system. - /// - [DataMember(Name = "audit_openings", IsRequired = false, EmitDefaultValue = false)] - public bool? AuditOpenings { get; set; } - - /// - /// User ID in the Salto Space access system. - /// - [DataMember(Name = "user_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/ActionAttempt.cs b/src/Seam/Model/ActionAttempt.cs deleted file mode 100644 index 5387e6fb..00000000 --- a/src/Seam/Model/ActionAttempt.cs +++ /dev/null @@ -1,6576 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - [JsonConverter(typeof(JsonSubtypes), "action_type")] - [JsonSubtypes.FallBackSubType(typeof(ActionAttemptUnrecognized))] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptUpdateNoiseThreshold), "UPDATE_NOISE_THRESHOLD")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptDeleteNoiseThreshold), "DELETE_NOISE_THRESHOLD")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptCreateNoiseThreshold), "CREATE_NOISE_THRESHOLD")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptUpdateAccessCode), "UPDATE_ACCESS_CODE")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptDeleteAccessCode), "DELETE_ACCESS_CODE")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptCreateAccessCode), "CREATE_ACCESS_CODE")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptSyncAccessCodes), "SYNC_ACCESS_CODES")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptConfigureAutoLock), "CONFIGURE_AUTO_LOCK")] - [JsonSubtypes.KnownSubType( - typeof(ActionAttemptPushThermostatPrograms), - "PUSH_THERMOSTAT_PROGRAMS" - )] - [JsonSubtypes.KnownSubType( - typeof(ActionAttemptSimulateManualLockViaKeypad), - "SIMULATE_MANUAL_LOCK_VIA_KEYPAD" - )] - [JsonSubtypes.KnownSubType( - typeof(ActionAttemptSimulateKeypadCodeEntry), - "SIMULATE_KEYPAD_CODE_ENTRY" - )] - [JsonSubtypes.KnownSubType( - typeof(ActionAttemptActivateClimatePreset), - "ACTIVATE_CLIMATE_PRESET" - )] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptSetHvacMode), "SET_HVAC_MODE")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptSetFanMode), "SET_FAN_MODE")] - [JsonSubtypes.KnownSubType( - typeof(ActionAttemptResetSandboxWorkspace), - "RESET_SANDBOX_WORKSPACE" - )] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptAssignCredential), "ASSIGN_CREDENTIAL")] - [JsonSubtypes.KnownSubType( - typeof(ActionAttemptScanToAssignCredential), - "SCAN_TO_ASSIGN_CREDENTIAL" - )] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptEncodeCredential), "ENCODE_CREDENTIAL")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptScanCredential), "SCAN_CREDENTIAL")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptUnlockDoor), "UNLOCK_DOOR")] - [JsonSubtypes.KnownSubType(typeof(ActionAttemptLockDoor), "LOCK_DOOR")] - public abstract class ActionAttempt - { - public abstract string ActionType { get; } - - public abstract string ActionAttemptId { get; set; } - - public abstract override string ToString(); - } - - /// - /// Locking a door is pending. - /// - [DataContract(Name = "seamModel_actionAttemptLockDoor_model")] - public class ActionAttemptLockDoor : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptLockDoor() { } - - public ActionAttemptLockDoor( - string actionAttemptId = default, - string actionType = default, - ActionAttemptLockDoorError error = default, - ActionAttemptLockDoorResult result = default, - ActionAttemptLockDoor.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "LOCK_DOOR"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptLockDoorError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptLockDoorResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptLockDoor.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptLockDoorError_model")] - public class ActionAttemptLockDoorError - { - [JsonConstructorAttribute] - protected ActionAttemptLockDoorError() { } - - public ActionAttemptLockDoorError(string message = default, string type = default) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptLockDoorResult_model")] - public class ActionAttemptLockDoorResult - { - [JsonConstructorAttribute] - protected ActionAttemptLockDoorResult() { } - - public ActionAttemptLockDoorResult(bool? wasConfirmedByDevice = default) - { - WasConfirmedByDevice = wasConfirmedByDevice; - } - - /// - /// Indicates whether the device confirmed that the lock action occurred. - /// - [DataMember(Name = "was_confirmed_by_device", IsRequired = false, EmitDefaultValue = false)] - public bool? WasConfirmedByDevice { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Unlocking a door is pending. - /// - [DataContract(Name = "seamModel_actionAttemptUnlockDoor_model")] - public class ActionAttemptUnlockDoor : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptUnlockDoor() { } - - public ActionAttemptUnlockDoor( - string actionAttemptId = default, - string actionType = default, - ActionAttemptUnlockDoorError error = default, - ActionAttemptUnlockDoorResult result = default, - ActionAttemptUnlockDoor.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "UNLOCK_DOOR"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptUnlockDoorError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptUnlockDoorResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptUnlockDoor.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptUnlockDoorError_model")] - public class ActionAttemptUnlockDoorError - { - [JsonConstructorAttribute] - protected ActionAttemptUnlockDoorError() { } - - public ActionAttemptUnlockDoorError(string message = default, string type = default) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptUnlockDoorResult_model")] - public class ActionAttemptUnlockDoorResult - { - [JsonConstructorAttribute] - protected ActionAttemptUnlockDoorResult() { } - - public ActionAttemptUnlockDoorResult(bool? wasConfirmedByDevice = default) - { - WasConfirmedByDevice = wasConfirmedByDevice; - } - - /// - /// Indicates whether the device confirmed that the unlock action occurred. - /// - [DataMember(Name = "was_confirmed_by_device", IsRequired = false, EmitDefaultValue = false)] - public bool? WasConfirmedByDevice { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Reading credential data from the physical encoder is pending. - /// - [DataContract(Name = "seamModel_actionAttemptScanCredential_model")] - public class ActionAttemptScanCredential : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredential() { } - - public ActionAttemptScanCredential( - string actionAttemptId = default, - string actionType = default, - ActionAttemptScanCredentialError error = default, - ActionAttemptScanCredentialResult result = default, - ActionAttemptScanCredential.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "SCAN_CREDENTIAL"; - - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialError Error { get; set; } - - /// - /// Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredential.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanCredentialError_model")] - public class ActionAttemptScanCredentialError - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialError() { } - - public ActionAttemptScanCredentialError( - string message = default, - ActionAttemptScanCredentialError.TypeEnum type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Error type to indicate that the Seam Bridge is disconnected or cannot reach the access control system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum TypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "uncategorized_error")] - UncategorizedError = 1, - - [EnumMember(Value = "action_attempt_expired")] - ActionAttemptExpired = 2, - - [EnumMember(Value = "no_credential_on_encoder")] - NoCredentialOnEncoder = 3, - - [EnumMember(Value = "encoder_not_online")] - EncoderNotOnline = 4, - - [EnumMember(Value = "encoder_communication_timeout")] - EncoderCommunicationTimeout = 5, - - [EnumMember(Value = "bridge_disconnected")] - BridgeDisconnected = 6, - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Error type to indicate that the Seam Bridge is disconnected or cannot reach the access control system. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialError.TypeEnum Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanCredentialResult_model")] - public class ActionAttemptScanCredentialResult - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResult() { } - - public ActionAttemptScanCredentialResult( - ActionAttemptScanCredentialResultAcsCredentialOnEncoder? acsCredentialOnEncoder = - default, - ActionAttemptScanCredentialResultAcsCredentialOnSeam? acsCredentialOnSeam = default, - List warnings = default - ) - { - AcsCredentialOnEncoder = acsCredentialOnEncoder; - AcsCredentialOnSeam = acsCredentialOnSeam; - Warnings = warnings; - } - - /// - /// Snapshot of credential data read from the physical encoder. - /// - [DataMember( - Name = "acs_credential_on_encoder", - IsRequired = false, - EmitDefaultValue = false - )] - public ActionAttemptScanCredentialResultAcsCredentialOnEncoder? AcsCredentialOnEncoder { get; set; } - - /// - /// Corresponding credential data as stored on Seam and the access system. - /// - [DataMember(Name = "acs_credential_on_seam", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultAcsCredentialOnSeam? AcsCredentialOnSeam { get; set; } - - /// - /// Warnings related to scanning the credential, such as mismatches between the credential data currently encoded on the card and the corresponding data stored on Seam and the access system. - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanCredentialResultAcsCredentialOnEncoder_model")] - public class ActionAttemptScanCredentialResultAcsCredentialOnEncoder - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResultAcsCredentialOnEncoder() { } - - public ActionAttemptScanCredentialResultAcsCredentialOnEncoder( - string? cardNumber = default, - string? createdAt = default, - string? endsAt = default, - bool? isIssued = default, - string? startsAt = default, - ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata? visionlineMetadata = - default - ) - { - CardNumber = cardNumber; - CreatedAt = createdAt; - EndsAt = endsAt; - IsIssued = isIssued; - StartsAt = startsAt; - VisionlineMetadata = visionlineMetadata; - } - - /// - /// A number or string that physically identifies the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "card_number", IsRequired = false, EmitDefaultValue = false)] - public string? CardNumber { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) will stop being usable. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Indicates whether the credential has been issued (encoded onto a card). - /// - [DataMember(Name = "is_issued", IsRequired = false, EmitDefaultValue = false)] - public bool? IsIssued { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) becomes usable. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "visionline_metadata", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata? VisionlineMetadata { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_actionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata_model" - )] - public class ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata() { } - - public ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata( - bool? cancelled = default, - ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata.CardFormatEnum? cardFormat = - default, - string? cardHolder = default, - string? cardId = default, - List? commonAcsEntranceIds = default, - bool? discarded = default, - bool? expired = default, - List? guestAcsEntranceIds = default, - float? numberOfIssuedCards = default, - bool? overridden = default, - bool? overwritten = default, - bool? pendingAutoUpdate = default - ) - { - Cancelled = cancelled; - CardFormat = cardFormat; - CardHolder = cardHolder; - CardId = cardId; - CommonAcsEntranceIds = commonAcsEntranceIds; - Discarded = discarded; - Expired = expired; - GuestAcsEntranceIds = guestAcsEntranceIds; - NumberOfIssuedCards = numberOfIssuedCards; - Overridden = overridden; - Overwritten = overwritten; - PendingAutoUpdate = pendingAutoUpdate; - } - - /// - /// Format of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum CardFormatEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "TLCode")] - TlCode = 1, - - [EnumMember(Value = "rfid48")] - Rfid48 = 2, - } - - /// - /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is cancelled. - /// - [DataMember(Name = "cancelled", IsRequired = false, EmitDefaultValue = false)] - public bool? Cancelled { get; set; } - - /// - /// Format of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "card_format", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata.CardFormatEnum? CardFormat { get; set; } - - /// - /// Holder of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "card_holder", IsRequired = false, EmitDefaultValue = false)] - public string? CardHolder { get; set; } - - /// - /// Card ID for the Visionline card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "card_id", IsRequired = false, EmitDefaultValue = false)] - public string? CardId { get; set; } - - /// - /// IDs of the common [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "common_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAcsEntranceIds { get; set; } - - /// - /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is discarded. - /// - [DataMember(Name = "discarded", IsRequired = false, EmitDefaultValue = false)] - public bool? Discarded { get; set; } - - /// - /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is expired. - /// - [DataMember(Name = "expired", IsRequired = false, EmitDefaultValue = false)] - public bool? Expired { get; set; } - - /// - /// IDs of the guest [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "guest_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? GuestAcsEntranceIds { get; set; } - - /// - /// Number of issued cards associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "number_of_issued_cards", IsRequired = false, EmitDefaultValue = false)] - public float? NumberOfIssuedCards { get; set; } - - /// - /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is overridden. - /// - [DataMember(Name = "overridden", IsRequired = false, EmitDefaultValue = false)] - public bool? Overridden { get; set; } - - /// - /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is overwritten. - /// - [DataMember(Name = "overwritten", IsRequired = false, EmitDefaultValue = false)] - public bool? Overwritten { get; set; } - - /// - /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is pending auto-update. - /// - [DataMember(Name = "pending_auto_update", IsRequired = false, EmitDefaultValue = false)] - public bool? PendingAutoUpdate { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanCredentialResultAcsCredentialOnSeam_model")] - public class ActionAttemptScanCredentialResultAcsCredentialOnSeam - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResultAcsCredentialOnSeam() { } - - public ActionAttemptScanCredentialResultAcsCredentialOnSeam( - ActionAttemptScanCredentialResultAcsCredentialOnSeam.AccessMethodEnum accessMethod = - default, - string acsCredentialId = default, - string? acsCredentialPoolId = default, - string acsSystemId = default, - string? acsUserId = default, - ActionAttemptScanCredentialResultAcsCredentialOnSeamAkilesMetadata? akilesMetadata = - default, - ActionAttemptScanCredentialResultAcsCredentialOnSeamAssaAbloyVostioMetadata? assaAbloyVostioMetadata = - default, - string? cardNumber = default, - string? code = default, - string connectedAccountId = default, - string createdAt = default, - string displayName = default, - string? endsAt = default, - List errors = default, - ActionAttemptScanCredentialResultAcsCredentialOnSeam.ExternalTypeEnum? externalType = - default, - string? externalTypeDisplayName = default, - bool? isIssued = default, - bool? isLatestDesiredStateSyncedWithProvider = default, - bool isManaged = default, - bool? isMultiPhoneSyncCredential = default, - bool? isOneTimeUse = default, - string? issuedAt = default, - string? latestDesiredStateSyncedWithProviderAt = default, - string? parentAcsCredentialId = default, - string? startsAt = default, - string? userIdentityId = default, - ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata? visionlineMetadata = - default, - List warnings = default, - string workspaceId = default - ) - { - AccessMethod = accessMethod; - AcsCredentialId = acsCredentialId; - AcsCredentialPoolId = acsCredentialPoolId; - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - AkilesMetadata = akilesMetadata; - AssaAbloyVostioMetadata = assaAbloyVostioMetadata; - CardNumber = cardNumber; - Code = code; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DisplayName = displayName; - EndsAt = endsAt; - Errors = errors; - ExternalType = externalType; - ExternalTypeDisplayName = externalTypeDisplayName; - IsIssued = isIssued; - IsLatestDesiredStateSyncedWithProvider = isLatestDesiredStateSyncedWithProvider; - IsManaged = isManaged; - IsMultiPhoneSyncCredential = isMultiPhoneSyncCredential; - IsOneTimeUse = isOneTimeUse; - IssuedAt = issuedAt; - LatestDesiredStateSyncedWithProviderAt = latestDesiredStateSyncedWithProviderAt; - ParentAcsCredentialId = parentAcsCredentialId; - StartsAt = startsAt; - UserIdentityId = userIdentityId; - VisionlineMetadata = visionlineMetadata; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - /// - /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AccessMethodEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExternalTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "pti_card")] - PtiCard = 1, - - [EnumMember(Value = "brivo_credential")] - BrivoCredential = 2, - - [EnumMember(Value = "hid_credential")] - HidCredential = 3, - - [EnumMember(Value = "visionline_card")] - VisionlineCard = 4, - - [EnumMember(Value = "salto_ks_credential")] - SaltoKsCredential = 5, - - [EnumMember(Value = "assa_abloy_vostio_key")] - AssaAbloyVostioKey = 6, - - [EnumMember(Value = "salto_space_key")] - SaltoSpaceKey = 7, - - [EnumMember(Value = "latch_access")] - LatchAccess = 8, - - [EnumMember(Value = "dormakaba_ambiance_credential")] - DormakabaAmbianceCredential = 9, - - [EnumMember(Value = "hotek_card")] - HotekCard = 10, - - [EnumMember(Value = "salto_ks_tag")] - SaltoKsTag = 11, - - [EnumMember(Value = "avigilon_alta_credential")] - AvigilonAltaCredential = 12, - - [EnumMember(Value = "kisi_credential")] - KisiCredential = 13, - - [EnumMember(Value = "akiles_credential")] - AkilesCredential = 14, - } - - /// - /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "access_method", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultAcsCredentialOnSeam.AccessMethodEnum AccessMethod { get; set; } - - /// - /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the credential pool to which the credential belongs. - /// - [DataMember(Name = "acs_credential_pool_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialPoolId { get; set; } - - /// - /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// Akiles-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "akiles_metadata", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultAcsCredentialOnSeamAkilesMetadata? AkilesMetadata { get; set; } - - /// - /// Vostio-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember( - Name = "assa_abloy_vostio_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public ActionAttemptScanCredentialResultAcsCredentialOnSeamAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; set; } - - /// - /// Number of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "card_number", IsRequired = false, EmitDefaultValue = false)] - public string? CardNumber { get; set; } - - /// - /// Access (PIN) code for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// ID of the [connected account](https://docs.seam.co/core-concepts/connected-accounts) to which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name that corresponds to the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Errors associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. - /// - [DataMember(Name = "external_type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultAcsCredentialOnSeam.ExternalTypeEnum? ExternalType { get; set; } - - /// - /// Display name that corresponds to the brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. - /// - [DataMember( - Name = "external_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ExternalTypeDisplayName { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been encoded onto a card. - /// - [DataMember(Name = "is_issued", IsRequired = false, EmitDefaultValue = false)] - public bool? IsIssued { get; set; } - - /// - /// Indicates whether the latest state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been synced from Seam to the provider. - /// - [DataMember( - Name = "is_latest_desired_state_synced_with_provider", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsLatestDesiredStateSyncedWithProvider { get; set; } - - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). - /// - [DataMember( - Name = "is_multi_phone_sync_credential", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsMultiPhoneSyncCredential { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) can only be used once. If `true`, the code becomes invalid after the first use. - /// - [DataMember(Name = "is_one_time_use", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOneTimeUse { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was encoded onto a card. - /// - [DataMember(Name = "issued_at", IsRequired = false, EmitDefaultValue = false)] - public string? IssuedAt { get; set; } - - /// - /// Date and time at which the state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was most recently synced from Seam to the provider. - /// - [DataMember( - Name = "latest_desired_state_synced_with_provider_at", - IsRequired = false, - EmitDefaultValue = false - )] - public string? LatestDesiredStateSyncedWithProviderAt { get; set; } - - /// - /// ID of the parent [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember( - Name = "parent_acs_credential_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ParentAcsCredentialId { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// ID of the [user identity](https://docs.seam.co/api/user_identities) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "visionline_metadata", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata? VisionlineMetadata { get; set; } - - /// - /// Warnings associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_actionAttemptScanCredentialResultAcsCredentialOnSeamAkilesMetadata_model" - )] - public class ActionAttemptScanCredentialResultAcsCredentialOnSeamAkilesMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResultAcsCredentialOnSeamAkilesMetadata() { } - - public ActionAttemptScanCredentialResultAcsCredentialOnSeamAkilesMetadata( - string? memberPinId = default - ) - { - MemberPinId = memberPinId; - } - - /// - /// ID of the Akiles member PIN. - /// - [DataMember(Name = "member_pin_id", IsRequired = false, EmitDefaultValue = false)] - public string? MemberPinId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_actionAttemptScanCredentialResultAcsCredentialOnSeamAssaAbloyVostioMetadata_model" - )] - public class ActionAttemptScanCredentialResultAcsCredentialOnSeamAssaAbloyVostioMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResultAcsCredentialOnSeamAssaAbloyVostioMetadata() { } - - public ActionAttemptScanCredentialResultAcsCredentialOnSeamAssaAbloyVostioMetadata( - bool? autoJoin = default, - List? doorNames = default, - string? endpointId = default, - string? keyId = default, - string? keyIssuingRequestId = default, - List? overrideGuestAcsEntranceIds = default - ) - { - AutoJoin = autoJoin; - DoorNames = doorNames; - EndpointId = endpointId; - KeyId = keyId; - KeyIssuingRequestId = keyIssuingRequestId; - OverrideGuestAcsEntranceIds = overrideGuestAcsEntranceIds; - } - - /// - /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. - /// - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - /// - /// Names of the doors to which to grant access in the Vostio access system. - /// - [DataMember(Name = "door_names", IsRequired = false, EmitDefaultValue = false)] - public List? DoorNames { get; set; } - - /// - /// Endpoint ID in the Vostio access system. - /// - [DataMember(Name = "endpoint_id", IsRequired = false, EmitDefaultValue = false)] - public string? EndpointId { get; set; } - - /// - /// Key ID in the Vostio access system. - /// - [DataMember(Name = "key_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeyId { get; set; } - - /// - /// Key issuing request ID in the Vostio access system. - /// - [DataMember(Name = "key_issuing_request_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeyIssuingRequestId { get; set; } - - /// - /// IDs of the guest entrances to override in the Vostio access system. - /// - [DataMember( - Name = "override_guest_acs_entrance_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? OverrideGuestAcsEntranceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_actionAttemptScanCredentialResultAcsCredentialOnSeamErrors_model" - )] - public class ActionAttemptScanCredentialResultAcsCredentialOnSeamErrors - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResultAcsCredentialOnSeamErrors() { } - - public ActionAttemptScanCredentialResultAcsCredentialOnSeamErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_actionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata_model" - )] - public class ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata() { } - - public ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata( - bool? autoJoin = default, - ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata.CardFunctionTypeEnum? cardFunctionType = - default, - string? cardId = default, - List? commonAcsEntranceIds = default, - string? credentialId = default, - List? guestAcsEntranceIds = default, - bool? isValid = default, - List? joinerAcsCredentialIds = default - ) - { - AutoJoin = autoJoin; - CardFunctionType = cardFunctionType; - CardId = cardId; - CommonAcsEntranceIds = commonAcsEntranceIds; - CredentialId = credentialId; - GuestAcsEntranceIds = guestAcsEntranceIds; - IsValid = isValid; - JoinerAcsCredentialIds = joinerAcsCredentialIds; - } - - /// - /// Card function type in the Visionline access system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum CardFunctionTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "guest")] - Guest = 1, - - [EnumMember(Value = "staff")] - Staff = 2, - } - - /// - /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. - /// - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - /// - /// Card function type in the Visionline access system. - /// - [DataMember(Name = "card_function_type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; set; } - - /// - /// ID of the card in the Visionline access system. - /// - [DataMember(Name = "card_id", IsRequired = false, EmitDefaultValue = false)] - public string? CardId { get; set; } - - /// - /// Common entrance IDs in the Visionline access system. - /// - [DataMember(Name = "common_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAcsEntranceIds { get; set; } - - /// - /// ID of the credential in the Visionline access system. - /// - [DataMember(Name = "credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? CredentialId { get; set; } - - /// - /// Guest entrance IDs in the Visionline access system. - /// - [DataMember(Name = "guest_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? GuestAcsEntranceIds { get; set; } - - /// - /// Indicates whether the credential is valid. - /// - [DataMember(Name = "is_valid", IsRequired = false, EmitDefaultValue = false)] - public bool? IsValid { get; set; } - - /// - /// IDs of the credentials to which you want to join. - /// - [DataMember( - Name = "joiner_acs_credential_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? JoinerAcsCredentialIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_actionAttemptScanCredentialResultAcsCredentialOnSeamWarnings_model" - )] - public class ActionAttemptScanCredentialResultAcsCredentialOnSeamWarnings - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResultAcsCredentialOnSeamWarnings() { } - - public ActionAttemptScanCredentialResultAcsCredentialOnSeamWarnings( - string createdAt = default, - string message = default, - ActionAttemptScanCredentialResultAcsCredentialOnSeamWarnings.WarningCodeEnum warningCode = - default, - string? newCode = default, - string? originalCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - NewCode = newCode; - OriginalCode = originalCode; - } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum WarningCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "waiting_to_be_issued")] - WaitingToBeIssued = 1, - - [EnumMember(Value = "schedule_externally_modified")] - ScheduleExternallyModified = 2, - - [EnumMember(Value = "schedule_modified")] - ScheduleModified = 3, - - [EnumMember(Value = "being_deleted")] - BeingDeleted = 4, - - [EnumMember(Value = "unknown_issue_with_acs_credential")] - UnknownIssueWithAcsCredential = 5, - - [EnumMember(Value = "needs_to_be_reissued")] - NeedsToBeReissued = 6, - - [EnumMember(Value = "requested_code_unavailable")] - RequestedCodeUnavailable = 7, - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultAcsCredentialOnSeamWarnings.WarningCodeEnum WarningCode { get; set; } - - /// - /// The PIN code that was assigned instead. - /// - [DataMember(Name = "new_code", IsRequired = false, EmitDefaultValue = false)] - public string? NewCode { get; set; } - - /// - /// The originally requested PIN code that could not be used. - /// - [DataMember(Name = "original_code", IsRequired = false, EmitDefaultValue = false)] - public string? OriginalCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanCredentialResultWarnings_model")] - public class ActionAttemptScanCredentialResultWarnings - { - [JsonConstructorAttribute] - protected ActionAttemptScanCredentialResultWarnings() { } - - public ActionAttemptScanCredentialResultWarnings( - ActionAttemptScanCredentialResultWarnings.WarningCodeEnum warningCode = default, - string warningMessage = default - ) - { - WarningCode = warningCode; - WarningMessage = warningMessage; - } - - /// - /// Indicates a warning related to scanning a credential. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum WarningCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "acs_credential_on_encoder_out_of_sync")] - AcsCredentialOnEncoderOutOfSync = 1, - - [EnumMember(Value = "acs_credential_on_seam_not_found")] - AcsCredentialOnSeamNotFound = 2, - } - - /// - /// Indicates a warning related to scanning a credential. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanCredentialResultWarnings.WarningCodeEnum WarningCode { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "warning_message", IsRequired = false, EmitDefaultValue = false)] - public string WarningMessage { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Encoding credential data from the physical encoder onto a card is pending. - /// - [DataContract(Name = "seamModel_actionAttemptEncodeCredential_model")] - public class ActionAttemptEncodeCredential : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptEncodeCredential() { } - - public ActionAttemptEncodeCredential( - string actionAttemptId = default, - string actionType = default, - ActionAttemptEncodeCredentialError error = default, - ActionAttemptEncodeCredentialResult result = default, - ActionAttemptEncodeCredential.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "ENCODE_CREDENTIAL"; - - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredentialError Error { get; set; } - - /// - /// Result of an encoding attempt. If the attempt was successful, includes the credential data that was encoded onto the card. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredentialResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredential.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptEncodeCredentialError_model")] - public class ActionAttemptEncodeCredentialError - { - [JsonConstructorAttribute] - protected ActionAttemptEncodeCredentialError() { } - - public ActionAttemptEncodeCredentialError( - string message = default, - ActionAttemptEncodeCredentialError.TypeEnum type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Error type to indicate that the credential was deleted and can no longer be encoded. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum TypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "uncategorized_error")] - UncategorizedError = 1, - - [EnumMember(Value = "action_attempt_expired")] - ActionAttemptExpired = 2, - - [EnumMember(Value = "no_credential_on_encoder")] - NoCredentialOnEncoder = 3, - - [EnumMember(Value = "incompatible_card_format")] - IncompatibleCardFormat = 4, - - [EnumMember(Value = "credential_cannot_be_reissued")] - CredentialCannotBeReissued = 5, - - [EnumMember(Value = "encoder_not_online")] - EncoderNotOnline = 6, - - [EnumMember(Value = "encoder_communication_timeout")] - EncoderCommunicationTimeout = 7, - - [EnumMember(Value = "bridge_disconnected")] - BridgeDisconnected = 8, - - [EnumMember(Value = "encoding_interrupted")] - EncodingInterrupted = 9, - - [EnumMember(Value = "credential_deleted")] - CredentialDeleted = 10, - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Error type to indicate that the credential was deleted and can no longer be encoded. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredentialError.TypeEnum Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptEncodeCredentialResult_model")] - public class ActionAttemptEncodeCredentialResult - { - [JsonConstructorAttribute] - protected ActionAttemptEncodeCredentialResult() { } - - public ActionAttemptEncodeCredentialResult( - ActionAttemptEncodeCredentialResult.AccessMethodEnum accessMethod = default, - string acsCredentialId = default, - string? acsCredentialPoolId = default, - string acsSystemId = default, - string? acsUserId = default, - ActionAttemptEncodeCredentialResultAkilesMetadata? akilesMetadata = default, - ActionAttemptEncodeCredentialResultAssaAbloyVostioMetadata? assaAbloyVostioMetadata = - default, - string? cardNumber = default, - string? code = default, - string connectedAccountId = default, - string createdAt = default, - string displayName = default, - string? endsAt = default, - List errors = default, - ActionAttemptEncodeCredentialResult.ExternalTypeEnum? externalType = default, - string? externalTypeDisplayName = default, - bool? isIssued = default, - bool? isLatestDesiredStateSyncedWithProvider = default, - bool isManaged = default, - bool? isMultiPhoneSyncCredential = default, - bool? isOneTimeUse = default, - string? issuedAt = default, - string? latestDesiredStateSyncedWithProviderAt = default, - string? parentAcsCredentialId = default, - string? startsAt = default, - string? userIdentityId = default, - ActionAttemptEncodeCredentialResultVisionlineMetadata? visionlineMetadata = default, - List warnings = default, - string workspaceId = default - ) - { - AccessMethod = accessMethod; - AcsCredentialId = acsCredentialId; - AcsCredentialPoolId = acsCredentialPoolId; - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - AkilesMetadata = akilesMetadata; - AssaAbloyVostioMetadata = assaAbloyVostioMetadata; - CardNumber = cardNumber; - Code = code; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DisplayName = displayName; - EndsAt = endsAt; - Errors = errors; - ExternalType = externalType; - ExternalTypeDisplayName = externalTypeDisplayName; - IsIssued = isIssued; - IsLatestDesiredStateSyncedWithProvider = isLatestDesiredStateSyncedWithProvider; - IsManaged = isManaged; - IsMultiPhoneSyncCredential = isMultiPhoneSyncCredential; - IsOneTimeUse = isOneTimeUse; - IssuedAt = issuedAt; - LatestDesiredStateSyncedWithProviderAt = latestDesiredStateSyncedWithProviderAt; - ParentAcsCredentialId = parentAcsCredentialId; - StartsAt = startsAt; - UserIdentityId = userIdentityId; - VisionlineMetadata = visionlineMetadata; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - /// - /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AccessMethodEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExternalTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "pti_card")] - PtiCard = 1, - - [EnumMember(Value = "brivo_credential")] - BrivoCredential = 2, - - [EnumMember(Value = "hid_credential")] - HidCredential = 3, - - [EnumMember(Value = "visionline_card")] - VisionlineCard = 4, - - [EnumMember(Value = "salto_ks_credential")] - SaltoKsCredential = 5, - - [EnumMember(Value = "assa_abloy_vostio_key")] - AssaAbloyVostioKey = 6, - - [EnumMember(Value = "salto_space_key")] - SaltoSpaceKey = 7, - - [EnumMember(Value = "latch_access")] - LatchAccess = 8, - - [EnumMember(Value = "dormakaba_ambiance_credential")] - DormakabaAmbianceCredential = 9, - - [EnumMember(Value = "hotek_card")] - HotekCard = 10, - - [EnumMember(Value = "salto_ks_tag")] - SaltoKsTag = 11, - - [EnumMember(Value = "avigilon_alta_credential")] - AvigilonAltaCredential = 12, - - [EnumMember(Value = "kisi_credential")] - KisiCredential = 13, - - [EnumMember(Value = "akiles_credential")] - AkilesCredential = 14, - } - - /// - /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "access_method", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredentialResult.AccessMethodEnum AccessMethod { get; set; } - - /// - /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the credential pool to which the credential belongs. - /// - [DataMember(Name = "acs_credential_pool_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialPoolId { get; set; } - - /// - /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// Akiles-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "akiles_metadata", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredentialResultAkilesMetadata? AkilesMetadata { get; set; } - - /// - /// Vostio-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember( - Name = "assa_abloy_vostio_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public ActionAttemptEncodeCredentialResultAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; set; } - - /// - /// Number of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "card_number", IsRequired = false, EmitDefaultValue = false)] - public string? CardNumber { get; set; } - - /// - /// Access (PIN) code for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// ID of the [connected account](https://docs.seam.co/core-concepts/connected-accounts) to which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name that corresponds to the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Errors associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. - /// - [DataMember(Name = "external_type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredentialResult.ExternalTypeEnum? ExternalType { get; set; } - - /// - /// Display name that corresponds to the brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. - /// - [DataMember( - Name = "external_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ExternalTypeDisplayName { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been encoded onto a card. - /// - [DataMember(Name = "is_issued", IsRequired = false, EmitDefaultValue = false)] - public bool? IsIssued { get; set; } - - /// - /// Indicates whether the latest state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been synced from Seam to the provider. - /// - [DataMember( - Name = "is_latest_desired_state_synced_with_provider", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsLatestDesiredStateSyncedWithProvider { get; set; } - - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). - /// - [DataMember( - Name = "is_multi_phone_sync_credential", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsMultiPhoneSyncCredential { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) can only be used once. If `true`, the code becomes invalid after the first use. - /// - [DataMember(Name = "is_one_time_use", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOneTimeUse { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was encoded onto a card. - /// - [DataMember(Name = "issued_at", IsRequired = false, EmitDefaultValue = false)] - public string? IssuedAt { get; set; } - - /// - /// Date and time at which the state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was most recently synced from Seam to the provider. - /// - [DataMember( - Name = "latest_desired_state_synced_with_provider_at", - IsRequired = false, - EmitDefaultValue = false - )] - public string? LatestDesiredStateSyncedWithProviderAt { get; set; } - - /// - /// ID of the parent [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember( - Name = "parent_acs_credential_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ParentAcsCredentialId { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// ID of the [user identity](https://docs.seam.co/api/user_identities) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "visionline_metadata", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredentialResultVisionlineMetadata? VisionlineMetadata { get; set; } - - /// - /// Warnings associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptEncodeCredentialResultAkilesMetadata_model")] - public class ActionAttemptEncodeCredentialResultAkilesMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptEncodeCredentialResultAkilesMetadata() { } - - public ActionAttemptEncodeCredentialResultAkilesMetadata(string? memberPinId = default) - { - MemberPinId = memberPinId; - } - - /// - /// ID of the Akiles member PIN. - /// - [DataMember(Name = "member_pin_id", IsRequired = false, EmitDefaultValue = false)] - public string? MemberPinId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_actionAttemptEncodeCredentialResultAssaAbloyVostioMetadata_model" - )] - public class ActionAttemptEncodeCredentialResultAssaAbloyVostioMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptEncodeCredentialResultAssaAbloyVostioMetadata() { } - - public ActionAttemptEncodeCredentialResultAssaAbloyVostioMetadata( - bool? autoJoin = default, - List? doorNames = default, - string? endpointId = default, - string? keyId = default, - string? keyIssuingRequestId = default, - List? overrideGuestAcsEntranceIds = default - ) - { - AutoJoin = autoJoin; - DoorNames = doorNames; - EndpointId = endpointId; - KeyId = keyId; - KeyIssuingRequestId = keyIssuingRequestId; - OverrideGuestAcsEntranceIds = overrideGuestAcsEntranceIds; - } - - /// - /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. - /// - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - /// - /// Names of the doors to which to grant access in the Vostio access system. - /// - [DataMember(Name = "door_names", IsRequired = false, EmitDefaultValue = false)] - public List? DoorNames { get; set; } - - /// - /// Endpoint ID in the Vostio access system. - /// - [DataMember(Name = "endpoint_id", IsRequired = false, EmitDefaultValue = false)] - public string? EndpointId { get; set; } - - /// - /// Key ID in the Vostio access system. - /// - [DataMember(Name = "key_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeyId { get; set; } - - /// - /// Key issuing request ID in the Vostio access system. - /// - [DataMember(Name = "key_issuing_request_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeyIssuingRequestId { get; set; } - - /// - /// IDs of the guest entrances to override in the Vostio access system. - /// - [DataMember( - Name = "override_guest_acs_entrance_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? OverrideGuestAcsEntranceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptEncodeCredentialResultErrors_model")] - public class ActionAttemptEncodeCredentialResultErrors - { - [JsonConstructorAttribute] - protected ActionAttemptEncodeCredentialResultErrors() { } - - public ActionAttemptEncodeCredentialResultErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptEncodeCredentialResultVisionlineMetadata_model")] - public class ActionAttemptEncodeCredentialResultVisionlineMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptEncodeCredentialResultVisionlineMetadata() { } - - public ActionAttemptEncodeCredentialResultVisionlineMetadata( - bool? autoJoin = default, - ActionAttemptEncodeCredentialResultVisionlineMetadata.CardFunctionTypeEnum? cardFunctionType = - default, - string? cardId = default, - List? commonAcsEntranceIds = default, - string? credentialId = default, - List? guestAcsEntranceIds = default, - bool? isValid = default, - List? joinerAcsCredentialIds = default - ) - { - AutoJoin = autoJoin; - CardFunctionType = cardFunctionType; - CardId = cardId; - CommonAcsEntranceIds = commonAcsEntranceIds; - CredentialId = credentialId; - GuestAcsEntranceIds = guestAcsEntranceIds; - IsValid = isValid; - JoinerAcsCredentialIds = joinerAcsCredentialIds; - } - - /// - /// Card function type in the Visionline access system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum CardFunctionTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "guest")] - Guest = 1, - - [EnumMember(Value = "staff")] - Staff = 2, - } - - /// - /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. - /// - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - /// - /// Card function type in the Visionline access system. - /// - [DataMember(Name = "card_function_type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredentialResultVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; set; } - - /// - /// ID of the card in the Visionline access system. - /// - [DataMember(Name = "card_id", IsRequired = false, EmitDefaultValue = false)] - public string? CardId { get; set; } - - /// - /// Common entrance IDs in the Visionline access system. - /// - [DataMember(Name = "common_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAcsEntranceIds { get; set; } - - /// - /// ID of the credential in the Visionline access system. - /// - [DataMember(Name = "credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? CredentialId { get; set; } - - /// - /// Guest entrance IDs in the Visionline access system. - /// - [DataMember(Name = "guest_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? GuestAcsEntranceIds { get; set; } - - /// - /// Indicates whether the credential is valid. - /// - [DataMember(Name = "is_valid", IsRequired = false, EmitDefaultValue = false)] - public bool? IsValid { get; set; } - - /// - /// IDs of the credentials to which you want to join. - /// - [DataMember( - Name = "joiner_acs_credential_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? JoinerAcsCredentialIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptEncodeCredentialResultWarnings_model")] - public class ActionAttemptEncodeCredentialResultWarnings - { - [JsonConstructorAttribute] - protected ActionAttemptEncodeCredentialResultWarnings() { } - - public ActionAttemptEncodeCredentialResultWarnings( - string createdAt = default, - string message = default, - ActionAttemptEncodeCredentialResultWarnings.WarningCodeEnum warningCode = default, - string? newCode = default, - string? originalCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - NewCode = newCode; - OriginalCode = originalCode; - } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum WarningCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "waiting_to_be_issued")] - WaitingToBeIssued = 1, - - [EnumMember(Value = "schedule_externally_modified")] - ScheduleExternallyModified = 2, - - [EnumMember(Value = "schedule_modified")] - ScheduleModified = 3, - - [EnumMember(Value = "being_deleted")] - BeingDeleted = 4, - - [EnumMember(Value = "unknown_issue_with_acs_credential")] - UnknownIssueWithAcsCredential = 5, - - [EnumMember(Value = "needs_to_be_reissued")] - NeedsToBeReissued = 6, - - [EnumMember(Value = "requested_code_unavailable")] - RequestedCodeUnavailable = 7, - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptEncodeCredentialResultWarnings.WarningCodeEnum WarningCode { get; set; } - - /// - /// The PIN code that was assigned instead. - /// - [DataMember(Name = "new_code", IsRequired = false, EmitDefaultValue = false)] - public string? NewCode { get; set; } - - /// - /// The originally requested PIN code that could not be used. - /// - [DataMember(Name = "original_code", IsRequired = false, EmitDefaultValue = false)] - public string? OriginalCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Scanning a physical card and assigning the credential is pending. - /// - [DataContract(Name = "seamModel_actionAttemptScanToAssignCredential_model")] - public class ActionAttemptScanToAssignCredential : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptScanToAssignCredential() { } - - public ActionAttemptScanToAssignCredential( - string actionAttemptId = default, - string actionType = default, - ActionAttemptScanToAssignCredentialError error = default, - ActionAttemptScanToAssignCredentialResult result = default, - ActionAttemptScanToAssignCredential.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "SCAN_TO_ASSIGN_CREDENTIAL"; - - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredentialError Error { get; set; } - - /// - /// Result of a scan to assign attempt. If the attempt was successful, includes the credential data that was scanned and assigned. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredentialResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredential.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanToAssignCredentialError_model")] - public class ActionAttemptScanToAssignCredentialError - { - [JsonConstructorAttribute] - protected ActionAttemptScanToAssignCredentialError() { } - - public ActionAttemptScanToAssignCredentialError( - string message = default, - ActionAttemptScanToAssignCredentialError.TypeEnum type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Error type to indicate that there is no credential on the encoder. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum TypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "uncategorized_error")] - UncategorizedError = 1, - - [EnumMember(Value = "action_attempt_expired")] - ActionAttemptExpired = 2, - - [EnumMember(Value = "no_credential_on_encoder")] - NoCredentialOnEncoder = 3, - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Error type to indicate that there is no credential on the encoder. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredentialError.TypeEnum Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanToAssignCredentialResult_model")] - public class ActionAttemptScanToAssignCredentialResult - { - [JsonConstructorAttribute] - protected ActionAttemptScanToAssignCredentialResult() { } - - public ActionAttemptScanToAssignCredentialResult( - ActionAttemptScanToAssignCredentialResult.AccessMethodEnum accessMethod = default, - string acsCredentialId = default, - string? acsCredentialPoolId = default, - string acsSystemId = default, - string? acsUserId = default, - ActionAttemptScanToAssignCredentialResultAkilesMetadata? akilesMetadata = default, - ActionAttemptScanToAssignCredentialResultAssaAbloyVostioMetadata? assaAbloyVostioMetadata = - default, - string? cardNumber = default, - string? code = default, - string connectedAccountId = default, - string createdAt = default, - string displayName = default, - string? endsAt = default, - List errors = default, - ActionAttemptScanToAssignCredentialResult.ExternalTypeEnum? externalType = default, - string? externalTypeDisplayName = default, - bool? isIssued = default, - bool? isLatestDesiredStateSyncedWithProvider = default, - bool isManaged = default, - bool? isMultiPhoneSyncCredential = default, - bool? isOneTimeUse = default, - string? issuedAt = default, - string? latestDesiredStateSyncedWithProviderAt = default, - string? parentAcsCredentialId = default, - string? startsAt = default, - string? userIdentityId = default, - ActionAttemptScanToAssignCredentialResultVisionlineMetadata? visionlineMetadata = - default, - List warnings = default, - string workspaceId = default - ) - { - AccessMethod = accessMethod; - AcsCredentialId = acsCredentialId; - AcsCredentialPoolId = acsCredentialPoolId; - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - AkilesMetadata = akilesMetadata; - AssaAbloyVostioMetadata = assaAbloyVostioMetadata; - CardNumber = cardNumber; - Code = code; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DisplayName = displayName; - EndsAt = endsAt; - Errors = errors; - ExternalType = externalType; - ExternalTypeDisplayName = externalTypeDisplayName; - IsIssued = isIssued; - IsLatestDesiredStateSyncedWithProvider = isLatestDesiredStateSyncedWithProvider; - IsManaged = isManaged; - IsMultiPhoneSyncCredential = isMultiPhoneSyncCredential; - IsOneTimeUse = isOneTimeUse; - IssuedAt = issuedAt; - LatestDesiredStateSyncedWithProviderAt = latestDesiredStateSyncedWithProviderAt; - ParentAcsCredentialId = parentAcsCredentialId; - StartsAt = startsAt; - UserIdentityId = userIdentityId; - VisionlineMetadata = visionlineMetadata; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - /// - /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AccessMethodEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ExternalTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "pti_card")] - PtiCard = 1, - - [EnumMember(Value = "brivo_credential")] - BrivoCredential = 2, - - [EnumMember(Value = "hid_credential")] - HidCredential = 3, - - [EnumMember(Value = "visionline_card")] - VisionlineCard = 4, - - [EnumMember(Value = "salto_ks_credential")] - SaltoKsCredential = 5, - - [EnumMember(Value = "assa_abloy_vostio_key")] - AssaAbloyVostioKey = 6, - - [EnumMember(Value = "salto_space_key")] - SaltoSpaceKey = 7, - - [EnumMember(Value = "latch_access")] - LatchAccess = 8, - - [EnumMember(Value = "dormakaba_ambiance_credential")] - DormakabaAmbianceCredential = 9, - - [EnumMember(Value = "hotek_card")] - HotekCard = 10, - - [EnumMember(Value = "salto_ks_tag")] - SaltoKsTag = 11, - - [EnumMember(Value = "avigilon_alta_credential")] - AvigilonAltaCredential = 12, - - [EnumMember(Value = "kisi_credential")] - KisiCredential = 13, - - [EnumMember(Value = "akiles_credential")] - AkilesCredential = 14, - } - - /// - /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "access_method", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredentialResult.AccessMethodEnum AccessMethod { get; set; } - - /// - /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the credential pool to which the credential belongs. - /// - [DataMember(Name = "acs_credential_pool_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialPoolId { get; set; } - - /// - /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } - - /// - /// Akiles-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "akiles_metadata", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredentialResultAkilesMetadata? AkilesMetadata { get; set; } - - /// - /// Vostio-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember( - Name = "assa_abloy_vostio_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public ActionAttemptScanToAssignCredentialResultAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; set; } - - /// - /// Number of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "card_number", IsRequired = false, EmitDefaultValue = false)] - public string? CardNumber { get; set; } - - /// - /// Access (PIN) code for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// ID of the [connected account](https://docs.seam.co/core-concepts/connected-accounts) to which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name that corresponds to the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Errors associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. - /// - [DataMember(Name = "external_type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredentialResult.ExternalTypeEnum? ExternalType { get; set; } - - /// - /// Display name that corresponds to the brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. - /// - [DataMember( - Name = "external_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ExternalTypeDisplayName { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been encoded onto a card. - /// - [DataMember(Name = "is_issued", IsRequired = false, EmitDefaultValue = false)] - public bool? IsIssued { get; set; } - - /// - /// Indicates whether the latest state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been synced from Seam to the provider. - /// - [DataMember( - Name = "is_latest_desired_state_synced_with_provider", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsLatestDesiredStateSyncedWithProvider { get; set; } - - /// - /// Indicates whether Seam manages the credential. - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). - /// - [DataMember( - Name = "is_multi_phone_sync_credential", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsMultiPhoneSyncCredential { get; set; } - - /// - /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) can only be used once. If `true`, the code becomes invalid after the first use. - /// - [DataMember(Name = "is_one_time_use", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOneTimeUse { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was encoded onto a card. - /// - [DataMember(Name = "issued_at", IsRequired = false, EmitDefaultValue = false)] - public string? IssuedAt { get; set; } - - /// - /// Date and time at which the state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was most recently synced from Seam to the provider. - /// - [DataMember( - Name = "latest_desired_state_synced_with_provider_at", - IsRequired = false, - EmitDefaultValue = false - )] - public string? LatestDesiredStateSyncedWithProviderAt { get; set; } - - /// - /// ID of the parent [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember( - Name = "parent_acs_credential_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ParentAcsCredentialId { get; set; } - - /// - /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// ID of the [user identity](https://docs.seam.co/api/user_identities) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "visionline_metadata", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredentialResultVisionlineMetadata? VisionlineMetadata { get; set; } - - /// - /// Warnings associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanToAssignCredentialResultAkilesMetadata_model")] - public class ActionAttemptScanToAssignCredentialResultAkilesMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptScanToAssignCredentialResultAkilesMetadata() { } - - public ActionAttemptScanToAssignCredentialResultAkilesMetadata( - string? memberPinId = default - ) - { - MemberPinId = memberPinId; - } - - /// - /// ID of the Akiles member PIN. - /// - [DataMember(Name = "member_pin_id", IsRequired = false, EmitDefaultValue = false)] - public string? MemberPinId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_actionAttemptScanToAssignCredentialResultAssaAbloyVostioMetadata_model" - )] - public class ActionAttemptScanToAssignCredentialResultAssaAbloyVostioMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptScanToAssignCredentialResultAssaAbloyVostioMetadata() { } - - public ActionAttemptScanToAssignCredentialResultAssaAbloyVostioMetadata( - bool? autoJoin = default, - List? doorNames = default, - string? endpointId = default, - string? keyId = default, - string? keyIssuingRequestId = default, - List? overrideGuestAcsEntranceIds = default - ) - { - AutoJoin = autoJoin; - DoorNames = doorNames; - EndpointId = endpointId; - KeyId = keyId; - KeyIssuingRequestId = keyIssuingRequestId; - OverrideGuestAcsEntranceIds = overrideGuestAcsEntranceIds; - } - - /// - /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. - /// - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - /// - /// Names of the doors to which to grant access in the Vostio access system. - /// - [DataMember(Name = "door_names", IsRequired = false, EmitDefaultValue = false)] - public List? DoorNames { get; set; } - - /// - /// Endpoint ID in the Vostio access system. - /// - [DataMember(Name = "endpoint_id", IsRequired = false, EmitDefaultValue = false)] - public string? EndpointId { get; set; } - - /// - /// Key ID in the Vostio access system. - /// - [DataMember(Name = "key_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeyId { get; set; } - - /// - /// Key issuing request ID in the Vostio access system. - /// - [DataMember(Name = "key_issuing_request_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeyIssuingRequestId { get; set; } - - /// - /// IDs of the guest entrances to override in the Vostio access system. - /// - [DataMember( - Name = "override_guest_acs_entrance_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? OverrideGuestAcsEntranceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanToAssignCredentialResultErrors_model")] - public class ActionAttemptScanToAssignCredentialResultErrors - { - [JsonConstructorAttribute] - protected ActionAttemptScanToAssignCredentialResultErrors() { } - - public ActionAttemptScanToAssignCredentialResultErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_actionAttemptScanToAssignCredentialResultVisionlineMetadata_model" - )] - public class ActionAttemptScanToAssignCredentialResultVisionlineMetadata - { - [JsonConstructorAttribute] - protected ActionAttemptScanToAssignCredentialResultVisionlineMetadata() { } - - public ActionAttemptScanToAssignCredentialResultVisionlineMetadata( - bool? autoJoin = default, - ActionAttemptScanToAssignCredentialResultVisionlineMetadata.CardFunctionTypeEnum? cardFunctionType = - default, - string? cardId = default, - List? commonAcsEntranceIds = default, - string? credentialId = default, - List? guestAcsEntranceIds = default, - bool? isValid = default, - List? joinerAcsCredentialIds = default - ) - { - AutoJoin = autoJoin; - CardFunctionType = cardFunctionType; - CardId = cardId; - CommonAcsEntranceIds = commonAcsEntranceIds; - CredentialId = credentialId; - GuestAcsEntranceIds = guestAcsEntranceIds; - IsValid = isValid; - JoinerAcsCredentialIds = joinerAcsCredentialIds; - } - - /// - /// Card function type in the Visionline access system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum CardFunctionTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "guest")] - Guest = 1, - - [EnumMember(Value = "staff")] - Staff = 2, - } - - /// - /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. - /// - [DataMember(Name = "auto_join", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoJoin { get; set; } - - /// - /// Card function type in the Visionline access system. - /// - [DataMember(Name = "card_function_type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredentialResultVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; set; } - - /// - /// ID of the card in the Visionline access system. - /// - [DataMember(Name = "card_id", IsRequired = false, EmitDefaultValue = false)] - public string? CardId { get; set; } - - /// - /// Common entrance IDs in the Visionline access system. - /// - [DataMember(Name = "common_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? CommonAcsEntranceIds { get; set; } - - /// - /// ID of the credential in the Visionline access system. - /// - [DataMember(Name = "credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? CredentialId { get; set; } - - /// - /// Guest entrance IDs in the Visionline access system. - /// - [DataMember(Name = "guest_acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List? GuestAcsEntranceIds { get; set; } - - /// - /// Indicates whether the credential is valid. - /// - [DataMember(Name = "is_valid", IsRequired = false, EmitDefaultValue = false)] - public bool? IsValid { get; set; } - - /// - /// IDs of the credentials to which you want to join. - /// - [DataMember( - Name = "joiner_acs_credential_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? JoinerAcsCredentialIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptScanToAssignCredentialResultWarnings_model")] - public class ActionAttemptScanToAssignCredentialResultWarnings - { - [JsonConstructorAttribute] - protected ActionAttemptScanToAssignCredentialResultWarnings() { } - - public ActionAttemptScanToAssignCredentialResultWarnings( - string createdAt = default, - string message = default, - ActionAttemptScanToAssignCredentialResultWarnings.WarningCodeEnum warningCode = default, - string? newCode = default, - string? originalCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - NewCode = newCode; - OriginalCode = originalCode; - } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum WarningCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "waiting_to_be_issued")] - WaitingToBeIssued = 1, - - [EnumMember(Value = "schedule_externally_modified")] - ScheduleExternallyModified = 2, - - [EnumMember(Value = "schedule_modified")] - ScheduleModified = 3, - - [EnumMember(Value = "being_deleted")] - BeingDeleted = 4, - - [EnumMember(Value = "unknown_issue_with_acs_credential")] - UnknownIssueWithAcsCredential = 5, - - [EnumMember(Value = "needs_to_be_reissued")] - NeedsToBeReissued = 6, - - [EnumMember(Value = "requested_code_unavailable")] - RequestedCodeUnavailable = 7, - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptScanToAssignCredentialResultWarnings.WarningCodeEnum WarningCode { get; set; } - - /// - /// The PIN code that was assigned instead. - /// - [DataMember(Name = "new_code", IsRequired = false, EmitDefaultValue = false)] - public string? NewCode { get; set; } - - /// - /// The originally requested PIN code that could not be used. - /// - [DataMember(Name = "original_code", IsRequired = false, EmitDefaultValue = false)] - public string? OriginalCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Assigning a credential to an access method is pending. - /// - [DataContract(Name = "seamModel_actionAttemptAssignCredential_model")] - public class ActionAttemptAssignCredential : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptAssignCredential() { } - - public ActionAttemptAssignCredential( - string actionAttemptId = default, - string actionType = default, - ActionAttemptAssignCredentialError error = default, - ActionAttemptAssignCredentialResult result = default, - ActionAttemptAssignCredential.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "ASSIGN_CREDENTIAL"; - - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredentialError Error { get; set; } - - /// - /// Result of assigning a credential. If successful, includes the updated access method with the assigned credential. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredentialResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredential.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptAssignCredentialError_model")] - public class ActionAttemptAssignCredentialError - { - [JsonConstructorAttribute] - protected ActionAttemptAssignCredentialError() { } - - public ActionAttemptAssignCredentialError( - string message = default, - ActionAttemptAssignCredentialError.TypeEnum type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Error type to indicate that no matching credential was found. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum TypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "uncategorized_error")] - UncategorizedError = 1, - - [EnumMember(Value = "action_attempt_expired")] - ActionAttemptExpired = 2, - - [EnumMember(Value = "credential_not_found")] - CredentialNotFound = 3, - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Error type to indicate that no matching credential was found. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredentialError.TypeEnum Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptAssignCredentialResult_model")] - public class ActionAttemptAssignCredentialResult - { - [JsonConstructorAttribute] - protected ActionAttemptAssignCredentialResult() { } - - public ActionAttemptAssignCredentialResult( - string accessMethodId = default, - string? clientSessionToken = default, - string? code = default, - string createdAt = default, - string? customizationProfileId = default, - string displayName = default, - string displayStatus = default, - List errors = default, - string? instantKeyUrl = default, - bool? isAssignmentRequired = default, - bool? isEncodingRequired = default, - bool isIssued = default, - bool? isReadyForAssignment = default, - bool? isReadyForEncoding = default, - string? issuedAt = default, - ActionAttemptAssignCredentialResult.ModeEnum mode = default, - List pendingMutations = default, - List warnings = default, - string workspaceId = default - ) - { - AccessMethodId = accessMethodId; - ClientSessionToken = clientSessionToken; - Code = code; - CreatedAt = createdAt; - CustomizationProfileId = customizationProfileId; - DisplayName = displayName; - DisplayStatus = displayStatus; - Errors = errors; - InstantKeyUrl = instantKeyUrl; - IsAssignmentRequired = isAssignmentRequired; - IsEncodingRequired = isEncodingRequired; - IsIssued = isIssued; - IsReadyForAssignment = isReadyForAssignment; - IsReadyForEncoding = isReadyForEncoding; - IssuedAt = issuedAt; - Mode = mode; - PendingMutations = pendingMutations; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// ID of the access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// Token of the client session associated with the access method. - /// - [DataMember(Name = "client_session_token", IsRequired = false, EmitDefaultValue = false)] - public string? ClientSessionToken { get; set; } - - /// - /// The actual PIN code for code access methods. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Date and time at which the access method was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// ID of the customization profile associated with the access method. - /// - [DataMember( - Name = "customization_profile_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomizationProfileId { get; set; } - - /// - /// Display name of the access method. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Human-readable sentence describing where the access method sits in its relationship with the device or access system, for example `Awaiting encoding`. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read `is_issued`, `errors`, and `pending_mutations`. - /// - [DataMember(Name = "display_status", IsRequired = false, EmitDefaultValue = false)] - public string DisplayStatus { get; set; } - - /// - /// Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// URL of the Instant Key for mobile key access methods. - /// - [DataMember(Name = "instant_key_url", IsRequired = false, EmitDefaultValue = false)] - public string? InstantKeyUrl { get; set; } - - /// - /// Indicates whether an existing card credential must be assigned to this access method before it can be issued. Only applies to card-mode access methods on systems that support credential assignment. - /// - [DataMember(Name = "is_assignment_required", IsRequired = false, EmitDefaultValue = false)] - public bool? IsAssignmentRequired { get; set; } - - /// - /// Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method. - /// - [DataMember(Name = "is_encoding_required", IsRequired = false, EmitDefaultValue = false)] - public bool? IsEncodingRequired { get; set; } - - /// - /// Indicates whether the access method has been issued. - /// - [DataMember(Name = "is_issued", IsRequired = false, EmitDefaultValue = false)] - public bool IsIssued { get; set; } - - /// - /// Indicates whether the access method is ready for card assignment. This is true when the access method is in card mode, has not yet been issued, and the system supports credential assignment. - /// - [DataMember(Name = "is_ready_for_assignment", IsRequired = false, EmitDefaultValue = false)] - public bool? IsReadyForAssignment { get; set; } - - /// - /// Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. - /// - [DataMember(Name = "is_ready_for_encoding", IsRequired = false, EmitDefaultValue = false)] - public bool? IsReadyForEncoding { get; set; } - - /// - /// Date and time at which the access method was issued. - /// - [DataMember(Name = "issued_at", IsRequired = false, EmitDefaultValue = false)] - public string? IssuedAt { get; set; } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "mode", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredentialResult.ModeEnum Mode { get; set; } - - /// - /// Pending mutations for the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). Indicates operations that are in progress. - /// - [DataMember(Name = "pending_mutations", IsRequired = false, EmitDefaultValue = false)] - public List PendingMutations { get; set; } - - /// - /// Warnings associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the Seam workspace associated with the access method. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptAssignCredentialResultErrors_model")] - public class ActionAttemptAssignCredentialResultErrors - { - [JsonConstructorAttribute] - protected ActionAttemptAssignCredentialResultErrors() { } - - public ActionAttemptAssignCredentialResultErrors( - string createdAt = default, - ActionAttemptAssignCredentialResultErrors.ErrorCodeEnum errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ErrorCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "failed_to_issue")] - FailedToIssue = 1, - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredentialResultErrors.ErrorCodeEnum ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptAssignCredentialResultPendingMutations_model")] - public class ActionAttemptAssignCredentialResultPendingMutations - { - [JsonConstructorAttribute] - protected ActionAttemptAssignCredentialResultPendingMutations() { } - - public ActionAttemptAssignCredentialResultPendingMutations( - string createdAt = default, - ActionAttemptAssignCredentialResultPendingMutationsFrom from = default, - string message = default, - ActionAttemptAssignCredentialResultPendingMutations.MutationCodeEnum mutationCode = - default, - ActionAttemptAssignCredentialResultPendingMutationsTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Mutation code to indicate that Seam is in the process of updating the access times for this access method. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum MutationCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "provisioning_access")] - ProvisioningAccess = 1, - - [EnumMember(Value = "revoking_access")] - RevokingAccess = 2, - - [EnumMember(Value = "updating_access_times")] - UpdatingAccessTimes = 3, - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Previous access time configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredentialResultPendingMutationsFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Mutation code to indicate that Seam is in the process of updating the access times for this access method. - /// - [DataMember(Name = "mutation_code", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredentialResultPendingMutations.MutationCodeEnum MutationCode { get; set; } - - /// - /// New access time configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredentialResultPendingMutationsTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptAssignCredentialResultPendingMutationsFrom_model")] - public class ActionAttemptAssignCredentialResultPendingMutationsFrom - { - [JsonConstructorAttribute] - protected ActionAttemptAssignCredentialResultPendingMutationsFrom() { } - - public ActionAttemptAssignCredentialResultPendingMutationsFrom( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Previous end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Previous start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptAssignCredentialResultPendingMutationsTo_model")] - public class ActionAttemptAssignCredentialResultPendingMutationsTo - { - [JsonConstructorAttribute] - protected ActionAttemptAssignCredentialResultPendingMutationsTo() { } - - public ActionAttemptAssignCredentialResultPendingMutationsTo( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// New end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// New start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptAssignCredentialResultWarnings_model")] - public class ActionAttemptAssignCredentialResultWarnings - { - [JsonConstructorAttribute] - protected ActionAttemptAssignCredentialResultWarnings() { } - - public ActionAttemptAssignCredentialResultWarnings( - string createdAt = default, - string message = default, - ActionAttemptAssignCredentialResultWarnings.WarningCodeEnum warningCode = default, - string? originalAccessMethodId = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - OriginalAccessMethodId = originalAccessMethodId; - } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum WarningCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "being_deleted")] - BeingDeleted = 1, - - [EnumMember(Value = "updating_access_times")] - UpdatingAccessTimes = 2, - - [EnumMember(Value = "pulled_backup_access_code")] - PulledBackupAccessCode = 3, - - [EnumMember(Value = "delay_in_issuing")] - DelayInIssuing = 4, - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptAssignCredentialResultWarnings.WarningCodeEnum WarningCode { get; set; } - - /// - /// ID of the original access method from which this backup access method was split, if applicable. - /// - [DataMember( - Name = "original_access_method_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? OriginalAccessMethodId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Resetting a sandbox workspace is pending. - /// - [DataContract(Name = "seamModel_actionAttemptResetSandboxWorkspace_model")] - public class ActionAttemptResetSandboxWorkspace : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptResetSandboxWorkspace() { } - - public ActionAttemptResetSandboxWorkspace( - string actionAttemptId = default, - string actionType = default, - ActionAttemptResetSandboxWorkspaceError error = default, - ActionAttemptResetSandboxWorkspaceResult result = default, - ActionAttemptResetSandboxWorkspace.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "RESET_SANDBOX_WORKSPACE"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptResetSandboxWorkspaceError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptResetSandboxWorkspaceResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptResetSandboxWorkspace.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptResetSandboxWorkspaceError_model")] - public class ActionAttemptResetSandboxWorkspaceError - { - [JsonConstructorAttribute] - protected ActionAttemptResetSandboxWorkspaceError() { } - - public ActionAttemptResetSandboxWorkspaceError( - string message = default, - string type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptResetSandboxWorkspaceResult_model")] - public class ActionAttemptResetSandboxWorkspaceResult - { - [JsonConstructorAttribute] - public ActionAttemptResetSandboxWorkspaceResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Setting the fan mode is pending. - /// - [DataContract(Name = "seamModel_actionAttemptSetFanMode_model")] - public class ActionAttemptSetFanMode : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptSetFanMode() { } - - public ActionAttemptSetFanMode( - string actionAttemptId = default, - string actionType = default, - ActionAttemptSetFanModeError error = default, - ActionAttemptSetFanModeResult result = default, - ActionAttemptSetFanMode.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "SET_FAN_MODE"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSetFanModeError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSetFanModeResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSetFanMode.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSetFanModeError_model")] - public class ActionAttemptSetFanModeError - { - [JsonConstructorAttribute] - protected ActionAttemptSetFanModeError() { } - - public ActionAttemptSetFanModeError(string message = default, string type = default) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSetFanModeResult_model")] - public class ActionAttemptSetFanModeResult - { - [JsonConstructorAttribute] - public ActionAttemptSetFanModeResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Setting the HVAC mode is pending. - /// - [DataContract(Name = "seamModel_actionAttemptSetHvacMode_model")] - public class ActionAttemptSetHvacMode : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptSetHvacMode() { } - - public ActionAttemptSetHvacMode( - string actionAttemptId = default, - string actionType = default, - ActionAttemptSetHvacModeError error = default, - ActionAttemptSetHvacModeResult result = default, - ActionAttemptSetHvacMode.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "SET_HVAC_MODE"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSetHvacModeError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSetHvacModeResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSetHvacMode.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSetHvacModeError_model")] - public class ActionAttemptSetHvacModeError - { - [JsonConstructorAttribute] - protected ActionAttemptSetHvacModeError() { } - - public ActionAttemptSetHvacModeError(string message = default, string type = default) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSetHvacModeResult_model")] - public class ActionAttemptSetHvacModeResult - { - [JsonConstructorAttribute] - public ActionAttemptSetHvacModeResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Activating a climate preset is pending. - /// - [DataContract(Name = "seamModel_actionAttemptActivateClimatePreset_model")] - public class ActionAttemptActivateClimatePreset : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptActivateClimatePreset() { } - - public ActionAttemptActivateClimatePreset( - string actionAttemptId = default, - string actionType = default, - ActionAttemptActivateClimatePresetError error = default, - ActionAttemptActivateClimatePresetResult result = default, - ActionAttemptActivateClimatePreset.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "ACTIVATE_CLIMATE_PRESET"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptActivateClimatePresetError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptActivateClimatePresetResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptActivateClimatePreset.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptActivateClimatePresetError_model")] - public class ActionAttemptActivateClimatePresetError - { - [JsonConstructorAttribute] - protected ActionAttemptActivateClimatePresetError() { } - - public ActionAttemptActivateClimatePresetError( - string message = default, - string type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptActivateClimatePresetResult_model")] - public class ActionAttemptActivateClimatePresetResult - { - [JsonConstructorAttribute] - public ActionAttemptActivateClimatePresetResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulating a keypad code entry is pending. - /// - [DataContract(Name = "seamModel_actionAttemptSimulateKeypadCodeEntry_model")] - public class ActionAttemptSimulateKeypadCodeEntry : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptSimulateKeypadCodeEntry() { } - - public ActionAttemptSimulateKeypadCodeEntry( - string actionAttemptId = default, - string actionType = default, - ActionAttemptSimulateKeypadCodeEntryError error = default, - ActionAttemptSimulateKeypadCodeEntryResult result = default, - ActionAttemptSimulateKeypadCodeEntry.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "SIMULATE_KEYPAD_CODE_ENTRY"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSimulateKeypadCodeEntryError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSimulateKeypadCodeEntryResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSimulateKeypadCodeEntry.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSimulateKeypadCodeEntryError_model")] - public class ActionAttemptSimulateKeypadCodeEntryError - { - [JsonConstructorAttribute] - protected ActionAttemptSimulateKeypadCodeEntryError() { } - - public ActionAttemptSimulateKeypadCodeEntryError( - string message = default, - string type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSimulateKeypadCodeEntryResult_model")] - public class ActionAttemptSimulateKeypadCodeEntryResult - { - [JsonConstructorAttribute] - public ActionAttemptSimulateKeypadCodeEntryResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Simulating a manual lock action using a keypad is pending. - /// - [DataContract(Name = "seamModel_actionAttemptSimulateManualLockViaKeypad_model")] - public class ActionAttemptSimulateManualLockViaKeypad : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptSimulateManualLockViaKeypad() { } - - public ActionAttemptSimulateManualLockViaKeypad( - string actionAttemptId = default, - string actionType = default, - ActionAttemptSimulateManualLockViaKeypadError error = default, - ActionAttemptSimulateManualLockViaKeypadResult result = default, - ActionAttemptSimulateManualLockViaKeypad.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "SIMULATE_MANUAL_LOCK_VIA_KEYPAD"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSimulateManualLockViaKeypadError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSimulateManualLockViaKeypadResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSimulateManualLockViaKeypad.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSimulateManualLockViaKeypadError_model")] - public class ActionAttemptSimulateManualLockViaKeypadError - { - [JsonConstructorAttribute] - protected ActionAttemptSimulateManualLockViaKeypadError() { } - - public ActionAttemptSimulateManualLockViaKeypadError( - string message = default, - string type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSimulateManualLockViaKeypadResult_model")] - public class ActionAttemptSimulateManualLockViaKeypadResult - { - [JsonConstructorAttribute] - public ActionAttemptSimulateManualLockViaKeypadResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Pushing thermostat weekly programs is pending. - /// - [DataContract(Name = "seamModel_actionAttemptPushThermostatPrograms_model")] - public class ActionAttemptPushThermostatPrograms : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptPushThermostatPrograms() { } - - public ActionAttemptPushThermostatPrograms( - string actionAttemptId = default, - string actionType = default, - ActionAttemptPushThermostatProgramsError error = default, - ActionAttemptPushThermostatProgramsResult result = default, - ActionAttemptPushThermostatPrograms.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "PUSH_THERMOSTAT_PROGRAMS"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptPushThermostatProgramsError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptPushThermostatProgramsResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptPushThermostatPrograms.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptPushThermostatProgramsError_model")] - public class ActionAttemptPushThermostatProgramsError - { - [JsonConstructorAttribute] - protected ActionAttemptPushThermostatProgramsError() { } - - public ActionAttemptPushThermostatProgramsError( - string message = default, - string type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptPushThermostatProgramsResult_model")] - public class ActionAttemptPushThermostatProgramsResult - { - [JsonConstructorAttribute] - public ActionAttemptPushThermostatProgramsResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Configuring the auto-lock is pending. - /// - [DataContract(Name = "seamModel_actionAttemptConfigureAutoLock_model")] - public class ActionAttemptConfigureAutoLock : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptConfigureAutoLock() { } - - public ActionAttemptConfigureAutoLock( - string actionAttemptId = default, - string actionType = default, - ActionAttemptConfigureAutoLockError error = default, - ActionAttemptConfigureAutoLockResult result = default, - ActionAttemptConfigureAutoLock.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "CONFIGURE_AUTO_LOCK"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptConfigureAutoLockError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptConfigureAutoLockResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptConfigureAutoLock.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptConfigureAutoLockError_model")] - public class ActionAttemptConfigureAutoLockError - { - [JsonConstructorAttribute] - protected ActionAttemptConfigureAutoLockError() { } - - public ActionAttemptConfigureAutoLockError(string message = default, string type = default) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptConfigureAutoLockResult_model")] - public class ActionAttemptConfigureAutoLockResult - { - [JsonConstructorAttribute] - public ActionAttemptConfigureAutoLockResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSyncAccessCodes_model")] - public class ActionAttemptSyncAccessCodes : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptSyncAccessCodes() { } - - public ActionAttemptSyncAccessCodes( - string actionAttemptId = default, - string actionType = default, - ActionAttemptSyncAccessCodesError error = default, - ActionAttemptSyncAccessCodesResult result = default, - ActionAttemptSyncAccessCodes.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "SYNC_ACCESS_CODES"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSyncAccessCodesError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSyncAccessCodesResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptSyncAccessCodes.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSyncAccessCodesError_model")] - public class ActionAttemptSyncAccessCodesError - { - [JsonConstructorAttribute] - protected ActionAttemptSyncAccessCodesError() { } - - public ActionAttemptSyncAccessCodesError(string message = default, string type = default) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptSyncAccessCodesResult_model")] - public class ActionAttemptSyncAccessCodesResult - { - [JsonConstructorAttribute] - public ActionAttemptSyncAccessCodesResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptCreateAccessCode_model")] - public class ActionAttemptCreateAccessCode : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptCreateAccessCode() { } - - public ActionAttemptCreateAccessCode( - string actionAttemptId = default, - string actionType = default, - ActionAttemptCreateAccessCodeError error = default, - ActionAttemptCreateAccessCodeResult result = default, - ActionAttemptCreateAccessCode.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "CREATE_ACCESS_CODE"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptCreateAccessCodeError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptCreateAccessCodeResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptCreateAccessCode.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptCreateAccessCodeError_model")] - public class ActionAttemptCreateAccessCodeError - { - [JsonConstructorAttribute] - protected ActionAttemptCreateAccessCodeError() { } - - public ActionAttemptCreateAccessCodeError(string message = default, string type = default) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptCreateAccessCodeResult_model")] - public class ActionAttemptCreateAccessCodeResult - { - [JsonConstructorAttribute] - protected ActionAttemptCreateAccessCodeResult() { } - - public ActionAttemptCreateAccessCodeResult(object accessCode = default) - { - AccessCode = accessCode; - } - - /// - /// Created access code. - /// - [DataMember(Name = "access_code", IsRequired = false, EmitDefaultValue = false)] - public object AccessCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptDeleteAccessCode_model")] - public class ActionAttemptDeleteAccessCode : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptDeleteAccessCode() { } - - public ActionAttemptDeleteAccessCode( - string actionAttemptId = default, - string actionType = default, - ActionAttemptDeleteAccessCodeError error = default, - ActionAttemptDeleteAccessCodeResult result = default, - ActionAttemptDeleteAccessCode.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "DELETE_ACCESS_CODE"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptDeleteAccessCodeError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptDeleteAccessCodeResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptDeleteAccessCode.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptDeleteAccessCodeError_model")] - public class ActionAttemptDeleteAccessCodeError - { - [JsonConstructorAttribute] - protected ActionAttemptDeleteAccessCodeError() { } - - public ActionAttemptDeleteAccessCodeError(string message = default, string type = default) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptDeleteAccessCodeResult_model")] - public class ActionAttemptDeleteAccessCodeResult - { - [JsonConstructorAttribute] - public ActionAttemptDeleteAccessCodeResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptUpdateAccessCode_model")] - public class ActionAttemptUpdateAccessCode : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptUpdateAccessCode() { } - - public ActionAttemptUpdateAccessCode( - string actionAttemptId = default, - string actionType = default, - ActionAttemptUpdateAccessCodeError error = default, - ActionAttemptUpdateAccessCodeResult result = default, - ActionAttemptUpdateAccessCode.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "UPDATE_ACCESS_CODE"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptUpdateAccessCodeError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptUpdateAccessCodeResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptUpdateAccessCode.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptUpdateAccessCodeError_model")] - public class ActionAttemptUpdateAccessCodeError - { - [JsonConstructorAttribute] - protected ActionAttemptUpdateAccessCodeError() { } - - public ActionAttemptUpdateAccessCodeError(string message = default, string type = default) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptUpdateAccessCodeResult_model")] - public class ActionAttemptUpdateAccessCodeResult - { - [JsonConstructorAttribute] - protected ActionAttemptUpdateAccessCodeResult() { } - - public ActionAttemptUpdateAccessCodeResult(object? accessCode = default) - { - AccessCode = accessCode; - } - - /// - /// Updated access code. - /// - [DataMember(Name = "access_code", IsRequired = false, EmitDefaultValue = false)] - public object? AccessCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptCreateNoiseThreshold_model")] - public class ActionAttemptCreateNoiseThreshold : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptCreateNoiseThreshold() { } - - public ActionAttemptCreateNoiseThreshold( - string actionAttemptId = default, - string actionType = default, - ActionAttemptCreateNoiseThresholdError error = default, - ActionAttemptCreateNoiseThresholdResult result = default, - ActionAttemptCreateNoiseThreshold.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "CREATE_NOISE_THRESHOLD"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptCreateNoiseThresholdError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptCreateNoiseThresholdResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptCreateNoiseThreshold.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptCreateNoiseThresholdError_model")] - public class ActionAttemptCreateNoiseThresholdError - { - [JsonConstructorAttribute] - protected ActionAttemptCreateNoiseThresholdError() { } - - public ActionAttemptCreateNoiseThresholdError( - string message = default, - string type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptCreateNoiseThresholdResult_model")] - public class ActionAttemptCreateNoiseThresholdResult - { - [JsonConstructorAttribute] - protected ActionAttemptCreateNoiseThresholdResult() { } - - public ActionAttemptCreateNoiseThresholdResult(object noiseThreshold = default) - { - NoiseThreshold = noiseThreshold; - } - - /// - /// Created noise threshold. - /// - [DataMember(Name = "noise_threshold", IsRequired = false, EmitDefaultValue = false)] - public object NoiseThreshold { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptDeleteNoiseThreshold_model")] - public class ActionAttemptDeleteNoiseThreshold : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptDeleteNoiseThreshold() { } - - public ActionAttemptDeleteNoiseThreshold( - string actionAttemptId = default, - string actionType = default, - ActionAttemptDeleteNoiseThresholdError error = default, - ActionAttemptDeleteNoiseThresholdResult result = default, - ActionAttemptDeleteNoiseThreshold.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "DELETE_NOISE_THRESHOLD"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptDeleteNoiseThresholdError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptDeleteNoiseThresholdResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptDeleteNoiseThreshold.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptDeleteNoiseThresholdError_model")] - public class ActionAttemptDeleteNoiseThresholdError - { - [JsonConstructorAttribute] - protected ActionAttemptDeleteNoiseThresholdError() { } - - public ActionAttemptDeleteNoiseThresholdError( - string message = default, - string type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptDeleteNoiseThresholdResult_model")] - public class ActionAttemptDeleteNoiseThresholdResult - { - [JsonConstructorAttribute] - public ActionAttemptDeleteNoiseThresholdResult() { } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptUpdateNoiseThreshold_model")] - public class ActionAttemptUpdateNoiseThreshold : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptUpdateNoiseThreshold() { } - - public ActionAttemptUpdateNoiseThreshold( - string actionAttemptId = default, - string actionType = default, - ActionAttemptUpdateNoiseThresholdError error = default, - ActionAttemptUpdateNoiseThresholdResult result = default, - ActionAttemptUpdateNoiseThreshold.StatusEnum status = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - Error = error; - Result = result; - Status = status; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "success")] - Success = 1, - - [EnumMember(Value = "pending")] - Pending = 2, - - [EnumMember(Value = "error")] - Error = 3, - } - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "UPDATE_NOISE_THRESHOLD"; - - /// - /// Error associated with the action. - /// - [DataMember(Name = "error", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptUpdateNoiseThresholdError Error { get; set; } - - /// - /// Result of the action. - /// - [DataMember(Name = "result", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptUpdateNoiseThresholdResult Result { get; set; } - - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ActionAttemptUpdateNoiseThreshold.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptUpdateNoiseThresholdError_model")] - public class ActionAttemptUpdateNoiseThresholdError - { - [JsonConstructorAttribute] - protected ActionAttemptUpdateNoiseThresholdError() { } - - public ActionAttemptUpdateNoiseThresholdError( - string message = default, - string type = default - ) - { - Message = message; - Type = type; - } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Type of the error. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptUpdateNoiseThresholdResult_model")] - public class ActionAttemptUpdateNoiseThresholdResult - { - [JsonConstructorAttribute] - protected ActionAttemptUpdateNoiseThresholdResult() { } - - public ActionAttemptUpdateNoiseThresholdResult(object noiseThreshold = default) - { - NoiseThreshold = noiseThreshold; - } - - /// - /// Updated noise threshold. - /// - [DataMember(Name = "noise_threshold", IsRequired = false, EmitDefaultValue = false)] - public object NoiseThreshold { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_actionAttemptUnrecognized_model")] - public class ActionAttemptUnrecognized : ActionAttempt - { - [JsonConstructorAttribute] - protected ActionAttemptUnrecognized() { } - - public ActionAttemptUnrecognized( - string actionType = default, - string actionAttemptId = default - ) - { - ActionType = actionType; - ActionAttemptId = actionAttemptId; - } - - [DataMember(Name = "action_type", IsRequired = true, EmitDefaultValue = false)] - public override string ActionType { get; } = "unrecognized"; - - /// - /// ID of the action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public override string ActionAttemptId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/AsbtractModelSchema.cs b/src/Seam/Model/AsbtractModelSchema.cs deleted file mode 100644 index 9a54f5ed..00000000 --- a/src/Seam/Model/AsbtractModelSchema.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace Seam.Model -{ - /// - /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification - /// - public abstract class AbstractModelSchema - { - /// - /// Custom JSON serializer - /// - static public readonly JsonSerializerSettings SerializerSettings = - new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - MissingMemberHandling = MissingMemberHandling.Error, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy { OverrideSpecifiedNames = false }, - }, - }; - - /// - /// Custom JSON serializer for objects with additional properties - /// - static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = - new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - MissingMemberHandling = MissingMemberHandling.Ignore, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy { OverrideSpecifiedNames = false }, - }, - }; - - /// - /// Gets or Sets the actual instance - /// - public abstract Object ActualInstance { get; set; } - - /// - /// Gets or Sets IsNullable to indicate whether the instance is nullable - /// - public bool IsNullable { get; protected set; } - - /// - /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` - /// - public string SchemaType { get; protected set; } - - /// - /// Converts the instance into JSON string. - /// - public abstract string ToJson(); - } -} diff --git a/src/Seam/Model/ClientSession.cs b/src/Seam/Model/ClientSession.cs deleted file mode 100644 index 578ad992..00000000 --- a/src/Seam/Model/ClientSession.cs +++ /dev/null @@ -1,149 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). If you want to restrict your users' access to their own devices, use client sessions. - /// - /// You create each client session with a custom `user_identifier_key`. Normally, the `user_identifier_key` is a user ID that your application provides. - /// - /// When calling the Seam API from your backend using an API key, you can pass the `user_identifier_key` as a parameter to limit results to the associated client session. For example, `/devices/list?user_identifier_key=123` only returns devices associated with the client session created with the `user_identifier_key` `123`. - /// - /// A client session has a token that you can use with the Seam JavaScript SDK to make requests from the client (browser) directly to the Seam API. The token restricts the user's access to only the devices that they own. - /// - /// See also [Get Started with React](https://docs.seam.co/ui-components/overview/getting-started-with-seam-components/get-started-with-react-components-and-client-session-tokens). - /// - [DataContract(Name = "seamModel_clientSession_model")] - public class ClientSession - { - [JsonConstructorAttribute] - protected ClientSession() { } - - public ClientSession( - string clientSessionId = default, - List connectWebviewIds = default, - List connectedAccountIds = default, - string createdAt = default, - string? customerKey = default, - float deviceCount = default, - string expiresAt = default, - string token = default, - string? userIdentifierKey = default, - string? userIdentityId = default, - List userIdentityIds = default, - string workspaceId = default - ) - { - ClientSessionId = clientSessionId; - ConnectWebviewIds = connectWebviewIds; - ConnectedAccountIds = connectedAccountIds; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCount = deviceCount; - ExpiresAt = expiresAt; - Token = token; - UserIdentifierKey = userIdentifierKey; - UserIdentityId = userIdentityId; - UserIdentityIds = userIdentityIds; - WorkspaceId = workspaceId; - } - - /// - /// ID of the client session. - /// - [DataMember(Name = "client_session_id", IsRequired = false, EmitDefaultValue = false)] - public string ClientSessionId { get; set; } - - /// - /// IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - [DataMember(Name = "connect_webview_ids", IsRequired = false, EmitDefaultValue = false)] - public List ConnectWebviewIds { get; set; } - - /// - /// IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - [DataMember(Name = "connected_account_ids", IsRequired = false, EmitDefaultValue = false)] - public List ConnectedAccountIds { get; set; } - - /// - /// Date and time at which the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Customer key associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Number of devices associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - [DataMember(Name = "device_count", IsRequired = false, EmitDefaultValue = false)] - public float DeviceCount { get; set; } - - /// - /// Date and time at which the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) expires. - /// - [DataMember(Name = "expires_at", IsRequired = false, EmitDefaultValue = false)] - public string ExpiresAt { get; set; } - - /// - /// Client session token associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - [DataMember(Name = "token", IsRequired = false, EmitDefaultValue = false)] - public string Token { get; set; } - - /// - /// Your user ID for the user associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). - /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - /// - /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with the client session. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with the client session. - /// - [Obsolete("Use `user_identity_id` instead.")] - [DataMember(Name = "user_identity_ids", IsRequired = false, EmitDefaultValue = false)] - public List UserIdentityIds { get; set; } - - /// - /// ID of the workspace associated with the client session. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/ConnectedAccount.cs b/src/Seam/Model/ConnectedAccount.cs deleted file mode 100644 index e73c53dd..00000000 --- a/src/Seam/Model/ConnectedAccount.cs +++ /dev/null @@ -1,1456 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a [connected account](https://docs.seam.co/core-concepts/connected-accounts). A connected account is an external third-party account to which your user has authorized Seam to get access, for example, an August account with a list of door locks. - /// - [DataContract(Name = "seamModel_connectedAccount_model")] - public class ConnectedAccount - { - [JsonConstructorAttribute] - protected ConnectedAccount() { } - - public ConnectedAccount( - List acceptedCapabilities = default, - string? accountType = default, - string accountTypeDisplayName = default, - bool automaticallyManageNewDevices = default, - string connectedAccountId = default, - string? createdAt = default, - object customMetadata = default, - string? customerKey = default, - string? defaultCheckinTime = default, - string? defaultCheckoutTime = default, - string displayName = default, - List errors = default, - string? icalFeedOrigin = default, - string? icalUrl = default, - string? imageUrl = default, - string? timeZone = default, - ConnectedAccountUserIdentifier? userIdentifier = default, - List warnings = default - ) - { - AcceptedCapabilities = acceptedCapabilities; - AccountType = accountType; - AccountTypeDisplayName = accountTypeDisplayName; - AutomaticallyManageNewDevices = automaticallyManageNewDevices; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomMetadata = customMetadata; - CustomerKey = customerKey; - DefaultCheckinTime = defaultCheckinTime; - DefaultCheckoutTime = defaultCheckoutTime; - DisplayName = displayName; - Errors = errors; - IcalFeedOrigin = icalFeedOrigin; - IcalUrl = icalUrl; - ImageUrl = imageUrl; - TimeZone = timeZone; - UserIdentifier = userIdentifier; - Warnings = warnings; - } - - /// - /// List of capabilities that were accepted during the account connection process. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AcceptedCapabilitiesEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "lock")] - Lock = 1, - - [EnumMember(Value = "thermostat")] - Thermostat = 2, - - [EnumMember(Value = "noise_sensor")] - NoiseSensor = 3, - - [EnumMember(Value = "access_control")] - AccessControl = 4, - - [EnumMember(Value = "camera")] - Camera = 5, - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(ConnectedAccountErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountErrorsDormakabaSitesDisconnected), - "dormakaba_sites_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountErrorsSaltoKsSubscriptionLimitExceeded), - "salto_ks_subscription_limit_exceeded" - )] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountErrorsBridgeDisconnected), - "bridge_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountErrorsAccountDisconnected), - "account_disconnected" - )] - public abstract class ConnectedAccountErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract bool? IsBridgeError { get; set; } - - public abstract bool? IsConnectedAccountError { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_connectedAccountErrorsAccountDisconnected_model")] - public class ConnectedAccountErrorsAccountDisconnected : ConnectedAccountErrors - { - [JsonConstructorAttribute] - protected ConnectedAccountErrorsAccountDisconnected() { } - - public ConnectedAccountErrorsAccountDisconnected( - string createdAt = default, - string errorCode = default, - bool? isBridgeError = default, - bool? isConnectedAccountError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsBridgeError = isBridgeError; - IsConnectedAccountError = isConnectedAccountError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "account_disconnected"; - - /// - /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public override bool? IsBridgeError { get; set; } - - /// - /// Indicates whether the error is related specifically to the connected account. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public override bool? IsConnectedAccountError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_connectedAccountErrorsBridgeDisconnected_model")] - public class ConnectedAccountErrorsBridgeDisconnected : ConnectedAccountErrors - { - [JsonConstructorAttribute] - protected ConnectedAccountErrorsBridgeDisconnected() { } - - public ConnectedAccountErrorsBridgeDisconnected( - string createdAt = default, - string errorCode = default, - bool? isBridgeError = default, - bool? isConnectedAccountError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsBridgeError = isBridgeError; - IsConnectedAccountError = isConnectedAccountError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "bridge_disconnected"; - - /// - /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public override bool? IsBridgeError { get; set; } - - /// - /// Indicates whether the error is related specifically to the connected account. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public override bool? IsConnectedAccountError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_connectedAccountErrorsSaltoKsSubscriptionLimitExceeded_model" - )] - public class ConnectedAccountErrorsSaltoKsSubscriptionLimitExceeded : ConnectedAccountErrors - { - [JsonConstructorAttribute] - protected ConnectedAccountErrorsSaltoKsSubscriptionLimitExceeded() { } - - public ConnectedAccountErrorsSaltoKsSubscriptionLimitExceeded( - string createdAt = default, - string errorCode = default, - bool? isBridgeError = default, - bool? isConnectedAccountError = default, - string message = default, - ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadata saltoKsMetadata = - default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsBridgeError = isBridgeError; - IsConnectedAccountError = isConnectedAccountError; - Message = message; - SaltoKsMetadata = saltoKsMetadata; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; - - /// - /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public override bool? IsBridgeError { get; set; } - - /// - /// Indicates whether the error is related specifically to the connected account. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public override bool? IsConnectedAccountError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// Salto KS metadata associated with the connected account that has an error. - /// - [DataMember(Name = "salto_ks_metadata", IsRequired = false, EmitDefaultValue = false)] - public ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadata SaltoKsMetadata { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_connectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadata_model" - )] - public class ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadata - { - [JsonConstructorAttribute] - protected ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadata() { } - - public ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadata( - List? sites = - default - ) - { - Sites = sites; - } - - /// - /// Salto sites associated with the connected account that has an error. - /// - [DataMember(Name = "sites", IsRequired = false, EmitDefaultValue = false)] - public List? Sites { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_connectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadataSites_model" - )] - public class ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadataSites - { - [JsonConstructorAttribute] - protected ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadataSites() - { } - - public ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadataSites( - string? siteId = default, - string? siteName = default, - int? siteUserSubscriptionLimit = default, - int? subscribedSiteUserCount = default - ) - { - SiteId = siteId; - SiteName = siteName; - SiteUserSubscriptionLimit = siteUserSubscriptionLimit; - SubscribedSiteUserCount = subscribedSiteUserCount; - } - - /// - /// ID of a Salto site associated with the connected account that has an error. - /// - [DataMember(Name = "site_id", IsRequired = false, EmitDefaultValue = false)] - public string? SiteId { get; set; } - - /// - /// Name of a Salto site associated with the connected account that has an error. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - /// - /// Subscription limit of site users for a Salto site associated with the connected account that has an error. - /// - [DataMember( - Name = "site_user_subscription_limit", - IsRequired = false, - EmitDefaultValue = false - )] - public int? SiteUserSubscriptionLimit { get; set; } - - /// - /// Count of subscribed site users for a Salto site associated with the connected account that has an error. - /// - [DataMember( - Name = "subscribed_site_user_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int? SubscribedSiteUserCount { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_connectedAccountErrorsDormakabaSitesDisconnected_model")] - public class ConnectedAccountErrorsDormakabaSitesDisconnected : ConnectedAccountErrors - { - [JsonConstructorAttribute] - protected ConnectedAccountErrorsDormakabaSitesDisconnected() { } - - public ConnectedAccountErrorsDormakabaSitesDisconnected( - string createdAt = default, - string errorCode = default, - bool? isBridgeError = default, - bool? isConnectedAccountError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsBridgeError = isBridgeError; - IsConnectedAccountError = isConnectedAccountError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; - - /// - /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public override bool? IsBridgeError { get; set; } - - /// - /// Indicates whether the error is related specifically to the connected account. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public override bool? IsConnectedAccountError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_connectedAccountErrorsUnrecognized_model")] - public class ConnectedAccountErrorsUnrecognized : ConnectedAccountErrors - { - [JsonConstructorAttribute] - protected ConnectedAccountErrorsUnrecognized() { } - - public ConnectedAccountErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - bool? isBridgeError = default, - bool? isConnectedAccountError = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - IsBridgeError = isBridgeError; - IsConnectedAccountError = isConnectedAccountError; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public override bool? IsBridgeError { get; set; } - - /// - /// Indicates whether the error is related specifically to the connected account. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public override bool? IsConnectedAccountError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(ConnectedAccountWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountWarningsDormakabaSitesUnapproved), - "dormakaba_sites_unapproved" - )] - [JsonSubtypes.KnownSubType(typeof(ConnectedAccountWarningsSetupRequired), "setup_required")] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountWarningsProviderServiceUnavailable), - "provider_service_unavailable" - )] - [JsonSubtypes.KnownSubType(typeof(ConnectedAccountWarningsBeingDeleted), "being_deleted")] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountWarningsAccountReauthorizationRequested), - "account_reauthorization_requested" - )] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReached), - "salto_ks_subscription_limit_almost_reached" - )] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountWarningsUnknownIssueWithConnectedAccount), - "unknown_issue_with_connected_account" - )] - [JsonSubtypes.KnownSubType( - typeof(ConnectedAccountWarningsScheduledMaintenanceWindow), - "scheduled_maintenance_window" - )] - public abstract class ConnectedAccountWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_connectedAccountWarningsScheduledMaintenanceWindow_model")] - public class ConnectedAccountWarningsScheduledMaintenanceWindow : ConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsScheduledMaintenanceWindow() { } - - public ConnectedAccountWarningsScheduledMaintenanceWindow( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "scheduled_maintenance_window"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_connectedAccountWarningsUnknownIssueWithConnectedAccount_model" - )] - public class ConnectedAccountWarningsUnknownIssueWithConnectedAccount - : ConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsUnknownIssueWithConnectedAccount() { } - - public ConnectedAccountWarningsUnknownIssueWithConnectedAccount( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unknown_issue_with_connected_account"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_connectedAccountWarningsSaltoKsSubscriptionLimitAlmostReached_model" - )] - public class ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReached - : ConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReached() { } - - public ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReached( - string createdAt = default, - string message = default, - ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadata saltoKsMetadata = - default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - SaltoKsMetadata = saltoKsMetadata; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// Salto KS metadata associated with the connected account that has a warning. - /// - [DataMember(Name = "salto_ks_metadata", IsRequired = false, EmitDefaultValue = false)] - public ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadata SaltoKsMetadata { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "salto_ks_subscription_limit_almost_reached"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_connectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadata_model" - )] - public class ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadata - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadata() - { } - - public ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadata( - List? sites = - default - ) - { - Sites = sites; - } - - /// - /// Salto sites associated with the connected account that has a warning. - /// - [DataMember(Name = "sites", IsRequired = false, EmitDefaultValue = false)] - public List? Sites { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_connectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadataSites_model" - )] - public class ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadataSites - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadataSites() - { } - - public ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadataSites( - string? siteId = default, - string? siteName = default, - int? siteUserSubscriptionLimit = default, - int? subscribedSiteUserCount = default - ) - { - SiteId = siteId; - SiteName = siteName; - SiteUserSubscriptionLimit = siteUserSubscriptionLimit; - SubscribedSiteUserCount = subscribedSiteUserCount; - } - - /// - /// ID of a Salto site associated with the connected account that has a warning. - /// - [DataMember(Name = "site_id", IsRequired = false, EmitDefaultValue = false)] - public string? SiteId { get; set; } - - /// - /// Name of a Salto site associated with the connected account that has a warning. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - /// - /// Subscription limit of site users for a Salto site associated with the connected account that has a warning. - /// - [DataMember( - Name = "site_user_subscription_limit", - IsRequired = false, - EmitDefaultValue = false - )] - public int? SiteUserSubscriptionLimit { get; set; } - - /// - /// Count of subscribed site users for a Salto site associated with the connected account that has a warning. - /// - [DataMember( - Name = "subscribed_site_user_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int? SubscribedSiteUserCount { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_connectedAccountWarningsAccountReauthorizationRequested_model" - )] - public class ConnectedAccountWarningsAccountReauthorizationRequested - : ConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsAccountReauthorizationRequested() { } - - public ConnectedAccountWarningsAccountReauthorizationRequested( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "account_reauthorization_requested"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_connectedAccountWarningsBeingDeleted_model")] - public class ConnectedAccountWarningsBeingDeleted : ConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsBeingDeleted() { } - - public ConnectedAccountWarningsBeingDeleted( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_connectedAccountWarningsProviderServiceUnavailable_model")] - public class ConnectedAccountWarningsProviderServiceUnavailable : ConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsProviderServiceUnavailable() { } - - public ConnectedAccountWarningsProviderServiceUnavailable( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "provider_service_unavailable"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_connectedAccountWarningsSetupRequired_model")] - public class ConnectedAccountWarningsSetupRequired : ConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsSetupRequired() { } - - public ConnectedAccountWarningsSetupRequired( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "setup_required"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_connectedAccountWarningsDormakabaSitesUnapproved_model")] - public class ConnectedAccountWarningsDormakabaSitesUnapproved : ConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsDormakabaSitesUnapproved() { } - - public ConnectedAccountWarningsDormakabaSitesUnapproved( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "dormakaba_sites_unapproved"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_connectedAccountWarningsUnrecognized_model")] - public class ConnectedAccountWarningsUnrecognized : ConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected ConnectedAccountWarningsUnrecognized() { } - - public ConnectedAccountWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// List of capabilities that were accepted during the account connection process. - /// - [DataMember(Name = "accepted_capabilities", IsRequired = false, EmitDefaultValue = false)] - public List AcceptedCapabilities { get; set; } - - /// - /// Type of connected account. - /// - [DataMember(Name = "account_type", IsRequired = false, EmitDefaultValue = false)] - public string? AccountType { get; set; } - - /// - /// Display name for the connected account type. - /// - [DataMember( - Name = "account_type_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string AccountTypeDisplayName { get; set; } - - /// - /// Indicates whether Seam should [import all new devices](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#automatically_manage_new_devices) for the connected account to make these devices available for management by the Seam API. - /// - [DataMember( - Name = "automatically_manage_new_devices", - IsRequired = false, - EmitDefaultValue = false - )] - public bool AutomaticallyManageNewDevices { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the connected account was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - /// - /// Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object CustomMetadata { get; set; } - - /// - /// Your unique key for the customer associated with this connected account. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Default reservation check-in time for this connected account, as `HH:mm` (24-hour). Sourced from the connector configuration — set during the connect_webview for providers like Lodgify whose API does not expose check-in times. - /// - [DataMember(Name = "default_checkin_time", IsRequired = false, EmitDefaultValue = false)] - public string? DefaultCheckinTime { get; set; } - - /// - /// Default reservation check-out time for this connected account, as `HH:mm` (24-hour). Sourced from the connector configuration. - /// - [DataMember(Name = "default_checkout_time", IsRequired = false, EmitDefaultValue = false)] - public string? DefaultCheckoutTime { get; set; } - - /// - /// Display name for the connected account. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// For iCal connected accounts, the platform that produced the feed (for example, `airbnb`, `vrbo`, or `booking`), or `unknown` when it could not be determined. Intended for rendering the source platform's logo. - /// - [DataMember(Name = "ical_feed_origin", IsRequired = false, EmitDefaultValue = false)] - public string? IcalFeedOrigin { get; set; } - - /// - /// For iCal connected accounts, the feed URL for the connection. Sourced from the connector configuration. - /// - [DataMember(Name = "ical_url", IsRequired = false, EmitDefaultValue = false)] - public string? IcalUrl { get; set; } - - /// - /// Logo URL for the connected account provider. - /// - [DataMember(Name = "image_url", IsRequired = false, EmitDefaultValue = false)] - public string? ImageUrl { get; set; } - - /// - /// IANA time zone (e.g. America/Los_Angeles) for this connected account. Sourced from the connector configuration. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - /// - /// User identifier associated with the connected account. - /// - [Obsolete("Use `display_name` instead.")] - [DataMember(Name = "user_identifier", IsRequired = false, EmitDefaultValue = false)] - public ConnectedAccountUserIdentifier? UserIdentifier { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_connectedAccountUserIdentifier_model")] - public class ConnectedAccountUserIdentifier - { - [JsonConstructorAttribute] - protected ConnectedAccountUserIdentifier() { } - - public ConnectedAccountUserIdentifier( - string? apiUrl = default, - string? email = default, - bool? exclusive = default, - string? phone = default, - string? username = default - ) - { - ApiUrl = apiUrl; - Email = email; - Exclusive = exclusive; - Phone = phone; - Username = username; - } - - /// - /// API URL for the user identifier associated with the connected account. - /// - [DataMember(Name = "api_url", IsRequired = false, EmitDefaultValue = false)] - public string? ApiUrl { get; set; } - - /// - /// Email address of the user identifier associated with the connected account. - /// - [DataMember(Name = "email", IsRequired = false, EmitDefaultValue = false)] - public string? Email { get; set; } - - /// - /// Indicates whether the user identifier associated with the connected account is exclusive. - /// - [DataMember(Name = "exclusive", IsRequired = false, EmitDefaultValue = false)] - public bool? Exclusive { get; set; } - - /// - /// Phone number of the user identifier associated with the connected account. - /// - [DataMember(Name = "phone", IsRequired = false, EmitDefaultValue = false)] - public string? Phone { get; set; } - - /// - /// Username of the user identifier associated with the connected account. - /// - [DataMember(Name = "username", IsRequired = false, EmitDefaultValue = false)] - public string? Username { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/CustomerPortal.cs b/src/Seam/Model/CustomerPortal.cs deleted file mode 100644 index 6e0515ef..00000000 --- a/src/Seam/Model/CustomerPortal.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a Customer Portal. Customer Portal is a hosted, customizable interface for managing device access. It enables you to embed secure, pre-authenticated access flows into your product—either by sharing a link with users or embedding a view in an iframe. - /// - /// With Customer Portal, you no longer need to build out frontend experiences for physical access, thermostats, and sensors. Instead, you can ship enterprise-grade access control experiences in a fraction of the time, while maintaining your product's branding and user experience. - /// - /// Seam hosts these flows, handling everything from account connection and device mapping to full-featured device control. - /// - [DataContract(Name = "seamModel_customerPortal_model")] - public class CustomerPortal - { - [JsonConstructorAttribute] - protected CustomerPortal() { } - - public CustomerPortal( - string createdAt = default, - string customerKey = default, - string expiresAt = default, - string url = default, - string workspaceId = default - ) - { - CreatedAt = createdAt; - CustomerKey = customerKey; - ExpiresAt = expiresAt; - Url = url; - WorkspaceId = workspaceId; - } - - /// - /// Date and time at which the customer portal link was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Customer key for the customer portal. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string CustomerKey { get; set; } - - /// - /// Date and time at which the customer portal link expires. - /// - [DataMember(Name = "expires_at", IsRequired = false, EmitDefaultValue = false)] - public string ExpiresAt { get; set; } - - /// - /// URL for the customer portal. - /// - [DataMember(Name = "url", IsRequired = false, EmitDefaultValue = false)] - public string Url { get; set; } - - /// - /// ID of the workspace associated with the customer portal. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/Device.cs b/src/Seam/Model/Device.cs deleted file mode 100644 index 272ea510..00000000 --- a/src/Seam/Model/Device.cs +++ /dev/null @@ -1,10081 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a [device](https://docs.seam.co/core-concepts/devices) that has been connected to Seam. - /// - [DataContract(Name = "seamModel_device_model")] - public class Device - { - [JsonConstructorAttribute] - protected Device() { } - - public Device( - bool? canConfigureAutoLock = default, - bool? canHvacCool = default, - bool? canHvacHeat = default, - bool? canHvacHeatCool = default, - bool? canProgramOfflineAccessCodes = default, - bool? canProgramOnlineAccessCodes = default, - bool? canProgramThermostatProgramsAsDifferentEachDay = default, - bool? canProgramThermostatProgramsAsSameEachDay = default, - bool? canProgramThermostatProgramsAsWeekdayWeekend = default, - bool? canRemotelyLock = default, - bool? canRemotelyUnlock = default, - bool? canRunThermostatPrograms = default, - bool? canSimulateConnection = default, - bool? canSimulateDisconnection = default, - bool? canSimulateHubConnection = default, - bool? canSimulateHubDisconnection = default, - bool? canSimulatePaidSubscription = default, - bool? canSimulateRemoval = default, - bool? canTurnOffHvac = default, - bool? canUnlockWithCode = default, - List capabilitiesSupported = default, - string connectedAccountId = default, - string createdAt = default, - object customMetadata = default, - string deviceId = default, - DeviceDeviceManufacturer? deviceManufacturer = default, - DeviceDeviceProvider? deviceProvider = default, - Device.DeviceTypeEnum deviceType = default, - string displayName = default, - List errors = default, - bool isManaged = default, - DeviceLocation? location = default, - string? nickname = default, - DeviceProperties properties = default, - List spaceIds = default, - List warnings = default, - string workspaceId = default - ) - { - CanConfigureAutoLock = canConfigureAutoLock; - CanHvacCool = canHvacCool; - CanHvacHeat = canHvacHeat; - CanHvacHeatCool = canHvacHeatCool; - CanProgramOfflineAccessCodes = canProgramOfflineAccessCodes; - CanProgramOnlineAccessCodes = canProgramOnlineAccessCodes; - CanProgramThermostatProgramsAsDifferentEachDay = - canProgramThermostatProgramsAsDifferentEachDay; - CanProgramThermostatProgramsAsSameEachDay = canProgramThermostatProgramsAsSameEachDay; - CanProgramThermostatProgramsAsWeekdayWeekend = - canProgramThermostatProgramsAsWeekdayWeekend; - CanRemotelyLock = canRemotelyLock; - CanRemotelyUnlock = canRemotelyUnlock; - CanRunThermostatPrograms = canRunThermostatPrograms; - CanSimulateConnection = canSimulateConnection; - CanSimulateDisconnection = canSimulateDisconnection; - CanSimulateHubConnection = canSimulateHubConnection; - CanSimulateHubDisconnection = canSimulateHubDisconnection; - CanSimulatePaidSubscription = canSimulatePaidSubscription; - CanSimulateRemoval = canSimulateRemoval; - CanTurnOffHvac = canTurnOffHvac; - CanUnlockWithCode = canUnlockWithCode; - CapabilitiesSupported = capabilitiesSupported; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomMetadata = customMetadata; - DeviceId = deviceId; - DeviceManufacturer = deviceManufacturer; - DeviceProvider = deviceProvider; - DeviceType = deviceType; - DisplayName = displayName; - Errors = errors; - IsManaged = isManaged; - Location = location; - Nickname = nickname; - Properties = properties; - SpaceIds = spaceIds; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - /// - /// Collection of capabilities that the device supports when connected to Seam. Values are `access_code`, which indicates that the device can manage and utilize digital PIN codes for secure access; `lock`, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; `noise_detection`, which indicates that the device supports monitoring and responding to ambient noise levels; `thermostat`, which indicates that the device can regulate and adjust indoor temperatures; `battery`, which indicates that the device can manage battery life and health; and `phone`, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum CapabilitiesSupportedEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "access_code")] - AccessCode = 1, - - [EnumMember(Value = "lock")] - Lock = 2, - - [EnumMember(Value = "noise_detection")] - NoiseDetection = 3, - - [EnumMember(Value = "thermostat")] - Thermostat = 4, - - [EnumMember(Value = "battery")] - Battery = 5, - - [EnumMember(Value = "phone")] - Phone = 6, - } - - /// - /// Type of the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "akuvox_lock")] - AkuvoxLock = 1, - - [EnumMember(Value = "august_lock")] - AugustLock = 2, - - [EnumMember(Value = "brivo_access_point")] - BrivoAccessPoint = 3, - - [EnumMember(Value = "butterflymx_panel")] - ButterflymxPanel = 4, - - [EnumMember(Value = "avigilon_alta_entry")] - AvigilonAltaEntry = 5, - - [EnumMember(Value = "doorking_lock")] - DoorkingLock = 6, - - [EnumMember(Value = "genie_door")] - GenieDoor = 7, - - [EnumMember(Value = "igloo_lock")] - IglooLock = 8, - - [EnumMember(Value = "linear_lock")] - LinearLock = 9, - - [EnumMember(Value = "lockly_lock")] - LocklyLock = 10, - - [EnumMember(Value = "kwikset_lock")] - KwiksetLock = 11, - - [EnumMember(Value = "nuki_lock")] - NukiLock = 12, - - [EnumMember(Value = "salto_lock")] - SaltoLock = 13, - - [EnumMember(Value = "schlage_lock")] - SchlageLock = 14, - - [EnumMember(Value = "smartthings_lock")] - SmartthingsLock = 15, - - [EnumMember(Value = "wyze_lock")] - WyzeLock = 16, - - [EnumMember(Value = "yale_lock")] - YaleLock = 17, - - [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, - - [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, - - [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, - - [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, - - [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, - - [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, - - [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, - - [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, - - [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, - - [EnumMember(Value = "yacan_lock")] - YacanLock = 27, - - [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, - - [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, - - [EnumMember(Value = "kisi_lock")] - KisiLock = 30, - - [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, - - [EnumMember(Value = "keynest_key")] - KeynestKey = 32, - - [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, - - [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, - - [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, - - [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, - - [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, - - [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, - - [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, - - [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, - - [EnumMember(Value = "ios_phone")] - IosPhone = 41, - - [EnumMember(Value = "android_phone")] - AndroidPhone = 42, - - [EnumMember(Value = "ring_camera")] - RingCamera = 43, - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(DeviceErrorsUnrecognized))] - [JsonSubtypes.KnownSubType(typeof(DeviceErrorsBridgeDisconnected), "bridge_disconnected")] - [JsonSubtypes.KnownSubType( - typeof(DeviceErrorsSubscriptionRequired), - "subscription_required" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceErrorsAuxiliaryHeatRunning), - "auxiliary_heat_running" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceErrorsMissingDeviceCredentials), - "missing_device_credentials" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceErrorsAugustLockNotAuthorized), - "august_lock_not_authorized" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceErrorsEmptyBackupAccessCodePool), - "empty_backup_access_code_pool" - )] - [JsonSubtypes.KnownSubType(typeof(DeviceErrorsDeviceDisconnected), "device_disconnected")] - [JsonSubtypes.KnownSubType(typeof(DeviceErrorsHubDisconnected), "hub_disconnected")] - [JsonSubtypes.KnownSubType(typeof(DeviceErrorsDeviceRemoved), "device_removed")] - [JsonSubtypes.KnownSubType(typeof(DeviceErrorsDeviceOffline), "device_offline")] - [JsonSubtypes.KnownSubType( - typeof(DeviceErrorsDormakabaSitesDisconnected), - "dormakaba_sites_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceErrorsInsufficientPermissions), - "insufficient_permissions" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceErrorsSaltoKsSubscriptionLimitExceeded), - "salto_ks_subscription_limit_exceeded" - )] - [JsonSubtypes.KnownSubType(typeof(DeviceErrorsAccountDisconnected), "account_disconnected")] - public abstract class DeviceErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_deviceErrorsAccountDisconnected_model")] - public class DeviceErrorsAccountDisconnected : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsAccountDisconnected() { } - - public DeviceErrorsAccountDisconnected( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "account_disconnected"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsSaltoKsSubscriptionLimitExceeded_model")] - public class DeviceErrorsSaltoKsSubscriptionLimitExceeded : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsSaltoKsSubscriptionLimitExceeded() { } - - public DeviceErrorsSaltoKsSubscriptionLimitExceeded( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsInsufficientPermissions_model")] - public class DeviceErrorsInsufficientPermissions : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsInsufficientPermissions() { } - - public DeviceErrorsInsufficientPermissions( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "insufficient_permissions"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsDormakabaSitesDisconnected_model")] - public class DeviceErrorsDormakabaSitesDisconnected : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsDormakabaSitesDisconnected() { } - - public DeviceErrorsDormakabaSitesDisconnected( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsDeviceOffline_model")] - public class DeviceErrorsDeviceOffline : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsDeviceOffline() { } - - public DeviceErrorsDeviceOffline( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_offline"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsDeviceRemoved_model")] - public class DeviceErrorsDeviceRemoved : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsDeviceRemoved() { } - - public DeviceErrorsDeviceRemoved( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_removed"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsHubDisconnected_model")] - public class DeviceErrorsHubDisconnected : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsHubDisconnected() { } - - public DeviceErrorsHubDisconnected( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "hub_disconnected"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsDeviceDisconnected_model")] - public class DeviceErrorsDeviceDisconnected : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsDeviceDisconnected() { } - - public DeviceErrorsDeviceDisconnected( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_disconnected"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsEmptyBackupAccessCodePool_model")] - public class DeviceErrorsEmptyBackupAccessCodePool : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsEmptyBackupAccessCodePool() { } - - public DeviceErrorsEmptyBackupAccessCodePool( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "empty_backup_access_code_pool"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsAugustLockNotAuthorized_model")] - public class DeviceErrorsAugustLockNotAuthorized : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsAugustLockNotAuthorized() { } - - public DeviceErrorsAugustLockNotAuthorized( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "august_lock_not_authorized"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsMissingDeviceCredentials_model")] - public class DeviceErrorsMissingDeviceCredentials : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsMissingDeviceCredentials() { } - - public DeviceErrorsMissingDeviceCredentials( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "missing_device_credentials"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsAuxiliaryHeatRunning_model")] - public class DeviceErrorsAuxiliaryHeatRunning : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsAuxiliaryHeatRunning() { } - - public DeviceErrorsAuxiliaryHeatRunning( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "auxiliary_heat_running"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsSubscriptionRequired_model")] - public class DeviceErrorsSubscriptionRequired : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsSubscriptionRequired() { } - - public DeviceErrorsSubscriptionRequired( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "subscription_required"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsBridgeDisconnected_model")] - public class DeviceErrorsBridgeDisconnected : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsBridgeDisconnected() { } - - public DeviceErrorsBridgeDisconnected( - string createdAt = default, - string errorCode = default, - bool? isBridgeError = default, - bool? isConnectedAccountError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsBridgeError = isBridgeError; - IsConnectedAccountError = isConnectedAccountError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "bridge_disconnected"; - - /// - /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public bool? IsBridgeError { get; set; } - - /// - /// Indicates whether the error is related specifically to the connected account. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsConnectedAccountError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceErrorsUnrecognized_model")] - public class DeviceErrorsUnrecognized : DeviceErrors - { - [JsonConstructorAttribute] - protected DeviceErrorsUnrecognized() { } - - public DeviceErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(DeviceWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsMaxAccessCodesReached), - "max_access_codes_reached" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsUnreliableOnlineStatus), - "unreliable_online_status" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsAccessoryKeypadSetupRequired), - "accessory_keypad_setup_required" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsKeynestUnsupportedLocker), - "keynest_unsupported_locker" - )] - [JsonSubtypes.KnownSubType(typeof(DeviceWarningsProviderIssue), "provider_issue")] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsHubRequiredForAdditionalCapabilities), - "hub_required_for_additional_capabilities" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsTwoNDeviceMissingTimezone), - "two_n_device_missing_timezone" - )] - [JsonSubtypes.KnownSubType(typeof(DeviceWarningsTimeZoneMismatch), "time_zone_mismatch")] - [JsonSubtypes.KnownSubType(typeof(DeviceWarningsTimeZoneUnknown), "time_zone_unknown")] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsUltraloqTimeZoneUnknown), - "ultraloq_time_zone_unknown" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsLocklyTimeZoneNotConfigured), - "lockly_time_zone_not_configured" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsUnknownIssueWithPhone), - "unknown_issue_with_phone" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsSaltoKsLockAccessCodeSupportRemoved), - "salto_ks_lock_access_code_support_removed" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsSaltoKsSubscriptionLimitAlmostReached), - "salto_ks_subscription_limit_almost_reached" - )] - [JsonSubtypes.KnownSubType(typeof(DeviceWarningsPrivacyMode), "privacy_mode")] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsSaltoKsPrivacyMode), - "salto_ks_privacy_mode" - )] - [JsonSubtypes.KnownSubType(typeof(DeviceWarningsSaltoKsOfficeMode), "salto_ks_office_mode")] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsDeviceHasFlakyConnection), - "device_has_flaky_connection" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsScheduledMaintenanceWindow), - "scheduled_maintenance_window" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsDeviceCommunicationDegraded), - "device_communication_degraded" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsTemperatureThresholdExceeded), - "temperature_threshold_exceeded" - )] - [JsonSubtypes.KnownSubType(typeof(DeviceWarningsPowerSavingMode), "power_saving_mode")] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsTtlockWeakGatewaySignal), - "ttlock_weak_gateway_signal" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsTtlockLockGatewayUnlockingNotEnabled), - "ttlock_lock_gateway_unlocking_not_enabled" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsThirdPartyIntegrationDetected), - "third_party_integration_detected" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsManyActiveBackupCodes), - "many_active_backup_codes" - )] - [JsonSubtypes.KnownSubType( - typeof(DeviceWarningsPartialBackupAccessCodePool), - "partial_backup_access_code_pool" - )] - public abstract class DeviceWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_deviceWarningsPartialBackupAccessCodePool_model")] - public class DeviceWarningsPartialBackupAccessCodePool : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsPartialBackupAccessCodePool() { } - - public DeviceWarningsPartialBackupAccessCodePool( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "partial_backup_access_code_pool"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsManyActiveBackupCodes_model")] - public class DeviceWarningsManyActiveBackupCodes : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsManyActiveBackupCodes() { } - - public DeviceWarningsManyActiveBackupCodes( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "many_active_backup_codes"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsThirdPartyIntegrationDetected_model")] - public class DeviceWarningsThirdPartyIntegrationDetected : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsThirdPartyIntegrationDetected() { } - - public DeviceWarningsThirdPartyIntegrationDetected( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "third_party_integration_detected"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsTtlockLockGatewayUnlockingNotEnabled_model")] - public class DeviceWarningsTtlockLockGatewayUnlockingNotEnabled : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsTtlockLockGatewayUnlockingNotEnabled() { } - - public DeviceWarningsTtlockLockGatewayUnlockingNotEnabled( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "ttlock_lock_gateway_unlocking_not_enabled"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsTtlockWeakGatewaySignal_model")] - public class DeviceWarningsTtlockWeakGatewaySignal : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsTtlockWeakGatewaySignal() { } - - public DeviceWarningsTtlockWeakGatewaySignal( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "ttlock_weak_gateway_signal"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsPowerSavingMode_model")] - public class DeviceWarningsPowerSavingMode : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsPowerSavingMode() { } - - public DeviceWarningsPowerSavingMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "power_saving_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsTemperatureThresholdExceeded_model")] - public class DeviceWarningsTemperatureThresholdExceeded : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsTemperatureThresholdExceeded() { } - - public DeviceWarningsTemperatureThresholdExceeded( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "temperature_threshold_exceeded"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsDeviceCommunicationDegraded_model")] - public class DeviceWarningsDeviceCommunicationDegraded : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsDeviceCommunicationDegraded() { } - - public DeviceWarningsDeviceCommunicationDegraded( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "device_communication_degraded"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsScheduledMaintenanceWindow_model")] - public class DeviceWarningsScheduledMaintenanceWindow : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsScheduledMaintenanceWindow() { } - - public DeviceWarningsScheduledMaintenanceWindow( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "scheduled_maintenance_window"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsDeviceHasFlakyConnection_model")] - public class DeviceWarningsDeviceHasFlakyConnection : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsDeviceHasFlakyConnection() { } - - public DeviceWarningsDeviceHasFlakyConnection( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "device_has_flaky_connection"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsSaltoKsOfficeMode_model")] - public class DeviceWarningsSaltoKsOfficeMode : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsSaltoKsOfficeMode() { } - - public DeviceWarningsSaltoKsOfficeMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "salto_ks_office_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsSaltoKsPrivacyMode_model")] - public class DeviceWarningsSaltoKsPrivacyMode : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsSaltoKsPrivacyMode() { } - - public DeviceWarningsSaltoKsPrivacyMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "salto_ks_privacy_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsPrivacyMode_model")] - public class DeviceWarningsPrivacyMode : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsPrivacyMode() { } - - public DeviceWarningsPrivacyMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "privacy_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsSaltoKsSubscriptionLimitAlmostReached_model")] - public class DeviceWarningsSaltoKsSubscriptionLimitAlmostReached : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsSaltoKsSubscriptionLimitAlmostReached() { } - - public DeviceWarningsSaltoKsSubscriptionLimitAlmostReached( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "salto_ks_subscription_limit_almost_reached"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsSaltoKsLockAccessCodeSupportRemoved_model")] - public class DeviceWarningsSaltoKsLockAccessCodeSupportRemoved : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsSaltoKsLockAccessCodeSupportRemoved() { } - - public DeviceWarningsSaltoKsLockAccessCodeSupportRemoved( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "salto_ks_lock_access_code_support_removed"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsUnknownIssueWithPhone_model")] - public class DeviceWarningsUnknownIssueWithPhone : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsUnknownIssueWithPhone() { } - - public DeviceWarningsUnknownIssueWithPhone( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unknown_issue_with_phone"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsLocklyTimeZoneNotConfigured_model")] - public class DeviceWarningsLocklyTimeZoneNotConfigured : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsLocklyTimeZoneNotConfigured() { } - - public DeviceWarningsLocklyTimeZoneNotConfigured( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "lockly_time_zone_not_configured"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsUltraloqTimeZoneUnknown_model")] - public class DeviceWarningsUltraloqTimeZoneUnknown : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsUltraloqTimeZoneUnknown() { } - - public DeviceWarningsUltraloqTimeZoneUnknown( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "ultraloq_time_zone_unknown"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsTimeZoneUnknown_model")] - public class DeviceWarningsTimeZoneUnknown : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsTimeZoneUnknown() { } - - public DeviceWarningsTimeZoneUnknown( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "time_zone_unknown"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsTimeZoneMismatch_model")] - public class DeviceWarningsTimeZoneMismatch : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsTimeZoneMismatch() { } - - public DeviceWarningsTimeZoneMismatch( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "time_zone_mismatch"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsTwoNDeviceMissingTimezone_model")] - public class DeviceWarningsTwoNDeviceMissingTimezone : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsTwoNDeviceMissingTimezone() { } - - public DeviceWarningsTwoNDeviceMissingTimezone( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "two_n_device_missing_timezone"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsHubRequiredForAdditionalCapabilities_model")] - public class DeviceWarningsHubRequiredForAdditionalCapabilities : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsHubRequiredForAdditionalCapabilities() { } - - public DeviceWarningsHubRequiredForAdditionalCapabilities( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "hub_required_for_additional_capabilities"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsProviderIssue_model")] - public class DeviceWarningsProviderIssue : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsProviderIssue() { } - - public DeviceWarningsProviderIssue( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "provider_issue"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsKeynestUnsupportedLocker_model")] - public class DeviceWarningsKeynestUnsupportedLocker : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsKeynestUnsupportedLocker() { } - - public DeviceWarningsKeynestUnsupportedLocker( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "keynest_unsupported_locker"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsAccessoryKeypadSetupRequired_model")] - public class DeviceWarningsAccessoryKeypadSetupRequired : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsAccessoryKeypadSetupRequired() { } - - public DeviceWarningsAccessoryKeypadSetupRequired( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "accessory_keypad_setup_required"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsUnreliableOnlineStatus_model")] - public class DeviceWarningsUnreliableOnlineStatus : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsUnreliableOnlineStatus() { } - - public DeviceWarningsUnreliableOnlineStatus( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unreliable_online_status"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsMaxAccessCodesReached_model")] - public class DeviceWarningsMaxAccessCodesReached : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsMaxAccessCodesReached() { } - - public DeviceWarningsMaxAccessCodesReached( - int activeAccessCodeCount = default, - string createdAt = default, - int maxActiveAccessCodeCount = default, - string message = default, - string warningCode = default - ) - { - ActiveAccessCodeCount = activeAccessCodeCount; - CreatedAt = createdAt; - MaxActiveAccessCodeCount = maxActiveAccessCodeCount; - Message = message; - WarningCode = warningCode; - } - - /// - /// Number of active access codes on the device when the warning was set. - /// - [DataMember( - Name = "active_access_code_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int ActiveAccessCodeCount { get; set; } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Maximum number of active access codes supported by the device. - /// - [DataMember( - Name = "max_active_access_code_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int MaxActiveAccessCodeCount { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "max_access_codes_reached"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceWarningsUnrecognized_model")] - public class DeviceWarningsUnrecognized : DeviceWarnings - { - [JsonConstructorAttribute] - protected DeviceWarningsUnrecognized() { } - - public DeviceWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Indicates whether the lock supports configuring automatic locking. - /// - [DataMember(Name = "can_configure_auto_lock", IsRequired = false, EmitDefaultValue = false)] - public bool? CanConfigureAutoLock { get; set; } - - /// - /// Indicates whether the thermostat supports cooling. - /// - [DataMember(Name = "can_hvac_cool", IsRequired = false, EmitDefaultValue = false)] - public bool? CanHvacCool { get; set; } - - /// - /// Indicates whether the thermostat supports heating. - /// - [DataMember(Name = "can_hvac_heat", IsRequired = false, EmitDefaultValue = false)] - public bool? CanHvacHeat { get; set; } - - /// - /// Indicates whether the thermostat supports simultaneous heating and cooling. - /// - [DataMember(Name = "can_hvac_heat_cool", IsRequired = false, EmitDefaultValue = false)] - public bool? CanHvacHeatCool { get; set; } - - /// - /// Indicates whether the device supports programming offline access codes. - /// - [DataMember( - Name = "can_program_offline_access_codes", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramOfflineAccessCodes { get; set; } - - /// - /// Indicates whether the device supports programming online access codes. - /// - [DataMember( - Name = "can_program_online_access_codes", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramOnlineAccessCodes { get; set; } - - /// - /// Indicates whether the thermostat supports different climate programs for each day of the week. - /// - [DataMember( - Name = "can_program_thermostat_programs_as_different_each_day", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramThermostatProgramsAsDifferentEachDay { get; set; } - - /// - /// Indicates whether the thermostat supports a single climate program applied to every day. - /// - [DataMember( - Name = "can_program_thermostat_programs_as_same_each_day", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramThermostatProgramsAsSameEachDay { get; set; } - - /// - /// Indicates whether the thermostat supports weekday/weekend climate programs. - /// - [DataMember( - Name = "can_program_thermostat_programs_as_weekday_weekend", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramThermostatProgramsAsWeekdayWeekend { get; set; } - - /// - /// Indicates whether the device supports remote locking. - /// - [DataMember(Name = "can_remotely_lock", IsRequired = false, EmitDefaultValue = false)] - public bool? CanRemotelyLock { get; set; } - - /// - /// Indicates whether the device supports remote unlocking. - /// - [DataMember(Name = "can_remotely_unlock", IsRequired = false, EmitDefaultValue = false)] - public bool? CanRemotelyUnlock { get; set; } - - /// - /// Indicates whether the thermostat supports running climate programs. - /// - [DataMember( - Name = "can_run_thermostat_programs", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanRunThermostatPrograms { get; set; } - - /// - /// Indicates whether the device supports simulating connection in a sandbox. - /// - [DataMember(Name = "can_simulate_connection", IsRequired = false, EmitDefaultValue = false)] - public bool? CanSimulateConnection { get; set; } - - /// - /// Indicates whether the device supports simulating disconnection in a sandbox. - /// - [DataMember( - Name = "can_simulate_disconnection", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulateDisconnection { get; set; } - - /// - /// Indicates whether the hub supports simulating connection in a sandbox. - /// - [DataMember( - Name = "can_simulate_hub_connection", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulateHubConnection { get; set; } - - /// - /// Indicates whether the hub supports simulating disconnection in a sandbox. - /// - [DataMember( - Name = "can_simulate_hub_disconnection", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulateHubDisconnection { get; set; } - - /// - /// Indicates whether the device supports simulating a paid subscription in a sandbox. - /// - [DataMember( - Name = "can_simulate_paid_subscription", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulatePaidSubscription { get; set; } - - /// - /// Indicates whether the device supports simulating removal in a sandbox. - /// - [DataMember(Name = "can_simulate_removal", IsRequired = false, EmitDefaultValue = false)] - public bool? CanSimulateRemoval { get; set; } - - /// - /// Indicates whether the thermostat can be turned off. - /// - [DataMember(Name = "can_turn_off_hvac", IsRequired = false, EmitDefaultValue = false)] - public bool? CanTurnOffHvac { get; set; } - - /// - /// Indicates whether the lock supports unlocking with an access code. - /// - [DataMember(Name = "can_unlock_with_code", IsRequired = false, EmitDefaultValue = false)] - public bool? CanUnlockWithCode { get; set; } - - /// - /// Collection of capabilities that the device supports when connected to Seam. Values are `access_code`, which indicates that the device can manage and utilize digital PIN codes for secure access; `lock`, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; `noise_detection`, which indicates that the device supports monitoring and responding to ambient noise levels; `thermostat`, which indicates that the device can regulate and adjust indoor temperatures; `battery`, which indicates that the device can manage battery life and health; and `phone`, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). - /// - [DataMember(Name = "capabilities_supported", IsRequired = false, EmitDefaultValue = false)] - public List CapabilitiesSupported { get; set; } - - /// - /// Unique identifier for the account associated with the device. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the device object was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object CustomMetadata { get; set; } - - /// - /// ID of the device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Manufacturer of the device. Represents the hardware brand, which may differ from the provider. - /// - [DataMember(Name = "device_manufacturer", IsRequired = false, EmitDefaultValue = false)] - public DeviceDeviceManufacturer? DeviceManufacturer { get; set; } - - /// - /// Provider of the device. Represents the third-party service through which the device is controlled. - /// - [DataMember(Name = "device_provider", IsRequired = false, EmitDefaultValue = false)] - public DeviceDeviceProvider? DeviceProvider { get; set; } - - /// - /// Type of the device. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public Device.DeviceTypeEnum DeviceType { get; set; } - - /// - /// Display name of the device, defaults to nickname (if it is set) or `properties.appearance.name`, otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Array of errors associated with the device. Each error object within the array contains two fields: `error_code` and `message`. `error_code` is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Indicates whether Seam manages the device. See also [Managed and Unmanaged Devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Location information for the device. - /// - [DataMember(Name = "location", IsRequired = false, EmitDefaultValue = false)] - public DeviceLocation? Location { get; set; } - - /// - /// Optional nickname to describe the device, settable through Seam. - /// - [DataMember(Name = "nickname", IsRequired = false, EmitDefaultValue = false)] - public string? Nickname { get; set; } - - /// - /// Properties of the device. - /// - [DataMember(Name = "properties", IsRequired = false, EmitDefaultValue = false)] - public DeviceProperties Properties { get; set; } - - /// - /// IDs of the spaces the device is in. - /// - [DataMember(Name = "space_ids", IsRequired = false, EmitDefaultValue = false)] - public List SpaceIds { get; set; } - - /// - /// Array of warnings associated with the device. Each warning object within the array contains two fields: `warning_code` and `message`. `warning_code` is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// Unique identifier for the Seam workspace associated with the device. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceDeviceManufacturer_model")] - public class DeviceDeviceManufacturer - { - [JsonConstructorAttribute] - protected DeviceDeviceManufacturer() { } - - public DeviceDeviceManufacturer( - string displayName = default, - string? imageUrl = default, - string manufacturer = default - ) - { - DisplayName = displayName; - ImageUrl = imageUrl; - Manufacturer = manufacturer; - } - - /// - /// Display name for the manufacturer, such as `August`, `Yale`, `Salto`, and so on. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Image URL for the manufacturer logo. - /// - [DataMember(Name = "image_url", IsRequired = false, EmitDefaultValue = false)] - public string? ImageUrl { get; set; } - - /// - /// Manufacturer identifier, such as `august`, `yale`, `salto`, and so on. - /// - [DataMember(Name = "manufacturer", IsRequired = false, EmitDefaultValue = false)] - public string Manufacturer { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceDeviceProvider_model")] - public class DeviceDeviceProvider - { - [JsonConstructorAttribute] - protected DeviceDeviceProvider() { } - - public DeviceDeviceProvider( - string deviceProviderName = default, - string displayName = default, - string? imageUrl = default, - string providerCategory = default - ) - { - DeviceProviderName = deviceProviderName; - DisplayName = displayName; - ImageUrl = imageUrl; - ProviderCategory = providerCategory; - } - - /// - /// Device provider name. Corresponds to the integration type, such as `august`, `schlage`, `yale_access`, and so on. - /// - [DataMember(Name = "device_provider_name", IsRequired = false, EmitDefaultValue = false)] - public string DeviceProviderName { get; set; } - - /// - /// Display name for the device provider type. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Image URL for the device provider. - /// - [DataMember(Name = "image_url", IsRequired = false, EmitDefaultValue = false)] - public string? ImageUrl { get; set; } - - /// - /// Provider category. Indicates the third-party provider type, such as `stable`, for stable integrations, or `internal`, for internal integrations. - /// - [DataMember(Name = "provider_category", IsRequired = false, EmitDefaultValue = false)] - public string ProviderCategory { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceLocation_model")] - public class DeviceLocation - { - [JsonConstructorAttribute] - protected DeviceLocation() { } - - public DeviceLocation( - string? locationName = default, - string? roomName = default, - string? timeZone = default, - string? timezone = default - ) - { - LocationName = locationName; - RoomName = roomName; - TimeZone = timeZone; - Timezone = timezone; - } - - /// - /// Name of the device location. - /// - [DataMember(Name = "location_name", IsRequired = false, EmitDefaultValue = false)] - public string? LocationName { get; set; } - - /// - /// Name of the room within the device location, when the provider reports one. - /// - [DataMember(Name = "room_name", IsRequired = false, EmitDefaultValue = false)] - public string? RoomName { get; set; } - - /// - /// Time zone of the device location. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - /// - /// Time zone of the device location. - /// - [Obsolete("Use `time_zone` instead.")] - [DataMember(Name = "timezone", IsRequired = false, EmitDefaultValue = false)] - public string? Timezone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_deviceProperties_model")] - public class DeviceProperties - { - [JsonConstructorAttribute] - protected DeviceProperties() { } - - public DeviceProperties( - DevicePropertiesAccessoryKeypad? accessoryKeypad = default, - DevicePropertiesAppearance appearance = default, - DevicePropertiesBattery? battery = default, - float? batteryLevel = default, - List? currentlyTriggeringNoiseThresholdIds = default, - bool? hasDirectPower = default, - string? imageAltText = default, - string? imageUrl = default, - string? manufacturer = default, - DevicePropertiesModel model = default, - string name = default, - float? noiseLevelDecibels = default, - bool? offlineAccessCodesEnabled = default, - bool online = default, - bool? onlineAccessCodesEnabled = default, - string? serialNumber = default, - bool? supportsAccessoryKeypad = default, - bool? supportsOfflineAccessCodes = default, - DevicePropertiesAssaAbloyCredentialServiceMetadata? assaAbloyCredentialServiceMetadata = - default, - DevicePropertiesSaltoSpaceCredentialServiceMetadata? saltoSpaceCredentialServiceMetadata = - default, - DevicePropertiesAkilesMetadata? akilesMetadata = default, - DevicePropertiesAqaraMetadata? aqaraMetadata = default, - DevicePropertiesAssaAbloyVostioMetadata? assaAbloyVostioMetadata = default, - DevicePropertiesAugustMetadata? augustMetadata = default, - DevicePropertiesAvigilonAltaMetadata? avigilonAltaMetadata = default, - DevicePropertiesBrivoMetadata? brivoMetadata = default, - DevicePropertiesControlbywebMetadata? controlbywebMetadata = default, - DevicePropertiesDormakabaOracodeMetadata? dormakabaOracodeMetadata = default, - DevicePropertiesEcobeeMetadata? ecobeeMetadata = default, - DevicePropertiesFourSuitesMetadata? fourSuitesMetadata = default, - DevicePropertiesGenieMetadata? genieMetadata = default, - DevicePropertiesHoneywellResideoMetadata? honeywellResideoMetadata = default, - DevicePropertiesIglooMetadata? iglooMetadata = default, - DevicePropertiesIgloohomeMetadata? igloohomeMetadata = default, - DevicePropertiesKeynestMetadata? keynestMetadata = default, - DevicePropertiesKisiMetadata? kisiMetadata = default, - DevicePropertiesKorelockMetadata? korelockMetadata = default, - DevicePropertiesKwiksetMetadata? kwiksetMetadata = default, - DevicePropertiesLocklyMetadata? locklyMetadata = default, - DevicePropertiesMinutMetadata? minutMetadata = default, - DevicePropertiesNestMetadata? nestMetadata = default, - DevicePropertiesNoiseawareMetadata? noiseawareMetadata = default, - DevicePropertiesNukiMetadata? nukiMetadata = default, - DevicePropertiesOmnitecMetadata? omnitecMetadata = default, - DevicePropertiesRingMetadata? ringMetadata = default, - DevicePropertiesSaltoKsMetadata? saltoKsMetadata = default, - DevicePropertiesSaltoMetadata? saltoMetadata = default, - DevicePropertiesSchlageMetadata? schlageMetadata = default, - DevicePropertiesSeamBridgeMetadata? seamBridgeMetadata = default, - DevicePropertiesSensiMetadata? sensiMetadata = default, - DevicePropertiesSmartthingsMetadata? smartthingsMetadata = default, - DevicePropertiesTadoMetadata? tadoMetadata = default, - DevicePropertiesTedeeMetadata? tedeeMetadata = default, - DevicePropertiesTtlockMetadata? ttlockMetadata = default, - DevicePropertiesTwoNMetadata? twoNMetadata = default, - DevicePropertiesUltraloqMetadata? ultraloqMetadata = default, - DevicePropertiesVisionlineMetadata? visionlineMetadata = default, - DevicePropertiesWyzeMetadata? wyzeMetadata = default, - DevicePropertiesYacanMetadata? yacanMetadata = default, - float? autoLockDelaySeconds = default, - bool? autoLockEnabled = default, - bool? backupAccessCodePoolEnabled = default, - List? codeConstraints = default, - bool? doorOpen = default, - bool? hasNativeEntryEvents = default, - DevicePropertiesKeypadBattery? keypadBattery = default, - bool? locked = default, - float? maxActiveCodesSupported = default, - List? offlineTimeFrameOptions = default, - List? onlineTimeFrameOptions = default, - List? supportedCodeLengths = default, - bool? supportsBackupAccessCodePool = default, - DevicePropertiesActiveThermostatSchedule? activeThermostatSchedule = default, - string? activeThermostatScheduleId = default, - List? availableClimatePresetModes = - default, - List? availableClimatePresets = default, - List? availableFanModeSettings = default, - List? availableHvacModeSettings = - default, - DevicePropertiesCurrentClimateSetting? currentClimateSetting = default, - DevicePropertiesDefaultClimateSetting? defaultClimateSetting = default, - string? fallbackClimatePresetKey = default, - DeviceProperties.FanModeSettingEnum? fanModeSetting = default, - bool? isCooling = default, - bool? isFanRunning = default, - bool? isHeating = default, - bool? isTemporaryManualOverrideActive = default, - float? maxCoolingSetPointCelsius = default, - float? maxCoolingSetPointFahrenheit = default, - float? maxHeatingSetPointCelsius = default, - float? maxHeatingSetPointFahrenheit = default, - float? maxThermostatDailyProgramPeriodsPerDay = default, - float? maxUniqueClimatePresetsPerThermostatWeeklyProgram = default, - float? minCoolingSetPointCelsius = default, - float? minCoolingSetPointFahrenheit = default, - float? minHeatingCoolingDeltaCelsius = default, - float? minHeatingCoolingDeltaFahrenheit = default, - float? minHeatingSetPointCelsius = default, - float? minHeatingSetPointFahrenheit = default, - float? relativeHumidity = default, - float? temperatureCelsius = default, - float? temperatureFahrenheit = default, - DevicePropertiesTemperatureThreshold? temperatureThreshold = default, - float? thermostatDailyProgramPeriodPrecisionMinutes = default, - List? thermostatDailyPrograms = default, - DevicePropertiesThermostatWeeklyProgram? thermostatWeeklyProgram = default - ) - { - AccessoryKeypad = accessoryKeypad; - Appearance = appearance; - Battery = battery; - BatteryLevel = batteryLevel; - CurrentlyTriggeringNoiseThresholdIds = currentlyTriggeringNoiseThresholdIds; - HasDirectPower = hasDirectPower; - ImageAltText = imageAltText; - ImageUrl = imageUrl; - Manufacturer = manufacturer; - Model = model; - Name = name; - NoiseLevelDecibels = noiseLevelDecibels; - OfflineAccessCodesEnabled = offlineAccessCodesEnabled; - Online = online; - OnlineAccessCodesEnabled = onlineAccessCodesEnabled; - SerialNumber = serialNumber; - SupportsAccessoryKeypad = supportsAccessoryKeypad; - SupportsOfflineAccessCodes = supportsOfflineAccessCodes; - AssaAbloyCredentialServiceMetadata = assaAbloyCredentialServiceMetadata; - SaltoSpaceCredentialServiceMetadata = saltoSpaceCredentialServiceMetadata; - AkilesMetadata = akilesMetadata; - AqaraMetadata = aqaraMetadata; - AssaAbloyVostioMetadata = assaAbloyVostioMetadata; - AugustMetadata = augustMetadata; - AvigilonAltaMetadata = avigilonAltaMetadata; - BrivoMetadata = brivoMetadata; - ControlbywebMetadata = controlbywebMetadata; - DormakabaOracodeMetadata = dormakabaOracodeMetadata; - EcobeeMetadata = ecobeeMetadata; - FourSuitesMetadata = fourSuitesMetadata; - GenieMetadata = genieMetadata; - HoneywellResideoMetadata = honeywellResideoMetadata; - IglooMetadata = iglooMetadata; - IgloohomeMetadata = igloohomeMetadata; - KeynestMetadata = keynestMetadata; - KisiMetadata = kisiMetadata; - KorelockMetadata = korelockMetadata; - KwiksetMetadata = kwiksetMetadata; - LocklyMetadata = locklyMetadata; - MinutMetadata = minutMetadata; - NestMetadata = nestMetadata; - NoiseawareMetadata = noiseawareMetadata; - NukiMetadata = nukiMetadata; - OmnitecMetadata = omnitecMetadata; - RingMetadata = ringMetadata; - SaltoKsMetadata = saltoKsMetadata; - SaltoMetadata = saltoMetadata; - SchlageMetadata = schlageMetadata; - SeamBridgeMetadata = seamBridgeMetadata; - SensiMetadata = sensiMetadata; - SmartthingsMetadata = smartthingsMetadata; - TadoMetadata = tadoMetadata; - TedeeMetadata = tedeeMetadata; - TtlockMetadata = ttlockMetadata; - TwoNMetadata = twoNMetadata; - UltraloqMetadata = ultraloqMetadata; - VisionlineMetadata = visionlineMetadata; - WyzeMetadata = wyzeMetadata; - YacanMetadata = yacanMetadata; - AutoLockDelaySeconds = autoLockDelaySeconds; - AutoLockEnabled = autoLockEnabled; - BackupAccessCodePoolEnabled = backupAccessCodePoolEnabled; - CodeConstraints = codeConstraints; - DoorOpen = doorOpen; - HasNativeEntryEvents = hasNativeEntryEvents; - KeypadBattery = keypadBattery; - Locked = locked; - MaxActiveCodesSupported = maxActiveCodesSupported; - OfflineTimeFrameOptions = offlineTimeFrameOptions; - OnlineTimeFrameOptions = onlineTimeFrameOptions; - SupportedCodeLengths = supportedCodeLengths; - SupportsBackupAccessCodePool = supportsBackupAccessCodePool; - ActiveThermostatSchedule = activeThermostatSchedule; - ActiveThermostatScheduleId = activeThermostatScheduleId; - AvailableClimatePresetModes = availableClimatePresetModes; - AvailableClimatePresets = availableClimatePresets; - AvailableFanModeSettings = availableFanModeSettings; - AvailableHvacModeSettings = availableHvacModeSettings; - CurrentClimateSetting = currentClimateSetting; - DefaultClimateSetting = defaultClimateSetting; - FallbackClimatePresetKey = fallbackClimatePresetKey; - FanModeSetting = fanModeSetting; - IsCooling = isCooling; - IsFanRunning = isFanRunning; - IsHeating = isHeating; - IsTemporaryManualOverrideActive = isTemporaryManualOverrideActive; - MaxCoolingSetPointCelsius = maxCoolingSetPointCelsius; - MaxCoolingSetPointFahrenheit = maxCoolingSetPointFahrenheit; - MaxHeatingSetPointCelsius = maxHeatingSetPointCelsius; - MaxHeatingSetPointFahrenheit = maxHeatingSetPointFahrenheit; - MaxThermostatDailyProgramPeriodsPerDay = maxThermostatDailyProgramPeriodsPerDay; - MaxUniqueClimatePresetsPerThermostatWeeklyProgram = - maxUniqueClimatePresetsPerThermostatWeeklyProgram; - MinCoolingSetPointCelsius = minCoolingSetPointCelsius; - MinCoolingSetPointFahrenheit = minCoolingSetPointFahrenheit; - MinHeatingCoolingDeltaCelsius = minHeatingCoolingDeltaCelsius; - MinHeatingCoolingDeltaFahrenheit = minHeatingCoolingDeltaFahrenheit; - MinHeatingSetPointCelsius = minHeatingSetPointCelsius; - MinHeatingSetPointFahrenheit = minHeatingSetPointFahrenheit; - RelativeHumidity = relativeHumidity; - TemperatureCelsius = temperatureCelsius; - TemperatureFahrenheit = temperatureFahrenheit; - TemperatureThreshold = temperatureThreshold; - ThermostatDailyProgramPeriodPrecisionMinutes = - thermostatDailyProgramPeriodPrecisionMinutes; - ThermostatDailyPrograms = thermostatDailyPrograms; - ThermostatWeeklyProgram = thermostatWeeklyProgram; - } - - /// - /// Climate preset modes that the thermostat supports, such as "home", "away", "wake", "sleep", "occupied", and "unoccupied". - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AvailableClimatePresetModesEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "home")] - Home = 1, - - [EnumMember(Value = "away")] - Away = 2, - - [EnumMember(Value = "wake")] - Wake = 3, - - [EnumMember(Value = "sleep")] - Sleep = 4, - - [EnumMember(Value = "occupied")] - Occupied = 5, - - [EnumMember(Value = "unoccupied")] - Unoccupied = 6, - } - - /// - /// Fan mode settings that the thermostat supports. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AvailableFanModeSettingsEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// HVAC mode settings that the thermostat supports. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum AvailableHvacModeSettingsEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "off")] - Off = 1, - - [EnumMember(Value = "heat")] - Heat = 2, - - [EnumMember(Value = "cool")] - Cool = 3, - - [EnumMember(Value = "heat_cool")] - HeatCool = 4, - - [EnumMember(Value = "eco")] - Eco = 5, - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum FanModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// Accessory keypad properties and state. - /// - [DataMember(Name = "accessory_keypad", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAccessoryKeypad? AccessoryKeypad { get; set; } - - /// - /// Appearance-related properties, as reported by the device. - /// - [DataMember(Name = "appearance", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAppearance Appearance { get; set; } - - /// - /// Represents the current status of the battery charge level. - /// - [DataMember(Name = "battery", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesBattery? Battery { get; set; } - - /// - /// Indicates the battery level of the device as a decimal value between 0 and 1, inclusive. - /// - [DataMember(Name = "battery_level", IsRequired = false, EmitDefaultValue = false)] - public float? BatteryLevel { get; set; } - - /// - /// Array of noise threshold IDs that are currently triggering. - /// - [DataMember( - Name = "currently_triggering_noise_threshold_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? CurrentlyTriggeringNoiseThresholdIds { get; set; } - - /// - /// Indicates whether the device has direct power. - /// - [DataMember(Name = "has_direct_power", IsRequired = false, EmitDefaultValue = false)] - public bool? HasDirectPower { get; set; } - - /// - /// Alt text for the device image. - /// - [DataMember(Name = "image_alt_text", IsRequired = false, EmitDefaultValue = false)] - public string? ImageAltText { get; set; } - - /// - /// Image URL for the device. - /// - [DataMember(Name = "image_url", IsRequired = false, EmitDefaultValue = false)] - public string? ImageUrl { get; set; } - - /// - /// Manufacturer of the device. When a device, such as a smart lock, is connected through a smart hub, the manufacturer of the device might be different from that of the smart hub. - /// - [DataMember(Name = "manufacturer", IsRequired = false, EmitDefaultValue = false)] - public string? Manufacturer { get; set; } - - /// - /// Device model-related properties. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesModel Model { get; set; } - - /// - /// Name of the device. - /// - [Obsolete("use device.display_name instead")] - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Indicates current noise level in decibels, if the device supports noise detection. - /// - [DataMember(Name = "noise_level_decibels", IsRequired = false, EmitDefaultValue = false)] - public float? NoiseLevelDecibels { get; set; } - - /// - /// Indicates whether it is currently possible to use offline access codes for the device. - /// - [Obsolete("use device.can_program_offline_access_codes")] - [DataMember( - Name = "offline_access_codes_enabled", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? OfflineAccessCodesEnabled { get; set; } - - /// - /// Indicates whether the device is online. - /// - [DataMember(Name = "online", IsRequired = false, EmitDefaultValue = false)] - public bool Online { get; set; } - - /// - /// Indicates whether it is currently possible to use online access codes for the device. - /// - [Obsolete("use device.can_program_online_access_codes")] - [DataMember( - Name = "online_access_codes_enabled", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? OnlineAccessCodesEnabled { get; set; } - - /// - /// Serial number of the device. - /// - [DataMember(Name = "serial_number", IsRequired = false, EmitDefaultValue = false)] - public string? SerialNumber { get; set; } - - [Obsolete("use device.properties.model.can_connect_accessory_keypad")] - [DataMember( - Name = "supports_accessory_keypad", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? SupportsAccessoryKeypad { get; set; } - - [Obsolete("use offline_access_codes_enabled")] - [DataMember( - Name = "supports_offline_access_codes", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? SupportsOfflineAccessCodes { get; set; } - - /// - /// ASSA ABLOY Credential Service metadata for the phone. - /// - [DataMember( - Name = "assa_abloy_credential_service_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public DevicePropertiesAssaAbloyCredentialServiceMetadata? AssaAbloyCredentialServiceMetadata { get; set; } - - /// - /// Salto Space credential service metadata for the phone. - /// - [DataMember( - Name = "salto_space_credential_service_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public DevicePropertiesSaltoSpaceCredentialServiceMetadata? SaltoSpaceCredentialServiceMetadata { get; set; } - - /// - /// Metadata for an Akiles device. - /// - [DataMember(Name = "akiles_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAkilesMetadata? AkilesMetadata { get; set; } - - /// - /// Metadata for an Aqara device. - /// - [DataMember(Name = "aqara_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAqaraMetadata? AqaraMetadata { get; set; } - - /// - /// Metadata for an ASSA ABLOY Vostio system. - /// - [DataMember( - Name = "assa_abloy_vostio_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public DevicePropertiesAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; set; } - - /// - /// Metadata for an August device. - /// - [DataMember(Name = "august_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAugustMetadata? AugustMetadata { get; set; } - - /// - /// Metadata for an Avigilon Alta system. - /// - [DataMember(Name = "avigilon_alta_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAvigilonAltaMetadata? AvigilonAltaMetadata { get; set; } - - /// - /// Metadata for a Brivo device. - /// - [DataMember(Name = "brivo_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesBrivoMetadata? BrivoMetadata { get; set; } - - /// - /// Metadata for a ControlByWeb device. - /// - [DataMember(Name = "controlbyweb_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesControlbywebMetadata? ControlbywebMetadata { get; set; } - - /// - /// Metadata for a dormakaba Oracode device. - /// - [DataMember( - Name = "dormakaba_oracode_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public DevicePropertiesDormakabaOracodeMetadata? DormakabaOracodeMetadata { get; set; } - - /// - /// Metadata for an ecobee device. - /// - [DataMember(Name = "ecobee_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesEcobeeMetadata? EcobeeMetadata { get; set; } - - /// - /// Metadata for a 4SUITES device. - /// - [DataMember(Name = "four_suites_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesFourSuitesMetadata? FourSuitesMetadata { get; set; } - - /// - /// Metadata for a Genie device. - /// - [DataMember(Name = "genie_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesGenieMetadata? GenieMetadata { get; set; } - - /// - /// Metadata for a Honeywell Resideo device. - /// - [DataMember( - Name = "honeywell_resideo_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public DevicePropertiesHoneywellResideoMetadata? HoneywellResideoMetadata { get; set; } - - /// - /// Metadata for an igloo device. - /// - [DataMember(Name = "igloo_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesIglooMetadata? IglooMetadata { get; set; } - - /// - /// Metadata for an igloohome device. - /// - [DataMember(Name = "igloohome_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesIgloohomeMetadata? IgloohomeMetadata { get; set; } - - /// - /// Metadata for a KeyNest device. - /// - [DataMember(Name = "keynest_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesKeynestMetadata? KeynestMetadata { get; set; } - - /// - /// Metadata for a Kisi device. - /// - [DataMember(Name = "kisi_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesKisiMetadata? KisiMetadata { get; set; } - - /// - /// Metadata for a Korelock device. - /// - [DataMember(Name = "korelock_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesKorelockMetadata? KorelockMetadata { get; set; } - - /// - /// Metadata for a Kwikset device. - /// - [DataMember(Name = "kwikset_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesKwiksetMetadata? KwiksetMetadata { get; set; } - - /// - /// Metadata for a Lockly device. - /// - [DataMember(Name = "lockly_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesLocklyMetadata? LocklyMetadata { get; set; } - - /// - /// Metadata for a Minut device. - /// - [DataMember(Name = "minut_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesMinutMetadata? MinutMetadata { get; set; } - - /// - /// Metadata for a Google Nest device. - /// - [DataMember(Name = "nest_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesNestMetadata? NestMetadata { get; set; } - - /// - /// Metadata for a NoiseAware device. - /// - [DataMember(Name = "noiseaware_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesNoiseawareMetadata? NoiseawareMetadata { get; set; } - - /// - /// Metadata for a Nuki device. - /// - [DataMember(Name = "nuki_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesNukiMetadata? NukiMetadata { get; set; } - - /// - /// Metadata for an Omnitec device. - /// - [DataMember(Name = "omnitec_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesOmnitecMetadata? OmnitecMetadata { get; set; } - - /// - /// Metadata for a Ring device. - /// - [DataMember(Name = "ring_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesRingMetadata? RingMetadata { get; set; } - - /// - /// Metadata for a Salto KS device. - /// - [DataMember(Name = "salto_ks_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesSaltoKsMetadata? SaltoKsMetadata { get; set; } - - /// - /// Metada for a Salto device. - /// - [Obsolete("Use `salto_ks_metadata` instead.")] - [DataMember(Name = "salto_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesSaltoMetadata? SaltoMetadata { get; set; } - - /// - /// Metadata for a Schlage device. - /// - [DataMember(Name = "schlage_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesSchlageMetadata? SchlageMetadata { get; set; } - - /// - /// Metadata for Seam Bridge. - /// - [DataMember(Name = "seam_bridge_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesSeamBridgeMetadata? SeamBridgeMetadata { get; set; } - - /// - /// Metadata for a Sensi device. - /// - [DataMember(Name = "sensi_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesSensiMetadata? SensiMetadata { get; set; } - - /// - /// Metadata for a SmartThings device. - /// - [DataMember(Name = "smartthings_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesSmartthingsMetadata? SmartthingsMetadata { get; set; } - - /// - /// Metadata for a tado° device. - /// - [DataMember(Name = "tado_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesTadoMetadata? TadoMetadata { get; set; } - - /// - /// Metadata for a Tedee device. - /// - [DataMember(Name = "tedee_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesTedeeMetadata? TedeeMetadata { get; set; } - - /// - /// Metadata for a TTLock device. - /// - [DataMember(Name = "ttlock_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesTtlockMetadata? TtlockMetadata { get; set; } - - /// - /// Metadata for a 2N device. - /// - [DataMember(Name = "two_n_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesTwoNMetadata? TwoNMetadata { get; set; } - - /// - /// Metadata for an Ultraloq device. - /// - [DataMember(Name = "ultraloq_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesUltraloqMetadata? UltraloqMetadata { get; set; } - - /// - /// Metadata for an ASSA ABLOY Visionline system. - /// - [DataMember(Name = "visionline_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesVisionlineMetadata? VisionlineMetadata { get; set; } - - /// - /// Metadata for a Wyze device. - /// - [DataMember(Name = "wyze_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesWyzeMetadata? WyzeMetadata { get; set; } - - /// - /// Metadata for a Yacan device. - /// - [DataMember(Name = "yacan_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesYacanMetadata? YacanMetadata { get; set; } - - /// - /// The delay in seconds before the lock automatically locks after being unlocked. - /// - [DataMember(Name = "auto_lock_delay_seconds", IsRequired = false, EmitDefaultValue = false)] - public float? AutoLockDelaySeconds { get; set; } - - /// - /// Indicates whether automatic locking is enabled. - /// - [DataMember(Name = "auto_lock_enabled", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoLockEnabled { get; set; } - - /// - /// Indicates whether the [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) is currently enabled for the device. To disable it, set this to `false` using [/devices/update](https://docs.seam.co/api/devices/update). - /// - [DataMember( - Name = "backup_access_code_pool_enabled", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? BackupAccessCodePoolEnabled { get; set; } - - /// - /// Constraints on access codes for the device. Seam represents each constraint as an object with a `constraint_type` property. Depending on the constraint type, there may also be additional properties. Note that some constraints are manufacturer- or device-specific. - /// - [DataMember(Name = "code_constraints", IsRequired = false, EmitDefaultValue = false)] - public List? CodeConstraints { get; set; } - - /// - /// Indicates whether the door is open. - /// - [DataMember(Name = "door_open", IsRequired = false, EmitDefaultValue = false)] - public bool? DoorOpen { get; set; } - - /// - /// Indicates whether the device supports native entry events. - /// - [DataMember(Name = "has_native_entry_events", IsRequired = false, EmitDefaultValue = false)] - public bool? HasNativeEntryEvents { get; set; } - - /// - /// Keypad battery status. - /// - [DataMember(Name = "keypad_battery", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesKeypadBattery? KeypadBattery { get; set; } - - /// - /// Indicates whether the lock is locked. - /// - [DataMember(Name = "locked", IsRequired = false, EmitDefaultValue = false)] - public bool? Locked { get; set; } - - /// - /// Maximum number of active access codes that the device supports. - /// - [DataMember( - Name = "max_active_codes_supported", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MaxActiveCodesSupported { get; set; } - - /// - /// Time frames that may be requested when creating an offline access code, expressed as a list of options. The caller picks one option (by matching the requested duration when the options' duration ranges do not overlap, or by `display_name` when they do) and satisfies that one option's rules. When `undefined`, any time frame works. - /// - [DataMember( - Name = "offline_time_frame_options", - IsRequired = false, - EmitDefaultValue = false - )] - public List? OfflineTimeFrameOptions { get; set; } - - /// - /// Time frames that may be requested when creating an online access code, expressed as a list of options. The caller picks one option (by matching the requested duration when the options' duration ranges do not overlap, or by `display_name` when they do) and satisfies that one option's rules. When `undefined`, any time frame works. - /// - [DataMember( - Name = "online_time_frame_options", - IsRequired = false, - EmitDefaultValue = false - )] - public List? OnlineTimeFrameOptions { get; set; } - - /// - /// Supported code lengths for access codes. - /// - [DataMember(Name = "supported_code_lengths", IsRequired = false, EmitDefaultValue = false)] - public List? SupportedCodeLengths { get; set; } - - /// - /// Indicates whether the device supports a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes). - /// - [DataMember( - Name = "supports_backup_access_code_pool", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? SupportsBackupAccessCodePool { get; set; } - - /// - /// Active [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [Obsolete("Use `active_thermostat_schedule_id` with `/thermostats/schedules/get` instead.")] - [DataMember( - Name = "active_thermostat_schedule", - IsRequired = false, - EmitDefaultValue = false - )] - public DevicePropertiesActiveThermostatSchedule? ActiveThermostatSchedule { get; set; } - - /// - /// ID of the active [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [DataMember( - Name = "active_thermostat_schedule_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ActiveThermostatScheduleId { get; set; } - - /// - /// Climate preset modes that the thermostat supports, such as "home", "away", "wake", "sleep", "occupied", and "unoccupied". - /// - [DataMember( - Name = "available_climate_preset_modes", - IsRequired = false, - EmitDefaultValue = false - )] - public List? AvailableClimatePresetModes { get; set; } - - /// - /// Available [climate presets](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for the thermostat. - /// - [DataMember( - Name = "available_climate_presets", - IsRequired = false, - EmitDefaultValue = false - )] - public List? AvailableClimatePresets { get; set; } - - /// - /// Fan mode settings that the thermostat supports. - /// - [DataMember( - Name = "available_fan_mode_settings", - IsRequired = false, - EmitDefaultValue = false - )] - public List? AvailableFanModeSettings { get; set; } - - /// - /// HVAC mode settings that the thermostat supports. - /// - [DataMember( - Name = "available_hvac_mode_settings", - IsRequired = false, - EmitDefaultValue = false - )] - public List? AvailableHvacModeSettings { get; set; } - - /// - /// Current climate setting. - /// - [DataMember(Name = "current_climate_setting", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesCurrentClimateSetting? CurrentClimateSetting { get; set; } - - [Obsolete("use fallback_climate_preset_key to specify a fallback climate preset instead.")] - [DataMember(Name = "default_climate_setting", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesDefaultClimateSetting? DefaultClimateSetting { get; set; } - - /// - /// Key of the [fallback climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) for the thermostat. - /// - [DataMember( - Name = "fallback_climate_preset_key", - IsRequired = false, - EmitDefaultValue = false - )] - public string? FallbackClimatePresetKey { get; set; } - - [Obsolete("Use `current_climate_setting.fan_mode_setting` instead.")] - [DataMember(Name = "fan_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public DeviceProperties.FanModeSettingEnum? FanModeSetting { get; set; } - - /// - /// Indicates whether the connected HVAC system is currently cooling, as reported by the thermostat. - /// - [DataMember(Name = "is_cooling", IsRequired = false, EmitDefaultValue = false)] - public bool? IsCooling { get; set; } - - /// - /// Indicates whether the fan in the connected HVAC system is currently running, as reported by the thermostat. - /// - [DataMember(Name = "is_fan_running", IsRequired = false, EmitDefaultValue = false)] - public bool? IsFanRunning { get; set; } - - /// - /// Indicates whether the connected HVAC system is currently heating, as reported by the thermostat. - /// - [DataMember(Name = "is_heating", IsRequired = false, EmitDefaultValue = false)] - public bool? IsHeating { get; set; } - - /// - /// Indicates whether the current thermostat settings differ from the most recent active program or schedule that Seam activated. For this condition to occur, `current_climate_setting.manual_override_allowed` must also be `true`. - /// - [DataMember( - Name = "is_temporary_manual_override_active", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsTemporaryManualOverrideActive { get; set; } - - /// - /// Maximum [cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#cooling-set-point) in °C. - /// - [DataMember( - Name = "max_cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MaxCoolingSetPointCelsius { get; set; } - - /// - /// Maximum [cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#cooling-set-point) in °F. - /// - [DataMember( - Name = "max_cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MaxCoolingSetPointFahrenheit { get; set; } - - /// - /// Maximum [heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#heating-set-point) in °C. - /// - [DataMember( - Name = "max_heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MaxHeatingSetPointCelsius { get; set; } - - /// - /// Maximum [heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#heating-set-point) in °F. - /// - [DataMember( - Name = "max_heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MaxHeatingSetPointFahrenheit { get; set; } - - /// - /// Maximum number of periods that the thermostat can support per day. For example, if the thermostat supports 4 periods per day, this value is 4. - /// - [DataMember( - Name = "max_thermostat_daily_program_periods_per_day", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MaxThermostatDailyProgramPeriodsPerDay { get; set; } - - /// - /// Maximum number of climate presets that the thermostat can support for weekly programming. - /// - [DataMember( - Name = "max_unique_climate_presets_per_thermostat_weekly_program", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MaxUniqueClimatePresetsPerThermostatWeeklyProgram { get; set; } - - /// - /// Minimum [cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#cooling-set-point) in °C. - /// - [DataMember( - Name = "min_cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MinCoolingSetPointCelsius { get; set; } - - /// - /// Minimum [cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#cooling-set-point) in °F. - /// - [DataMember( - Name = "min_cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MinCoolingSetPointFahrenheit { get; set; } - - /// - /// Minimum [temperature difference](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#minimum-heating-cooling-temperature-delta) in °C between the cooling and heating set points when in heat-cool (auto) mode. - /// - [DataMember( - Name = "min_heating_cooling_delta_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MinHeatingCoolingDeltaCelsius { get; set; } - - /// - /// Minimum [temperature difference](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#minimum-heating-cooling-temperature-delta) in °F between the cooling and heating set points when in heat-cool (auto) mode. - /// - [DataMember( - Name = "min_heating_cooling_delta_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MinHeatingCoolingDeltaFahrenheit { get; set; } - - /// - /// Minimum [heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#heating-set-point) in °C. - /// - [DataMember( - Name = "min_heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MinHeatingSetPointCelsius { get; set; } - - /// - /// Minimum [heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#heating-set-point) in °F. - /// - [DataMember( - Name = "min_heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? MinHeatingSetPointFahrenheit { get; set; } - - /// - /// Reported relative humidity, as a value between 0 and 1, inclusive. - /// - [DataMember(Name = "relative_humidity", IsRequired = false, EmitDefaultValue = false)] - public float? RelativeHumidity { get; set; } - - /// - /// Reported temperature in °C. - /// - [DataMember(Name = "temperature_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? TemperatureCelsius { get; set; } - - /// - /// Reported temperature in °F. - /// - [DataMember(Name = "temperature_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float? TemperatureFahrenheit { get; set; } - - /// - /// Current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. - /// - [DataMember(Name = "temperature_threshold", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesTemperatureThreshold? TemperatureThreshold { get; set; } - - /// - /// Precision of the thermostat's period in minutes. For example, if the thermostat supports 15-minute periods, this value is 15. All values are relative to the top of the hour, so for 15 minutes, the periods would be 0, 15, 30, and 45 minutes past the hour. - /// - [DataMember( - Name = "thermostat_daily_program_period_precision_minutes", - IsRequired = false, - EmitDefaultValue = false - )] - public float? ThermostatDailyProgramPeriodPrecisionMinutes { get; set; } - - /// - /// Configured [daily programs](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-programs) for the thermostat. - /// - [DataMember( - Name = "thermostat_daily_programs", - IsRequired = false, - EmitDefaultValue = false - )] - public List? ThermostatDailyPrograms { get; set; } - - /// - /// Current [weekly program](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-programs) for the thermostat. - /// - [DataMember( - Name = "thermostat_weekly_program", - IsRequired = false, - EmitDefaultValue = false - )] - public DevicePropertiesThermostatWeeklyProgram? ThermostatWeeklyProgram { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAccessoryKeypad_model")] - public class DevicePropertiesAccessoryKeypad - { - [JsonConstructorAttribute] - protected DevicePropertiesAccessoryKeypad() { } - - public DevicePropertiesAccessoryKeypad( - DevicePropertiesAccessoryKeypadBattery? battery = default, - bool isConnected = default - ) - { - Battery = battery; - IsConnected = isConnected; - } - - /// - /// Keypad battery properties. - /// - [DataMember(Name = "battery", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAccessoryKeypadBattery? Battery { get; set; } - - /// - /// Indicates if an accessory keypad is connected to the device. - /// - [DataMember(Name = "is_connected", IsRequired = false, EmitDefaultValue = false)] - public bool IsConnected { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAccessoryKeypadBattery_model")] - public class DevicePropertiesAccessoryKeypadBattery - { - [JsonConstructorAttribute] - protected DevicePropertiesAccessoryKeypadBattery() { } - - public DevicePropertiesAccessoryKeypadBattery(float level = default) - { - Level = level; - } - - [DataMember(Name = "level", IsRequired = false, EmitDefaultValue = false)] - public float Level { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAppearance_model")] - public class DevicePropertiesAppearance - { - [JsonConstructorAttribute] - protected DevicePropertiesAppearance() { } - - public DevicePropertiesAppearance(string name = default) - { - Name = name; - } - - /// - /// Name of the device as seen from the provider API and application, not settable through Seam. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesBattery_model")] - public class DevicePropertiesBattery - { - [JsonConstructorAttribute] - protected DevicePropertiesBattery() { } - - public DevicePropertiesBattery( - float level = default, - DevicePropertiesBattery.StatusEnum status = default - ) - { - Level = level; - Status = status; - } - - /// - /// Represents the current status of the battery charge level. Values are `critical`, which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; `low`, which signifies that the battery is under the preferred threshold and should be charged soon; `good`, which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and `full`, which represents a battery that is fully charged, providing the maximum duration of usage. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "critical")] - Critical = 1, - - [EnumMember(Value = "low")] - Low = 2, - - [EnumMember(Value = "good")] - Good = 3, - - [EnumMember(Value = "full")] - Full = 4, - } - - /// - /// Battery charge level as a value between 0 and 1, inclusive. - /// - [DataMember(Name = "level", IsRequired = false, EmitDefaultValue = false)] - public float Level { get; set; } - - /// - /// Represents the current status of the battery charge level. Values are `critical`, which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; `low`, which signifies that the battery is under the preferred threshold and should be charged soon; `good`, which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and `full`, which represents a battery that is fully charged, providing the maximum duration of usage. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesBattery.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesModel_model")] - public class DevicePropertiesModel - { - [JsonConstructorAttribute] - protected DevicePropertiesModel() { } - - public DevicePropertiesModel( - bool? accessoryKeypadSupported = default, - bool? canConnectAccessoryKeypad = default, - string displayName = default, - bool? hasBuiltInKeypad = default, - string manufacturerDisplayName = default, - bool? offlineAccessCodesSupported = default, - bool? onlineAccessCodesSupported = default - ) - { - AccessoryKeypadSupported = accessoryKeypadSupported; - CanConnectAccessoryKeypad = canConnectAccessoryKeypad; - DisplayName = displayName; - HasBuiltInKeypad = hasBuiltInKeypad; - ManufacturerDisplayName = manufacturerDisplayName; - OfflineAccessCodesSupported = offlineAccessCodesSupported; - OnlineAccessCodesSupported = onlineAccessCodesSupported; - } - - [Obsolete("use device.properties.model.can_connect_accessory_keypad")] - [DataMember( - Name = "accessory_keypad_supported", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AccessoryKeypadSupported { get; set; } - - /// - /// Indicates whether the device can connect a accessory keypad. - /// - [DataMember( - Name = "can_connect_accessory_keypad", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanConnectAccessoryKeypad { get; set; } - - /// - /// Display name of the device model. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Indicates whether the device has a built in accessory keypad. - /// - [DataMember(Name = "has_built_in_keypad", IsRequired = false, EmitDefaultValue = false)] - public bool? HasBuiltInKeypad { get; set; } - - /// - /// Display name that corresponds to the manufacturer-specific terminology for the device. - /// - [DataMember( - Name = "manufacturer_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string ManufacturerDisplayName { get; set; } - - [Obsolete("use device.can_program_offline_access_codes.")] - [DataMember( - Name = "offline_access_codes_supported", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? OfflineAccessCodesSupported { get; set; } - - [Obsolete("use device.can_program_online_access_codes.")] - [DataMember( - Name = "online_access_codes_supported", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? OnlineAccessCodesSupported { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAssaAbloyCredentialServiceMetadata_model")] - public class DevicePropertiesAssaAbloyCredentialServiceMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesAssaAbloyCredentialServiceMetadata() { } - - public DevicePropertiesAssaAbloyCredentialServiceMetadata( - List? endpoints = default, - bool? hasActiveEndpoint = default - ) - { - Endpoints = endpoints; - HasActiveEndpoint = hasActiveEndpoint; - } - - /// - /// Endpoints associated with the phone. - /// - [DataMember(Name = "endpoints", IsRequired = false, EmitDefaultValue = false)] - public List? Endpoints { get; set; } - - /// - /// Indicates whether the credential service has active endpoints associated with the phone. - /// - [DataMember(Name = "has_active_endpoint", IsRequired = false, EmitDefaultValue = false)] - public bool? HasActiveEndpoint { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_devicePropertiesAssaAbloyCredentialServiceMetadataEndpoints_model" - )] - public class DevicePropertiesAssaAbloyCredentialServiceMetadataEndpoints - { - [JsonConstructorAttribute] - protected DevicePropertiesAssaAbloyCredentialServiceMetadataEndpoints() { } - - public DevicePropertiesAssaAbloyCredentialServiceMetadataEndpoints( - string? endpointId = default, - bool? isActive = default - ) - { - EndpointId = endpointId; - IsActive = isActive; - } - - /// - /// ID of the associated endpoint. - /// - [DataMember(Name = "endpoint_id", IsRequired = false, EmitDefaultValue = false)] - public string? EndpointId { get; set; } - - /// - /// Indicated whether the endpoint is active. - /// - [DataMember(Name = "is_active", IsRequired = false, EmitDefaultValue = false)] - public bool? IsActive { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesSaltoSpaceCredentialServiceMetadata_model")] - public class DevicePropertiesSaltoSpaceCredentialServiceMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesSaltoSpaceCredentialServiceMetadata() { } - - public DevicePropertiesSaltoSpaceCredentialServiceMetadata(bool? hasActivePhone = default) - { - HasActivePhone = hasActivePhone; - } - - /// - /// Indicates whether the credential service has an active associated phone. - /// - [DataMember(Name = "has_active_phone", IsRequired = false, EmitDefaultValue = false)] - public bool? HasActivePhone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAkilesMetadata_model")] - public class DevicePropertiesAkilesMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesAkilesMetadata() { } - - public DevicePropertiesAkilesMetadata( - string? memberGroupId = default, - string? gadgetId = default, - string? gadgetName = default, - string? productName = default - ) - { - MemberGroupId = memberGroupId; - GadgetId = gadgetId; - GadgetName = gadgetName; - ProductName = productName; - } - - /// - /// Group ID to which to add users for an Akiles device. - /// - [DataMember(Name = "member_group_id", IsRequired = false, EmitDefaultValue = false)] - public string? MemberGroupId { get; set; } - - /// - /// Gadget ID for an Akiles device. - /// - [DataMember(Name = "gadget_id", IsRequired = false, EmitDefaultValue = false)] - public string? GadgetId { get; set; } - - /// - /// Gadget name for an Akiles device. - /// - [DataMember(Name = "gadget_name", IsRequired = false, EmitDefaultValue = false)] - public string? GadgetName { get; set; } - - /// - /// Product name for an Akiles device. - /// - [DataMember(Name = "product_name", IsRequired = false, EmitDefaultValue = false)] - public string? ProductName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAqaraMetadata_model")] - public class DevicePropertiesAqaraMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesAqaraMetadata() { } - - public DevicePropertiesAqaraMetadata( - string? deviceName = default, - string? did = default, - string? firmwareVersion = default, - string? model = default, - float? modelType = default, - string? parentDid = default, - string? positionId = default, - string? timeZone = default - ) - { - DeviceName = deviceName; - Did = did; - FirmwareVersion = firmwareVersion; - Model = model; - ModelType = modelType; - ParentDid = parentDid; - PositionId = positionId; - TimeZone = timeZone; - } - - /// - /// Device name for an Aqara device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Device ID (did) for an Aqara device. - /// - [DataMember(Name = "did", IsRequired = false, EmitDefaultValue = false)] - public string? Did { get; set; } - - /// - /// Firmware version for an Aqara device. - /// - [DataMember(Name = "firmware_version", IsRequired = false, EmitDefaultValue = false)] - public string? FirmwareVersion { get; set; } - - /// - /// Model identifier for an Aqara device. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public string? Model { get; set; } - - /// - /// Model type for an Aqara device. - /// - [DataMember(Name = "model_type", IsRequired = false, EmitDefaultValue = false)] - public float? ModelType { get; set; } - - /// - /// Parent gateway device ID for an Aqara device. - /// - [DataMember(Name = "parent_did", IsRequired = false, EmitDefaultValue = false)] - public string? ParentDid { get; set; } - - /// - /// Position (room) ID for an Aqara device. - /// - [DataMember(Name = "position_id", IsRequired = false, EmitDefaultValue = false)] - public string? PositionId { get; set; } - - /// - /// Time zone reported for an Aqara device (e.g. GMT-07:00). - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAssaAbloyVostioMetadata_model")] - public class DevicePropertiesAssaAbloyVostioMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesAssaAbloyVostioMetadata() { } - - public DevicePropertiesAssaAbloyVostioMetadata(string? encoderName = default) - { - EncoderName = encoderName; - } - - /// - /// Encoder name for an ASSA ABLOY Vostio system. - /// - [DataMember(Name = "encoder_name", IsRequired = false, EmitDefaultValue = false)] - public string? EncoderName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAugustMetadata_model")] - public class DevicePropertiesAugustMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesAugustMetadata() { } - - public DevicePropertiesAugustMetadata( - bool? hasKeypad = default, - string? houseId = default, - string? houseName = default, - string? keypadBatteryLevel = default, - string? lockId = default, - string? lockName = default, - string? model = default - ) - { - HasKeypad = hasKeypad; - HouseId = houseId; - HouseName = houseName; - KeypadBatteryLevel = keypadBatteryLevel; - LockId = lockId; - LockName = lockName; - Model = model; - } - - /// - /// Indicates whether an August device has a keypad. - /// - [DataMember(Name = "has_keypad", IsRequired = false, EmitDefaultValue = false)] - public bool? HasKeypad { get; set; } - - /// - /// House ID for an August device. - /// - [DataMember(Name = "house_id", IsRequired = false, EmitDefaultValue = false)] - public string? HouseId { get; set; } - - /// - /// House name for an August device. - /// - [DataMember(Name = "house_name", IsRequired = false, EmitDefaultValue = false)] - public string? HouseName { get; set; } - - /// - /// Keypad battery level for an August device. - /// - [DataMember(Name = "keypad_battery_level", IsRequired = false, EmitDefaultValue = false)] - public string? KeypadBatteryLevel { get; set; } - - /// - /// Lock ID for an August device. - /// - [DataMember(Name = "lock_id", IsRequired = false, EmitDefaultValue = false)] - public string? LockId { get; set; } - - /// - /// Lock name for an August device. - /// - [DataMember(Name = "lock_name", IsRequired = false, EmitDefaultValue = false)] - public string? LockName { get; set; } - - /// - /// Model for an August device. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public string? Model { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAvigilonAltaMetadata_model")] - public class DevicePropertiesAvigilonAltaMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesAvigilonAltaMetadata() { } - - public DevicePropertiesAvigilonAltaMetadata( - string? entryName = default, - float? entryRelaysTotalCount = default, - string? orgName = default, - float? siteId = default, - string? siteName = default, - float? zoneId = default, - string? zoneName = default - ) - { - EntryName = entryName; - EntryRelaysTotalCount = entryRelaysTotalCount; - OrgName = orgName; - SiteId = siteId; - SiteName = siteName; - ZoneId = zoneId; - ZoneName = zoneName; - } - - /// - /// Entry name for an Avigilon Alta system. - /// - [DataMember(Name = "entry_name", IsRequired = false, EmitDefaultValue = false)] - public string? EntryName { get; set; } - - /// - /// Total count of entry relays for an Avigilon Alta system. - /// - [DataMember( - Name = "entry_relays_total_count", - IsRequired = false, - EmitDefaultValue = false - )] - public float? EntryRelaysTotalCount { get; set; } - - /// - /// Organization name for an Avigilon Alta system. - /// - [DataMember(Name = "org_name", IsRequired = false, EmitDefaultValue = false)] - public string? OrgName { get; set; } - - /// - /// Site ID for an Avigilon Alta system. - /// - [DataMember(Name = "site_id", IsRequired = false, EmitDefaultValue = false)] - public float? SiteId { get; set; } - - /// - /// Site name for an Avigilon Alta system. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - /// - /// Zone ID for an Avigilon Alta system. - /// - [DataMember(Name = "zone_id", IsRequired = false, EmitDefaultValue = false)] - public float? ZoneId { get; set; } - - /// - /// Zone name for an Avigilon Alta system. - /// - [DataMember(Name = "zone_name", IsRequired = false, EmitDefaultValue = false)] - public string? ZoneName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesBrivoMetadata_model")] - public class DevicePropertiesBrivoMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesBrivoMetadata() { } - - public DevicePropertiesBrivoMetadata( - bool? activationEnabled = default, - string? deviceName = default - ) - { - ActivationEnabled = activationEnabled; - DeviceName = deviceName; - } - - /// - /// Indicates whether the Brivo access point has activation (remote unlock) enabled. - /// - [DataMember(Name = "activation_enabled", IsRequired = false, EmitDefaultValue = false)] - public bool? ActivationEnabled { get; set; } - - /// - /// Device name for a Brivo device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesControlbywebMetadata_model")] - public class DevicePropertiesControlbywebMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesControlbywebMetadata() { } - - public DevicePropertiesControlbywebMetadata( - string? deviceId = default, - string? deviceName = default, - string? relayName = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - RelayName = relayName; - } - - /// - /// Device ID for a ControlByWeb device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a ControlByWeb device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Relay name for a ControlByWeb device. - /// - [DataMember(Name = "relay_name", IsRequired = false, EmitDefaultValue = false)] - public string? RelayName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesDormakabaOracodeMetadata_model")] - public class DevicePropertiesDormakabaOracodeMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesDormakabaOracodeMetadata() { } - - public DevicePropertiesDormakabaOracodeMetadata( - string? deviceId = default, - float? doorId = default, - bool? doorIsWireless = default, - string? doorName = default, - string? ianaTimezone = default, - List? predefinedTimeSlots = - default, - float? siteId = default, - string? siteName = default - ) - { - DeviceId = deviceId; - DoorId = doorId; - DoorIsWireless = doorIsWireless; - DoorName = doorName; - IanaTimezone = ianaTimezone; - PredefinedTimeSlots = predefinedTimeSlots; - SiteId = siteId; - SiteName = siteName; - } - - /// - /// Device ID for a dormakaba Oracode device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Door ID for a dormakaba Oracode device. - /// - [DataMember(Name = "door_id", IsRequired = false, EmitDefaultValue = false)] - public float? DoorId { get; set; } - - /// - /// Indicates whether a door is wireless for a dormakaba Oracode device. - /// - [DataMember(Name = "door_is_wireless", IsRequired = false, EmitDefaultValue = false)] - public bool? DoorIsWireless { get; set; } - - /// - /// Door name for a dormakaba Oracode device. - /// - [DataMember(Name = "door_name", IsRequired = false, EmitDefaultValue = false)] - public string? DoorName { get; set; } - - /// - /// IANA time zone for a dormakaba Oracode device. - /// - [DataMember(Name = "iana_timezone", IsRequired = false, EmitDefaultValue = false)] - public string? IanaTimezone { get; set; } - - /// - /// Predefined time slots for a dormakaba Oracode device. - /// - [DataMember(Name = "predefined_time_slots", IsRequired = false, EmitDefaultValue = false)] - public List? PredefinedTimeSlots { get; set; } - - /// - /// Site ID for a dormakaba Oracode device. - /// - [Obsolete("Previously marked as \"@DEPRECATED.\"")] - [DataMember(Name = "site_id", IsRequired = false, EmitDefaultValue = false)] - public float? SiteId { get; set; } - - /// - /// Site name for a dormakaba Oracode device. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_devicePropertiesDormakabaOracodeMetadataPredefinedTimeSlots_model" - )] - public class DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlots - { - [JsonConstructorAttribute] - protected DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlots() { } - - public DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlots( - string? checkInTime = default, - string? checkOutTime = default, - string? dormakabaOracodeUserLevelId = default, - float? dormakabaOracodeUserLevelPrefix = default, - bool? is_24Hour = default, - bool? isBiweeklyMode = default, - bool? isMaster = default, - bool? isOneShot = default, - string? name = default, - float? prefix = default - ) - { - CheckInTime = checkInTime; - CheckOutTime = checkOutTime; - DormakabaOracodeUserLevelId = dormakabaOracodeUserLevelId; - DormakabaOracodeUserLevelPrefix = dormakabaOracodeUserLevelPrefix; - Is_24Hour = is_24Hour; - IsBiweeklyMode = isBiweeklyMode; - IsMaster = isMaster; - IsOneShot = isOneShot; - Name = name; - Prefix = prefix; - } - - /// - /// Check in time for a time slot for a dormakaba Oracode device. - /// - [DataMember(Name = "check_in_time", IsRequired = false, EmitDefaultValue = false)] - public string? CheckInTime { get; set; } - - /// - /// Checkout time for a time slot for a dormakaba Oracode device. - /// - [DataMember(Name = "check_out_time", IsRequired = false, EmitDefaultValue = false)] - public string? CheckOutTime { get; set; } - - /// - /// ID of a user level for a dormakaba Oracode device. - /// - [DataMember( - Name = "dormakaba_oracode_user_level_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? DormakabaOracodeUserLevelId { get; set; } - - /// - /// Prefix for a user level for a dormakaba Oracode device. - /// - [DataMember( - Name = "dormakaba_oracode_user_level_prefix", - IsRequired = false, - EmitDefaultValue = false - )] - public float? DormakabaOracodeUserLevelPrefix { get; set; } - - /// - /// Indicates whether a time slot for a dormakaba Oracode device is a 24-hour time slot. - /// - [DataMember(Name = "is_24_hour", IsRequired = false, EmitDefaultValue = false)] - public bool? Is_24Hour { get; set; } - - /// - /// Indicates whether a time slot for a dormakaba Oracode device is in biweekly mode. - /// - [DataMember(Name = "is_biweekly_mode", IsRequired = false, EmitDefaultValue = false)] - public bool? IsBiweeklyMode { get; set; } - - /// - /// Indicates whether a time slot for a dormakaba Oracode device is a master time slot. - /// - [DataMember(Name = "is_master", IsRequired = false, EmitDefaultValue = false)] - public bool? IsMaster { get; set; } - - /// - /// Indicates whether a time slot for a dormakaba Oracode device is a one-shot time slot. - /// - [DataMember(Name = "is_one_shot", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOneShot { get; set; } - - /// - /// Name of a time slot for a dormakaba Oracode device. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Prefix for a time slot for a dormakaba Oracode device. - /// - [DataMember(Name = "prefix", IsRequired = false, EmitDefaultValue = false)] - public float? Prefix { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesEcobeeMetadata_model")] - public class DevicePropertiesEcobeeMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesEcobeeMetadata() { } - - public DevicePropertiesEcobeeMetadata( - string? deviceName = default, - string? ecobeeDeviceId = default - ) - { - DeviceName = deviceName; - EcobeeDeviceId = ecobeeDeviceId; - } - - /// - /// Device name for an ecobee device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Device ID for an ecobee device. - /// - [DataMember(Name = "ecobee_device_id", IsRequired = false, EmitDefaultValue = false)] - public string? EcobeeDeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesFourSuitesMetadata_model")] - public class DevicePropertiesFourSuitesMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesFourSuitesMetadata() { } - - public DevicePropertiesFourSuitesMetadata( - float? deviceId = default, - string? deviceName = default, - float? recloseDelayInSeconds = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - RecloseDelayInSeconds = recloseDelayInSeconds; - } - - /// - /// Device ID for a 4SUITES device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public float? DeviceId { get; set; } - - /// - /// Device name for a 4SUITES device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Reclose delay, in seconds, for a 4SUITES device. - /// - [DataMember( - Name = "reclose_delay_in_seconds", - IsRequired = false, - EmitDefaultValue = false - )] - public float? RecloseDelayInSeconds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesGenieMetadata_model")] - public class DevicePropertiesGenieMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesGenieMetadata() { } - - public DevicePropertiesGenieMetadata( - string? deviceName = default, - string? doorName = default - ) - { - DeviceName = deviceName; - DoorName = doorName; - } - - /// - /// Lock name for a Genie device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Door name for a Genie device. - /// - [DataMember(Name = "door_name", IsRequired = false, EmitDefaultValue = false)] - public string? DoorName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesHoneywellResideoMetadata_model")] - public class DevicePropertiesHoneywellResideoMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesHoneywellResideoMetadata() { } - - public DevicePropertiesHoneywellResideoMetadata( - string? deviceName = default, - string? honeywellResideoDeviceId = default - ) - { - DeviceName = deviceName; - HoneywellResideoDeviceId = honeywellResideoDeviceId; - } - - /// - /// Device name for a Honeywell Resideo device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Device ID for a Honeywell Resideo device. - /// - [DataMember( - Name = "honeywell_resideo_device_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? HoneywellResideoDeviceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesIglooMetadata_model")] - public class DevicePropertiesIglooMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesIglooMetadata() { } - - public DevicePropertiesIglooMetadata( - string? bridgeId = default, - string? deviceId = default, - string? model = default - ) - { - BridgeId = bridgeId; - DeviceId = deviceId; - Model = model; - } - - /// - /// Bridge ID for an igloo device. - /// - [DataMember(Name = "bridge_id", IsRequired = false, EmitDefaultValue = false)] - public string? BridgeId { get; set; } - - /// - /// Device ID for an igloo device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Model for an igloo device. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public string? Model { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesIgloohomeMetadata_model")] - public class DevicePropertiesIgloohomeMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesIgloohomeMetadata() { } - - public DevicePropertiesIgloohomeMetadata( - string? bridgeId = default, - string? bridgeName = default, - string? deviceId = default, - string? deviceName = default, - bool? isAccessoryKeypadLinkedToBridge = default, - string? keypadId = default - ) - { - BridgeId = bridgeId; - BridgeName = bridgeName; - DeviceId = deviceId; - DeviceName = deviceName; - IsAccessoryKeypadLinkedToBridge = isAccessoryKeypadLinkedToBridge; - KeypadId = keypadId; - } - - /// - /// Bridge ID for an igloohome device. - /// - [DataMember(Name = "bridge_id", IsRequired = false, EmitDefaultValue = false)] - public string? BridgeId { get; set; } - - /// - /// Bridge name for an igloohome device. - /// - [DataMember(Name = "bridge_name", IsRequired = false, EmitDefaultValue = false)] - public string? BridgeName { get; set; } - - /// - /// Device ID for an igloohome device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for an igloohome device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Indicates whether a keypad is linked to a bridge for an igloohome device. - /// - [DataMember( - Name = "is_accessory_keypad_linked_to_bridge", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsAccessoryKeypadLinkedToBridge { get; set; } - - /// - /// Keypad ID for an igloohome device. - /// - [DataMember(Name = "keypad_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeypadId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesKeynestMetadata_model")] - public class DevicePropertiesKeynestMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesKeynestMetadata() { } - - public DevicePropertiesKeynestMetadata( - string? address = default, - float? currentOrLastStoreId = default, - string? currentStatus = default, - string? currentUserCompany = default, - string? currentUserEmail = default, - string? currentUserName = default, - string? currentUserPhoneNumber = default, - float? defaultOfficeId = default, - string? deviceName = default, - float? fobId = default, - string? handoverMethod = default, - bool? hasPhoto = default, - bool? isQuadientLocker = default, - string? keyId = default, - string? keyNotes = default, - string? keynestAppUser = default, - string? lastMovement = default, - string? propertyId = default, - string? propertyPostcode = default, - string? statusType = default, - string? subscriptionPlan = default - ) - { - Address = address; - CurrentOrLastStoreId = currentOrLastStoreId; - CurrentStatus = currentStatus; - CurrentUserCompany = currentUserCompany; - CurrentUserEmail = currentUserEmail; - CurrentUserName = currentUserName; - CurrentUserPhoneNumber = currentUserPhoneNumber; - DefaultOfficeId = defaultOfficeId; - DeviceName = deviceName; - FobId = fobId; - HandoverMethod = handoverMethod; - HasPhoto = hasPhoto; - IsQuadientLocker = isQuadientLocker; - KeyId = keyId; - KeyNotes = keyNotes; - KeynestAppUser = keynestAppUser; - LastMovement = lastMovement; - PropertyId = propertyId; - PropertyPostcode = propertyPostcode; - StatusType = statusType; - SubscriptionPlan = subscriptionPlan; - } - - /// - /// Address for a KeyNest device. - /// - [DataMember(Name = "address", IsRequired = false, EmitDefaultValue = false)] - public string? Address { get; set; } - - /// - /// Current or last store ID for a KeyNest device. - /// - [DataMember( - Name = "current_or_last_store_id", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CurrentOrLastStoreId { get; set; } - - /// - /// Current status for a KeyNest device. - /// - [DataMember(Name = "current_status", IsRequired = false, EmitDefaultValue = false)] - public string? CurrentStatus { get; set; } - - /// - /// Current user company for a KeyNest device. - /// - [DataMember(Name = "current_user_company", IsRequired = false, EmitDefaultValue = false)] - public string? CurrentUserCompany { get; set; } - - /// - /// Current user email for a KeyNest device. - /// - [DataMember(Name = "current_user_email", IsRequired = false, EmitDefaultValue = false)] - public string? CurrentUserEmail { get; set; } - - /// - /// Current user name for a KeyNest device. - /// - [DataMember(Name = "current_user_name", IsRequired = false, EmitDefaultValue = false)] - public string? CurrentUserName { get; set; } - - /// - /// Current user phone number for a KeyNest device. - /// - [DataMember( - Name = "current_user_phone_number", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CurrentUserPhoneNumber { get; set; } - - /// - /// Default office ID for a KeyNest device. - /// - [DataMember(Name = "default_office_id", IsRequired = false, EmitDefaultValue = false)] - public float? DefaultOfficeId { get; set; } - - /// - /// Device name for a KeyNest device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Fob ID for a KeyNest device. - /// - [DataMember(Name = "fob_id", IsRequired = false, EmitDefaultValue = false)] - public float? FobId { get; set; } - - /// - /// Handover method for a KeyNest device. - /// - [DataMember(Name = "handover_method", IsRequired = false, EmitDefaultValue = false)] - public string? HandoverMethod { get; set; } - - /// - /// Whether the KeyNest device has a photo. - /// - [DataMember(Name = "has_photo", IsRequired = false, EmitDefaultValue = false)] - public bool? HasPhoto { get; set; } - - /// - /// Whether the key is in a locker that does not support the access codes API. - /// - [DataMember(Name = "is_quadient_locker", IsRequired = false, EmitDefaultValue = false)] - public bool? IsQuadientLocker { get; set; } - - /// - /// Key ID for a KeyNest device. - /// - [DataMember(Name = "key_id", IsRequired = false, EmitDefaultValue = false)] - public string? KeyId { get; set; } - - /// - /// Key notes for a KeyNest device. - /// - [DataMember(Name = "key_notes", IsRequired = false, EmitDefaultValue = false)] - public string? KeyNotes { get; set; } - - /// - /// KeyNest app user for a KeyNest device. - /// - [DataMember(Name = "keynest_app_user", IsRequired = false, EmitDefaultValue = false)] - public string? KeynestAppUser { get; set; } - - /// - /// Last movement timestamp for a KeyNest device. - /// - [DataMember(Name = "last_movement", IsRequired = false, EmitDefaultValue = false)] - public string? LastMovement { get; set; } - - /// - /// Property ID for a KeyNest device. - /// - [DataMember(Name = "property_id", IsRequired = false, EmitDefaultValue = false)] - public string? PropertyId { get; set; } - - /// - /// Property postcode for a KeyNest device. - /// - [DataMember(Name = "property_postcode", IsRequired = false, EmitDefaultValue = false)] - public string? PropertyPostcode { get; set; } - - /// - /// Status type for a KeyNest device. - /// - [DataMember(Name = "status_type", IsRequired = false, EmitDefaultValue = false)] - public string? StatusType { get; set; } - - /// - /// Subscription plan for a KeyNest device. - /// - [DataMember(Name = "subscription_plan", IsRequired = false, EmitDefaultValue = false)] - public string? SubscriptionPlan { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesKisiMetadata_model")] - public class DevicePropertiesKisiMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesKisiMetadata() { } - - public DevicePropertiesKisiMetadata( - string? description = default, - float? lockId = default, - string? lockName = default, - string? placeName = default - ) - { - Description = description; - LockId = lockId; - LockName = lockName; - PlaceName = placeName; - } - - /// - /// Description for a Kisi device. - /// - [DataMember(Name = "description", IsRequired = false, EmitDefaultValue = false)] - public string? Description { get; set; } - - /// - /// Lock ID for a Kisi device. - /// - [DataMember(Name = "lock_id", IsRequired = false, EmitDefaultValue = false)] - public float? LockId { get; set; } - - /// - /// Lock name for a Kisi device. - /// - [DataMember(Name = "lock_name", IsRequired = false, EmitDefaultValue = false)] - public string? LockName { get; set; } - - /// - /// Place name for a Kisi device. - /// - [DataMember(Name = "place_name", IsRequired = false, EmitDefaultValue = false)] - public string? PlaceName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesKorelockMetadata_model")] - public class DevicePropertiesKorelockMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesKorelockMetadata() { } - - public DevicePropertiesKorelockMetadata( - string? deviceId = default, - string? deviceName = default, - string? firmwareVersion = default, - string? locationId = default, - string? modelCode = default, - string? serialNumber = default, - float? wifiSignalStrength = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - FirmwareVersion = firmwareVersion; - LocationId = locationId; - ModelCode = modelCode; - SerialNumber = serialNumber; - WifiSignalStrength = wifiSignalStrength; - } - - /// - /// Device ID for a Korelock device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a Korelock device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Firmware version for a Korelock device. - /// - [DataMember(Name = "firmware_version", IsRequired = false, EmitDefaultValue = false)] - public string? FirmwareVersion { get; set; } - - /// - /// Location ID for a Korelock device. Required for timebound access codes. - /// - [DataMember(Name = "location_id", IsRequired = false, EmitDefaultValue = false)] - public string? LocationId { get; set; } - - /// - /// Model code for a Korelock device. - /// - [DataMember(Name = "model_code", IsRequired = false, EmitDefaultValue = false)] - public string? ModelCode { get; set; } - - /// - /// Serial number for a Korelock device. - /// - [DataMember(Name = "serial_number", IsRequired = false, EmitDefaultValue = false)] - public string? SerialNumber { get; set; } - - /// - /// WiFi signal strength (0-1) for a Korelock device. - /// - [DataMember(Name = "wifi_signal_strength", IsRequired = false, EmitDefaultValue = false)] - public float? WifiSignalStrength { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesKwiksetMetadata_model")] - public class DevicePropertiesKwiksetMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesKwiksetMetadata() { } - - public DevicePropertiesKwiksetMetadata( - string? deviceId = default, - string? deviceName = default, - string? modelNumber = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - ModelNumber = modelNumber; - } - - /// - /// Device ID for a Kwikset device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a Kwikset device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Model number for a Kwikset device. - /// - [DataMember(Name = "model_number", IsRequired = false, EmitDefaultValue = false)] - public string? ModelNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesLocklyMetadata_model")] - public class DevicePropertiesLocklyMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesLocklyMetadata() { } - - public DevicePropertiesLocklyMetadata( - string? deviceId = default, - string? deviceName = default, - string? model = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - Model = model; - } - - /// - /// Device ID for a Lockly device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a Lockly device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Model for a Lockly device. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public string? Model { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesMinutMetadata_model")] - public class DevicePropertiesMinutMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesMinutMetadata() { } - - public DevicePropertiesMinutMetadata( - string? deviceId = default, - string? deviceName = default, - DevicePropertiesMinutMetadataLatestSensorValues? latestSensorValues = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - LatestSensorValues = latestSensorValues; - } - - /// - /// Device ID for a Minut device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a Minut device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Latest sensor values for a Minut device. - /// - [DataMember(Name = "latest_sensor_values", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesMinutMetadataLatestSensorValues? LatestSensorValues { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesMinutMetadataLatestSensorValues_model")] - public class DevicePropertiesMinutMetadataLatestSensorValues - { - [JsonConstructorAttribute] - protected DevicePropertiesMinutMetadataLatestSensorValues() { } - - public DevicePropertiesMinutMetadataLatestSensorValues( - DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ? accelerometerZ = default, - DevicePropertiesMinutMetadataLatestSensorValuesHumidity? humidity = default, - DevicePropertiesMinutMetadataLatestSensorValuesPressure? pressure = default, - DevicePropertiesMinutMetadataLatestSensorValuesSound? sound = default, - DevicePropertiesMinutMetadataLatestSensorValuesTemperature? temperature = default - ) - { - AccelerometerZ = accelerometerZ; - Humidity = humidity; - Pressure = pressure; - Sound = sound; - Temperature = temperature; - } - - /// - /// Latest accelerometer Z-axis reading for a Minut device. - /// - [DataMember(Name = "accelerometer_z", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ? AccelerometerZ { get; set; } - - /// - /// Latest humidity reading for a Minut device. - /// - [DataMember(Name = "humidity", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesMinutMetadataLatestSensorValuesHumidity? Humidity { get; set; } - - /// - /// Latest pressure reading for a Minut device. - /// - [DataMember(Name = "pressure", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesMinutMetadataLatestSensorValuesPressure? Pressure { get; set; } - - /// - /// Latest sound reading for a Minut device. - /// - [DataMember(Name = "sound", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesMinutMetadataLatestSensorValuesSound? Sound { get; set; } - - /// - /// Latest temperature reading for a Minut device. - /// - [DataMember(Name = "temperature", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesMinutMetadataLatestSensorValuesTemperature? Temperature { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_devicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ_model" - )] - public class DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ - { - [JsonConstructorAttribute] - protected DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ() { } - - public DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ( - string? time = default, - float? value = default - ) - { - Time = time; - Value = value; - } - - /// - /// Time of latest accelerometer Z-axis reading for a Minut device. - /// - [DataMember(Name = "time", IsRequired = false, EmitDefaultValue = false)] - public string? Time { get; set; } - - /// - /// Value of latest accelerometer Z-axis reading for a Minut device. - /// - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public float? Value { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesMinutMetadataLatestSensorValuesHumidity_model")] - public class DevicePropertiesMinutMetadataLatestSensorValuesHumidity - { - [JsonConstructorAttribute] - protected DevicePropertiesMinutMetadataLatestSensorValuesHumidity() { } - - public DevicePropertiesMinutMetadataLatestSensorValuesHumidity( - string? time = default, - float? value = default - ) - { - Time = time; - Value = value; - } - - /// - /// Time of latest humidity reading for a Minut device. - /// - [DataMember(Name = "time", IsRequired = false, EmitDefaultValue = false)] - public string? Time { get; set; } - - /// - /// Value of latest humidity reading for a Minut device. - /// - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public float? Value { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesMinutMetadataLatestSensorValuesPressure_model")] - public class DevicePropertiesMinutMetadataLatestSensorValuesPressure - { - [JsonConstructorAttribute] - protected DevicePropertiesMinutMetadataLatestSensorValuesPressure() { } - - public DevicePropertiesMinutMetadataLatestSensorValuesPressure( - string? time = default, - float? value = default - ) - { - Time = time; - Value = value; - } - - /// - /// Time of latest pressure reading for a Minut device. - /// - [DataMember(Name = "time", IsRequired = false, EmitDefaultValue = false)] - public string? Time { get; set; } - - /// - /// Value of latest pressure reading for a Minut device. - /// - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public float? Value { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesMinutMetadataLatestSensorValuesSound_model")] - public class DevicePropertiesMinutMetadataLatestSensorValuesSound - { - [JsonConstructorAttribute] - protected DevicePropertiesMinutMetadataLatestSensorValuesSound() { } - - public DevicePropertiesMinutMetadataLatestSensorValuesSound( - string? time = default, - float? value = default - ) - { - Time = time; - Value = value; - } - - /// - /// Time of latest sound reading for a Minut device. - /// - [DataMember(Name = "time", IsRequired = false, EmitDefaultValue = false)] - public string? Time { get; set; } - - /// - /// Value of latest sound reading for a Minut device. - /// - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public float? Value { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_devicePropertiesMinutMetadataLatestSensorValuesTemperature_model" - )] - public class DevicePropertiesMinutMetadataLatestSensorValuesTemperature - { - [JsonConstructorAttribute] - protected DevicePropertiesMinutMetadataLatestSensorValuesTemperature() { } - - public DevicePropertiesMinutMetadataLatestSensorValuesTemperature( - string? time = default, - float? value = default - ) - { - Time = time; - Value = value; - } - - /// - /// Time of latest temperature reading for a Minut device. - /// - [DataMember(Name = "time", IsRequired = false, EmitDefaultValue = false)] - public string? Time { get; set; } - - /// - /// Value of latest temperature reading for a Minut device. - /// - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public float? Value { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesNestMetadata_model")] - public class DevicePropertiesNestMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesNestMetadata() { } - - public DevicePropertiesNestMetadata( - string? deviceCustomName = default, - string? deviceName = default, - string? displayName = default, - string? nestDeviceId = default, - string? nestStructureId = default, - string? structureName = default - ) - { - DeviceCustomName = deviceCustomName; - DeviceName = deviceName; - DisplayName = displayName; - NestDeviceId = nestDeviceId; - NestStructureId = nestStructureId; - StructureName = structureName; - } - - /// - /// Custom device name for a Google Nest device. The device owner sets this value. - /// - [DataMember(Name = "device_custom_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceCustomName { get; set; } - - /// - /// Device name for a Google Nest device. Google sets this value. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Display name for a Google Nest device. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string? DisplayName { get; set; } - - /// - /// Device ID for a Google Nest device. - /// - [DataMember(Name = "nest_device_id", IsRequired = false, EmitDefaultValue = false)] - public string? NestDeviceId { get; set; } - - /// - /// ID of the Google Nest structure containing the device. - /// - [DataMember(Name = "nest_structure_id", IsRequired = false, EmitDefaultValue = false)] - public string? NestStructureId { get; set; } - - /// - /// Name of the Google Nest structure containing the device. The device owner sets this value. - /// - [DataMember(Name = "structure_name", IsRequired = false, EmitDefaultValue = false)] - public string? StructureName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesNoiseawareMetadata_model")] - public class DevicePropertiesNoiseawareMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesNoiseawareMetadata() { } - - public DevicePropertiesNoiseawareMetadata( - string? deviceId = default, - DevicePropertiesNoiseawareMetadata.DeviceModelEnum? deviceModel = default, - string? deviceName = default, - float? noiseLevelDecibel = default, - float? noiseLevelNrs = default - ) - { - DeviceId = deviceId; - DeviceModel = deviceModel; - DeviceName = deviceName; - NoiseLevelDecibel = noiseLevelDecibel; - NoiseLevelNrs = noiseLevelNrs; - } - - /// - /// Device model for a NoiseAware device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceModelEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "indoor")] - Indoor = 1, - - [EnumMember(Value = "outdoor")] - Outdoor = 2, - } - - /// - /// Device ID for a NoiseAware device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device model for a NoiseAware device. - /// - [DataMember(Name = "device_model", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesNoiseawareMetadata.DeviceModelEnum? DeviceModel { get; set; } - - /// - /// Device name for a NoiseAware device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Noise level, in decibels, for a NoiseAware device. - /// - [DataMember(Name = "noise_level_decibel", IsRequired = false, EmitDefaultValue = false)] - public float? NoiseLevelDecibel { get; set; } - - /// - /// Noise level, expressed as a Noise Risk Score (NRS), for a NoiseAware device. - /// - [DataMember(Name = "noise_level_nrs", IsRequired = false, EmitDefaultValue = false)] - public float? NoiseLevelNrs { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesNukiMetadata_model")] - public class DevicePropertiesNukiMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesNukiMetadata() { } - - public DevicePropertiesNukiMetadata( - string? deviceId = default, - string? deviceName = default, - bool? keypad_2Paired = default, - bool? keypadBatteryCritical = default, - bool? keypadPaired = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - Keypad_2Paired = keypad_2Paired; - KeypadBatteryCritical = keypadBatteryCritical; - KeypadPaired = keypadPaired; - } - - /// - /// Device ID for a Nuki device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a Nuki device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Indicates whether keypad 2 is paired for a Nuki device. - /// - [DataMember(Name = "keypad_2_paired", IsRequired = false, EmitDefaultValue = false)] - public bool? Keypad_2Paired { get; set; } - - /// - /// Indicates whether the keypad battery is in a critical state for a Nuki device. - /// - [DataMember(Name = "keypad_battery_critical", IsRequired = false, EmitDefaultValue = false)] - public bool? KeypadBatteryCritical { get; set; } - - /// - /// Indicates whether the keypad is paired for a Nuki device. - /// - [DataMember(Name = "keypad_paired", IsRequired = false, EmitDefaultValue = false)] - public bool? KeypadPaired { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesOmnitecMetadata_model")] - public class DevicePropertiesOmnitecMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesOmnitecMetadata() { } - - public DevicePropertiesOmnitecMetadata( - bool? hasGateway = default, - string? lockAlias = default, - float? lockId = default, - string? lockMac = default, - string? lockName = default, - string? timeZone = default, - float? timezoneRawOffsetMs = default - ) - { - HasGateway = hasGateway; - LockAlias = lockAlias; - LockId = lockId; - LockMac = lockMac; - LockName = lockName; - TimeZone = timeZone; - TimezoneRawOffsetMs = timezoneRawOffsetMs; - } - - /// - /// Whether the Omnitec lock has a connected gateway for remote operations. - /// - [DataMember(Name = "has_gateway", IsRequired = false, EmitDefaultValue = false)] - public bool? HasGateway { get; set; } - - /// - /// Operator-assigned alias for an Omnitec device. - /// - [DataMember(Name = "lock_alias", IsRequired = false, EmitDefaultValue = false)] - public string? LockAlias { get; set; } - - /// - /// Lock ID for an Omnitec device. - /// - [DataMember(Name = "lock_id", IsRequired = false, EmitDefaultValue = false)] - public float? LockId { get; set; } - - /// - /// Bluetooth MAC address for an Omnitec device. - /// - [DataMember(Name = "lock_mac", IsRequired = false, EmitDefaultValue = false)] - public string? LockMac { get; set; } - - /// - /// Lock name for an Omnitec device. - /// - [DataMember(Name = "lock_name", IsRequired = false, EmitDefaultValue = false)] - public string? LockName { get; set; } - - /// - /// IANA time zone for the Omnitec device, used to schedule time-bound access codes at the correct local time (accounting for DST). - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - /// - /// Static UTC offset of the Omnitec lock in milliseconds. Does not account for DST. - /// - [DataMember(Name = "timezone_raw_offset_ms", IsRequired = false, EmitDefaultValue = false)] - public float? TimezoneRawOffsetMs { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesRingMetadata_model")] - public class DevicePropertiesRingMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesRingMetadata() { } - - public DevicePropertiesRingMetadata( - string? deviceId = default, - string? deviceName = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - } - - /// - /// Device ID for a Ring device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a Ring device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesSaltoKsMetadata_model")] - public class DevicePropertiesSaltoKsMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesSaltoKsMetadata() { } - - public DevicePropertiesSaltoKsMetadata( - string? batteryLevel = default, - string? customerReference = default, - bool? hasCustomPinSubscription = default, - string? lockId = default, - string? lockType = default, - string? lockedState = default, - string? model = default, - string? siteId = default, - string? siteName = default - ) - { - BatteryLevel = batteryLevel; - CustomerReference = customerReference; - HasCustomPinSubscription = hasCustomPinSubscription; - LockId = lockId; - LockType = lockType; - LockedState = lockedState; - Model = model; - SiteId = siteId; - SiteName = siteName; - } - - /// - /// Battery level for a Salto KS device. - /// - [DataMember(Name = "battery_level", IsRequired = false, EmitDefaultValue = false)] - public string? BatteryLevel { get; set; } - - /// - /// Customer reference for a Salto KS device. - /// - [DataMember(Name = "customer_reference", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerReference { get; set; } - - /// - /// Indicates whether the site has a Salto KS subscription that supports custom PINs. - /// - [DataMember( - Name = "has_custom_pin_subscription", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? HasCustomPinSubscription { get; set; } - - /// - /// Lock ID for a Salto KS device. - /// - [DataMember(Name = "lock_id", IsRequired = false, EmitDefaultValue = false)] - public string? LockId { get; set; } - - /// - /// Lock type for a Salto KS device. - /// - [DataMember(Name = "lock_type", IsRequired = false, EmitDefaultValue = false)] - public string? LockType { get; set; } - - /// - /// Locked state for a Salto KS device. - /// - [DataMember(Name = "locked_state", IsRequired = false, EmitDefaultValue = false)] - public string? LockedState { get; set; } - - /// - /// Model for a Salto KS device. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public string? Model { get; set; } - - /// - /// Site ID for the Salto KS site to which the device belongs. - /// - [DataMember(Name = "site_id", IsRequired = false, EmitDefaultValue = false)] - public string? SiteId { get; set; } - - /// - /// Site name for the Salto KS site to which the device belongs. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesSaltoMetadata_model")] - public class DevicePropertiesSaltoMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesSaltoMetadata() { } - - public DevicePropertiesSaltoMetadata( - string? batteryLevel = default, - string? customerReference = default, - string? lockId = default, - string? lockType = default, - string? lockedState = default, - string? model = default, - string? siteId = default, - string? siteName = default - ) - { - BatteryLevel = batteryLevel; - CustomerReference = customerReference; - LockId = lockId; - LockType = lockType; - LockedState = lockedState; - Model = model; - SiteId = siteId; - SiteName = siteName; - } - - /// - /// Battery level for a Salto device. - /// - [DataMember(Name = "battery_level", IsRequired = false, EmitDefaultValue = false)] - public string? BatteryLevel { get; set; } - - /// - /// Customer reference for a Salto device. - /// - [DataMember(Name = "customer_reference", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerReference { get; set; } - - /// - /// Lock ID for a Salto device. - /// - [DataMember(Name = "lock_id", IsRequired = false, EmitDefaultValue = false)] - public string? LockId { get; set; } - - /// - /// Lock type for a Salto device. - /// - [DataMember(Name = "lock_type", IsRequired = false, EmitDefaultValue = false)] - public string? LockType { get; set; } - - /// - /// Locked state for a Salto device. - /// - [DataMember(Name = "locked_state", IsRequired = false, EmitDefaultValue = false)] - public string? LockedState { get; set; } - - /// - /// Model for a Salto device. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public string? Model { get; set; } - - /// - /// Site ID for the Salto KS site to which the device belongs. - /// - [DataMember(Name = "site_id", IsRequired = false, EmitDefaultValue = false)] - public string? SiteId { get; set; } - - /// - /// Site name for the Salto KS site to which the device belongs. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesSchlageMetadata_model")] - public class DevicePropertiesSchlageMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesSchlageMetadata() { } - - public DevicePropertiesSchlageMetadata( - string? deviceId = default, - string? deviceName = default, - string? model = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - Model = model; - } - - /// - /// Device ID for a Schlage device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a Schlage device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Model for a Schlage device. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public string? Model { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesSeamBridgeMetadata_model")] - public class DevicePropertiesSeamBridgeMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesSeamBridgeMetadata() { } - - public DevicePropertiesSeamBridgeMetadata( - float? deviceNum = default, - string? name = default, - DevicePropertiesSeamBridgeMetadata.UnlockMethodEnum? unlockMethod = default - ) - { - DeviceNum = deviceNum; - Name = name; - UnlockMethod = unlockMethod; - } - - /// - /// Unlock method for Seam Bridge. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum UnlockMethodEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "bridge")] - Bridge = 1, - - [EnumMember(Value = "doorking")] - Doorking = 2, - } - - /// - /// Device number for Seam Bridge. - /// - [DataMember(Name = "device_num", IsRequired = false, EmitDefaultValue = false)] - public float? DeviceNum { get; set; } - - /// - /// Name for Seam Bridge. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Unlock method for Seam Bridge. - /// - [DataMember(Name = "unlock_method", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesSeamBridgeMetadata.UnlockMethodEnum? UnlockMethod { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesSensiMetadata_model")] - public class DevicePropertiesSensiMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesSensiMetadata() { } - - public DevicePropertiesSensiMetadata( - string? deviceId = default, - string? deviceName = default, - bool? dualSetpointsNotSupported = default, - string? productType = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - DualSetpointsNotSupported = dualSetpointsNotSupported; - ProductType = productType; - } - - /// - /// Device ID for a Sensi device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a Sensi device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Set to true when the device does not support the /dual-setpoints API endpoint. - /// - [DataMember( - Name = "dual_setpoints_not_supported", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? DualSetpointsNotSupported { get; set; } - - /// - /// Product type for a Sensi device. - /// - [DataMember(Name = "product_type", IsRequired = false, EmitDefaultValue = false)] - public string? ProductType { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesSmartthingsMetadata_model")] - public class DevicePropertiesSmartthingsMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesSmartthingsMetadata() { } - - public DevicePropertiesSmartthingsMetadata( - string? deviceId = default, - string? deviceName = default, - string? locationId = default, - string? model = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - LocationId = locationId; - Model = model; - } - - /// - /// Device ID for a SmartThings device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a SmartThings device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Location ID for a SmartThings device. - /// - [DataMember(Name = "location_id", IsRequired = false, EmitDefaultValue = false)] - public string? LocationId { get; set; } - - /// - /// Model for a SmartThings device. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public string? Model { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesTadoMetadata_model")] - public class DevicePropertiesTadoMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesTadoMetadata() { } - - public DevicePropertiesTadoMetadata( - string? deviceType = default, - string? serialNo = default - ) - { - DeviceType = deviceType; - SerialNo = serialNo; - } - - /// - /// Device type for a tado° device. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceType { get; set; } - - /// - /// Serial number for a tado° device. - /// - [DataMember(Name = "serial_no", IsRequired = false, EmitDefaultValue = false)] - public string? SerialNo { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesTedeeMetadata_model")] - public class DevicePropertiesTedeeMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesTedeeMetadata() { } - - public DevicePropertiesTedeeMetadata( - float? bridgeId = default, - string? bridgeName = default, - float? deviceId = default, - string? deviceModel = default, - string? deviceName = default, - float? keypadId = default, - string? serialNumber = default - ) - { - BridgeId = bridgeId; - BridgeName = bridgeName; - DeviceId = deviceId; - DeviceModel = deviceModel; - DeviceName = deviceName; - KeypadId = keypadId; - SerialNumber = serialNumber; - } - - /// - /// Bridge ID for a Tedee device. - /// - [DataMember(Name = "bridge_id", IsRequired = false, EmitDefaultValue = false)] - public float? BridgeId { get; set; } - - /// - /// Bridge name for a Tedee device. - /// - [DataMember(Name = "bridge_name", IsRequired = false, EmitDefaultValue = false)] - public string? BridgeName { get; set; } - - /// - /// Device ID for a Tedee device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public float? DeviceId { get; set; } - - /// - /// Device model for a Tedee device. - /// - [DataMember(Name = "device_model", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceModel { get; set; } - - /// - /// Device name for a Tedee device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Keypad ID for a Tedee device. - /// - [DataMember(Name = "keypad_id", IsRequired = false, EmitDefaultValue = false)] - public float? KeypadId { get; set; } - - /// - /// Serial number for a Tedee device. - /// - [DataMember(Name = "serial_number", IsRequired = false, EmitDefaultValue = false)] - public string? SerialNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesTtlockMetadata_model")] - public class DevicePropertiesTtlockMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesTtlockMetadata() { } - - public DevicePropertiesTtlockMetadata( - string? featureValue = default, - DevicePropertiesTtlockMetadataFeatures? features = default, - bool? hasGateway = default, - string? lockAlias = default, - float? lockId = default, - float? timezoneRawOffsetMs = default, - List? wirelessKeypads = default - ) - { - FeatureValue = featureValue; - Features = features; - HasGateway = hasGateway; - LockAlias = lockAlias; - LockId = lockId; - TimezoneRawOffsetMs = timezoneRawOffsetMs; - WirelessKeypads = wirelessKeypads; - } - - /// - /// Feature value for a TTLock device. - /// - [DataMember(Name = "feature_value", IsRequired = false, EmitDefaultValue = false)] - public string? FeatureValue { get; set; } - - /// - /// Features for a TTLock device. - /// - [DataMember(Name = "features", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesTtlockMetadataFeatures? Features { get; set; } - - /// - /// Indicates whether a TTLock device has a gateway. - /// - [DataMember(Name = "has_gateway", IsRequired = false, EmitDefaultValue = false)] - public bool? HasGateway { get; set; } - - /// - /// Lock alias for a TTLock device. - /// - [DataMember(Name = "lock_alias", IsRequired = false, EmitDefaultValue = false)] - public string? LockAlias { get; set; } - - /// - /// Lock ID for a TTLock device. - /// - [DataMember(Name = "lock_id", IsRequired = false, EmitDefaultValue = false)] - public float? LockId { get; set; } - - /// - /// Lock-side timezone offset in milliseconds east of UTC, as configured in the TTLock app. Source of truth for the lock's wall-clock interpretation of access code start/end times — a misconfigured value here is the typical cause of customer "codes offset by N hours" reports. Diagnostic only; Seam does not convert times based on this value. - /// - [DataMember(Name = "timezone_raw_offset_ms", IsRequired = false, EmitDefaultValue = false)] - public float? TimezoneRawOffsetMs { get; set; } - - /// - /// Wireless keypads for a TTLock device. - /// - [DataMember(Name = "wireless_keypads", IsRequired = false, EmitDefaultValue = false)] - public List? WirelessKeypads { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesTtlockMetadataFeatures_model")] - public class DevicePropertiesTtlockMetadataFeatures - { - [JsonConstructorAttribute] - protected DevicePropertiesTtlockMetadataFeatures() { } - - public DevicePropertiesTtlockMetadataFeatures( - bool? autoLockTimeConfig = default, - bool? incompleteKeyboardPasscode = default, - bool? lockCommand = default, - bool? passcode = default, - bool? passcodeManagement = default, - bool? unlockViaGateway = default, - bool? wifi = default - ) - { - AutoLockTimeConfig = autoLockTimeConfig; - IncompleteKeyboardPasscode = incompleteKeyboardPasscode; - LockCommand = lockCommand; - Passcode = passcode; - PasscodeManagement = passcodeManagement; - UnlockViaGateway = unlockViaGateway; - Wifi = wifi; - } - - /// - /// Indicates whether a TTLock device supports auto-lock time configuration. - /// - [DataMember(Name = "auto_lock_time_config", IsRequired = false, EmitDefaultValue = false)] - public bool? AutoLockTimeConfig { get; set; } - - /// - /// Indicates whether a TTLock device supports an incomplete keyboard passcode. - /// - [DataMember( - Name = "incomplete_keyboard_passcode", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IncompleteKeyboardPasscode { get; set; } - - /// - /// Indicates whether a TTLock device supports the lock command. - /// - [DataMember(Name = "lock_command", IsRequired = false, EmitDefaultValue = false)] - public bool? LockCommand { get; set; } - - /// - /// Indicates whether a TTLock device supports a passcode. - /// - [DataMember(Name = "passcode", IsRequired = false, EmitDefaultValue = false)] - public bool? Passcode { get; set; } - - /// - /// Indicates whether a TTLock device supports passcode management. - /// - [DataMember(Name = "passcode_management", IsRequired = false, EmitDefaultValue = false)] - public bool? PasscodeManagement { get; set; } - - /// - /// Indicates whether a TTLock device supports unlock via gateway. - /// - [DataMember(Name = "unlock_via_gateway", IsRequired = false, EmitDefaultValue = false)] - public bool? UnlockViaGateway { get; set; } - - /// - /// Indicates whether a TTLock device supports Wi-Fi. - /// - [DataMember(Name = "wifi", IsRequired = false, EmitDefaultValue = false)] - public bool? Wifi { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesTtlockMetadataWirelessKeypads_model")] - public class DevicePropertiesTtlockMetadataWirelessKeypads - { - [JsonConstructorAttribute] - protected DevicePropertiesTtlockMetadataWirelessKeypads() { } - - public DevicePropertiesTtlockMetadataWirelessKeypads( - float? wirelessKeypadId = default, - string? wirelessKeypadName = default - ) - { - WirelessKeypadId = wirelessKeypadId; - WirelessKeypadName = wirelessKeypadName; - } - - /// - /// ID for a wireless keypad for a TTLock device. - /// - [DataMember(Name = "wireless_keypad_id", IsRequired = false, EmitDefaultValue = false)] - public float? WirelessKeypadId { get; set; } - - /// - /// Name for a wireless keypad for a TTLock device. - /// - [DataMember(Name = "wireless_keypad_name", IsRequired = false, EmitDefaultValue = false)] - public string? WirelessKeypadName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesTwoNMetadata_model")] - public class DevicePropertiesTwoNMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesTwoNMetadata() { } - - public DevicePropertiesTwoNMetadata(float? deviceId = default, string? deviceName = default) - { - DeviceId = deviceId; - DeviceName = deviceName; - } - - /// - /// Device ID for a 2N device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public float? DeviceId { get; set; } - - /// - /// Device name for a 2N device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesUltraloqMetadata_model")] - public class DevicePropertiesUltraloqMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesUltraloqMetadata() { } - - public DevicePropertiesUltraloqMetadata( - string? deviceId = default, - string? deviceName = default, - string? deviceType = default, - string? timeZone = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - DeviceType = deviceType; - TimeZone = timeZone; - } - - /// - /// Device ID for an Ultraloq device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for an Ultraloq device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Device type for an Ultraloq device. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceType { get; set; } - - /// - /// IANA timezone for the Ultraloq device. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesVisionlineMetadata_model")] - public class DevicePropertiesVisionlineMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesVisionlineMetadata() { } - - public DevicePropertiesVisionlineMetadata(string? encoderId = default) - { - EncoderId = encoderId; - } - - /// - /// Encoder ID for an ASSA ABLOY Visionline system. - /// - [DataMember(Name = "encoder_id", IsRequired = false, EmitDefaultValue = false)] - public string? EncoderId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesWyzeMetadata_model")] - public class DevicePropertiesWyzeMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesWyzeMetadata() { } - - public DevicePropertiesWyzeMetadata( - string? deviceId = default, - string? deviceInfoModel = default, - string? deviceName = default, - string? keypadUuid = default, - float? lockerStatusHardlock = default, - string? productModel = default, - string? productName = default, - string? productType = default - ) - { - DeviceId = deviceId; - DeviceInfoModel = deviceInfoModel; - DeviceName = deviceName; - KeypadUuid = keypadUuid; - LockerStatusHardlock = lockerStatusHardlock; - ProductModel = productModel; - ProductName = productName; - ProductType = productType; - } - - /// - /// Device ID for a Wyze device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device information model for a Wyze device. - /// - [DataMember(Name = "device_info_model", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceInfoModel { get; set; } - - /// - /// Device name for a Wyze device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Keypad UUID for a Wyze device. - /// - [DataMember(Name = "keypad_uuid", IsRequired = false, EmitDefaultValue = false)] - public string? KeypadUuid { get; set; } - - /// - /// Locker status (hardlock) for a Wyze device. - /// - [DataMember(Name = "locker_status_hardlock", IsRequired = false, EmitDefaultValue = false)] - public float? LockerStatusHardlock { get; set; } - - /// - /// Product model for a Wyze device. - /// - [DataMember(Name = "product_model", IsRequired = false, EmitDefaultValue = false)] - public string? ProductModel { get; set; } - - /// - /// Product name for a Wyze device. - /// - [DataMember(Name = "product_name", IsRequired = false, EmitDefaultValue = false)] - public string? ProductName { get; set; } - - /// - /// Product type for a Wyze device. - /// - [DataMember(Name = "product_type", IsRequired = false, EmitDefaultValue = false)] - public string? ProductType { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesYacanMetadata_model")] - public class DevicePropertiesYacanMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesYacanMetadata() { } - - public DevicePropertiesYacanMetadata( - string? deviceId = default, - string? deviceName = default, - string? deviceType = default, - string? serialNumber = default - ) - { - DeviceId = deviceId; - DeviceName = deviceName; - DeviceType = deviceType; - SerialNumber = serialNumber; - } - - /// - /// Device ID for a Yacan device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Device name for a Yacan device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Device type for a Yacan device. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceType { get; set; } - - /// - /// Serial number for a Yacan device. - /// - [DataMember(Name = "serial_number", IsRequired = false, EmitDefaultValue = false)] - public string? SerialNumber { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesCodeConstraints_model")] - public class DevicePropertiesCodeConstraints - { - [JsonConstructorAttribute] - protected DevicePropertiesCodeConstraints() { } - - public DevicePropertiesCodeConstraints( - DevicePropertiesCodeConstraints.ConstraintTypeEnum constraintType = default, - float? maxLength = default, - float? minLength = default - ) - { - ConstraintType = constraintType; - MaxLength = maxLength; - MinLength = minLength; - } - - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ConstraintTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "no_zeros")] - NoZeros = 1, - - [EnumMember(Value = "cannot_start_with_12")] - CannotStartWith_12 = 2, - - [EnumMember(Value = "no_triple_consecutive_ints")] - NoTripleConsecutiveInts = 3, - - [EnumMember(Value = "cannot_specify_pin_code")] - CannotSpecifyPinCode = 4, - - [EnumMember(Value = "pin_code_matches_existing_set")] - PinCodeMatchesExistingSet = 5, - - [EnumMember(Value = "start_date_in_future")] - StartDateInFuture = 6, - - [EnumMember(Value = "no_ascending_or_descending_sequence")] - NoAscendingOrDescendingSequence = 7, - - [EnumMember(Value = "at_least_three_unique_digits")] - AtLeastThreeUniqueDigits = 8, - - [EnumMember(Value = "cannot_contain_089")] - CannotContain_089 = 9, - - [EnumMember(Value = "cannot_contain_0789")] - CannotContain_0789 = 10, - - [EnumMember(Value = "unique_first_four_digits")] - UniqueFirstFourDigits = 11, - - [EnumMember(Value = "no_all_same_digits")] - NoAllSameDigits = 12, - - [EnumMember(Value = "name_length")] - NameLength = 13, - - [EnumMember(Value = "name_must_be_unique")] - NameMustBeUnique = 14, - } - - [DataMember(Name = "constraint_type", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesCodeConstraints.ConstraintTypeEnum ConstraintType { get; set; } - - /// - /// Maximum name length constraint for access codes. - /// - [DataMember(Name = "max_length", IsRequired = false, EmitDefaultValue = false)] - public float? MaxLength { get; set; } - - /// - /// Minimum name length constraint for access codes. - /// - [DataMember(Name = "min_length", IsRequired = false, EmitDefaultValue = false)] - public float? MinLength { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesKeypadBattery_model")] - public class DevicePropertiesKeypadBattery - { - [JsonConstructorAttribute] - protected DevicePropertiesKeypadBattery() { } - - public DevicePropertiesKeypadBattery(float level = default) - { - Level = level; - } - - /// - /// Keypad battery charge level. - /// - [DataMember(Name = "level", IsRequired = false, EmitDefaultValue = false)] - public float Level { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesOfflineTimeFrameOptions_model")] - public class DevicePropertiesOfflineTimeFrameOptions - { - [JsonConstructorAttribute] - protected DevicePropertiesOfflineTimeFrameOptions() { } - - public DevicePropertiesOfflineTimeFrameOptions( - string displayName = default, - string? endDateRecurrenceRule = default, - bool? matchingStartEndTime = default, - string? maxDuration = default, - string? minDuration = default, - string? startDateRecurrenceRule = default, - List? timePairs = default, - string? timeZone = default - ) - { - DisplayName = displayName; - EndDateRecurrenceRule = endDateRecurrenceRule; - MatchingStartEndTime = matchingStartEndTime; - MaxDuration = maxDuration; - MinDuration = minDuration; - StartDateRecurrenceRule = startDateRecurrenceRule; - TimePairs = timePairs; - TimeZone = timeZone; - } - - /// - /// Label for this option. For a single-option device, the product name (for example, `algoPIN` or `SmartPIN`); for a multi-option device, a label that distinguishes it (for example, `Hourly` or `Fixed start times`). - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// iCalendar recurrence rule (RRULE) that the end date must fall on. Constrains which calendar dates are selectable, independent of the time-of-day rules. - /// - [DataMember( - Name = "end_date_recurrence_rule", - IsRequired = false, - EmitDefaultValue = false - )] - public string? EndDateRecurrenceRule { get; set; } - - /// - /// When `true`, the start and end must fall at the same time of day (the caller picks which). Mutually exclusive with `time_pairs`. - /// - [DataMember(Name = "matching_start_end_time", IsRequired = false, EmitDefaultValue = false)] - public bool? MatchingStartEndTime { get; set; } - - /// - /// Maximum duration this option covers, as an ISO 8601 duration (for example, `PT672H` or `P367D`). Omitted when there is no maximum. - /// - [DataMember(Name = "max_duration", IsRequired = false, EmitDefaultValue = false)] - public string? MaxDuration { get; set; } - - /// - /// Minimum duration this option covers, as an ISO 8601 duration (for example, `PT1H` or `P29D`). Omitted when there is no minimum. - /// - [DataMember(Name = "min_duration", IsRequired = false, EmitDefaultValue = false)] - public string? MinDuration { get; set; } - - /// - /// iCalendar recurrence rule (RRULE) that the start date must fall on (for example, `FREQ=MONTHLY;BYDAY=1MO,3MO`). Constrains which calendar dates are selectable, independent of the time-of-day rules. - /// - [DataMember( - Name = "start_date_recurrence_rule", - IsRequired = false, - EmitDefaultValue = false - )] - public string? StartDateRecurrenceRule { get; set; } - - /// - /// Fixed start/end time pairings the caller chooses from. Mutually exclusive with `matching_start_end_time`. - /// - [DataMember(Name = "time_pairs", IsRequired = false, EmitDefaultValue = false)] - public List? TimePairs { get; set; } - - /// - /// IANA time zone for interpreting `time_pairs` and the date recurrence rules. Present only when the option fixes times or dates. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesOfflineTimeFrameOptionsTimePairs_model")] - public class DevicePropertiesOfflineTimeFrameOptionsTimePairs - { - [JsonConstructorAttribute] - protected DevicePropertiesOfflineTimeFrameOptionsTimePairs() { } - - public DevicePropertiesOfflineTimeFrameOptionsTimePairs( - string displayName = default, - string endTime = default, - string startTime = default - ) - { - DisplayName = displayName; - EndTime = endTime; - StartTime = startTime; - } - - /// - /// Label for the start/end time pairing. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// End time of day as a 24-hour `HH:MM` value, interpreted in the option's `time_zone`. An `end_time` earlier on the clock than `start_time` means the end falls on a later date. - /// - [DataMember(Name = "end_time", IsRequired = false, EmitDefaultValue = false)] - public string EndTime { get; set; } - - /// - /// Start time of day as a 24-hour `HH:MM` value, interpreted in the option's `time_zone`. - /// - [DataMember(Name = "start_time", IsRequired = false, EmitDefaultValue = false)] - public string StartTime { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesOnlineTimeFrameOptions_model")] - public class DevicePropertiesOnlineTimeFrameOptions - { - [JsonConstructorAttribute] - protected DevicePropertiesOnlineTimeFrameOptions() { } - - public DevicePropertiesOnlineTimeFrameOptions( - string displayName = default, - string? endDateRecurrenceRule = default, - bool? matchingStartEndTime = default, - string? maxDuration = default, - string? minDuration = default, - string? startDateRecurrenceRule = default, - List? timePairs = default, - string? timeZone = default - ) - { - DisplayName = displayName; - EndDateRecurrenceRule = endDateRecurrenceRule; - MatchingStartEndTime = matchingStartEndTime; - MaxDuration = maxDuration; - MinDuration = minDuration; - StartDateRecurrenceRule = startDateRecurrenceRule; - TimePairs = timePairs; - TimeZone = timeZone; - } - - /// - /// Label for this option. For a single-option device, the product name (for example, `algoPIN` or `SmartPIN`); for a multi-option device, a label that distinguishes it (for example, `Hourly` or `Fixed start times`). - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// iCalendar recurrence rule (RRULE) that the end date must fall on. Constrains which calendar dates are selectable, independent of the time-of-day rules. - /// - [DataMember( - Name = "end_date_recurrence_rule", - IsRequired = false, - EmitDefaultValue = false - )] - public string? EndDateRecurrenceRule { get; set; } - - /// - /// When `true`, the start and end must fall at the same time of day (the caller picks which). Mutually exclusive with `time_pairs`. - /// - [DataMember(Name = "matching_start_end_time", IsRequired = false, EmitDefaultValue = false)] - public bool? MatchingStartEndTime { get; set; } - - /// - /// Maximum duration this option covers, as an ISO 8601 duration (for example, `PT672H` or `P367D`). Omitted when there is no maximum. - /// - [DataMember(Name = "max_duration", IsRequired = false, EmitDefaultValue = false)] - public string? MaxDuration { get; set; } - - /// - /// Minimum duration this option covers, as an ISO 8601 duration (for example, `PT1H` or `P29D`). Omitted when there is no minimum. - /// - [DataMember(Name = "min_duration", IsRequired = false, EmitDefaultValue = false)] - public string? MinDuration { get; set; } - - /// - /// iCalendar recurrence rule (RRULE) that the start date must fall on (for example, `FREQ=MONTHLY;BYDAY=1MO,3MO`). Constrains which calendar dates are selectable, independent of the time-of-day rules. - /// - [DataMember( - Name = "start_date_recurrence_rule", - IsRequired = false, - EmitDefaultValue = false - )] - public string? StartDateRecurrenceRule { get; set; } - - /// - /// Fixed start/end time pairings the caller chooses from. Mutually exclusive with `matching_start_end_time`. - /// - [DataMember(Name = "time_pairs", IsRequired = false, EmitDefaultValue = false)] - public List? TimePairs { get; set; } - - /// - /// IANA time zone for interpreting `time_pairs` and the date recurrence rules. Present only when the option fixes times or dates. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesOnlineTimeFrameOptionsTimePairs_model")] - public class DevicePropertiesOnlineTimeFrameOptionsTimePairs - { - [JsonConstructorAttribute] - protected DevicePropertiesOnlineTimeFrameOptionsTimePairs() { } - - public DevicePropertiesOnlineTimeFrameOptionsTimePairs( - string displayName = default, - string endTime = default, - string startTime = default - ) - { - DisplayName = displayName; - EndTime = endTime; - StartTime = startTime; - } - - /// - /// Label for the start/end time pairing. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// End time of day as a 24-hour `HH:MM` value, interpreted in the option's `time_zone`. An `end_time` earlier on the clock than `start_time` means the end falls on a later date. - /// - [DataMember(Name = "end_time", IsRequired = false, EmitDefaultValue = false)] - public string EndTime { get; set; } - - /// - /// Start time of day as a 24-hour `HH:MM` value, interpreted in the option's `time_zone`. - /// - [DataMember(Name = "start_time", IsRequired = false, EmitDefaultValue = false)] - public string StartTime { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesActiveThermostatSchedule_model")] - public class DevicePropertiesActiveThermostatSchedule - { - [JsonConstructorAttribute] - protected DevicePropertiesActiveThermostatSchedule() { } - - public DevicePropertiesActiveThermostatSchedule( - string climatePresetKey = default, - string createdAt = default, - string deviceId = default, - string endsAt = default, - List errors = default, - bool? isOverrideAllowed = default, - int? maxOverridePeriodMinutes = default, - string? name = default, - string startsAt = default, - string thermostatScheduleId = default, - string workspaceId = default - ) - { - ClimatePresetKey = climatePresetKey; - CreatedAt = createdAt; - DeviceId = deviceId; - EndsAt = endsAt; - Errors = errors; - IsOverrideAllowed = isOverrideAllowed; - MaxOverridePeriodMinutes = maxOverridePeriodMinutes; - Name = name; - StartsAt = startsAt; - ThermostatScheduleId = thermostatScheduleId; - WorkspaceId = workspaceId; - } - - /// - /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// ID of the desired [thermostat](https://docs.seam.co/capability-guides/thermostats) device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string EndsAt { get; set; } - - /// - /// Errors associated with the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Indicates whether a person at the thermostat can change the thermostat's settings after the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts. - /// - [DataMember(Name = "is_override_allowed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOverrideAllowed { get; set; } - - /// - /// Number of minutes for which a person at the thermostat can change the thermostat's settings after the activation of the scheduled [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [DataMember( - Name = "max_override_period_minutes", - IsRequired = false, - EmitDefaultValue = false - )] - public int? MaxOverridePeriodMinutes { get; set; } - - /// - /// User-friendly name to identify the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string StartsAt { get; set; } - - /// - /// ID of the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [DataMember(Name = "thermostat_schedule_id", IsRequired = false, EmitDefaultValue = false)] - public string ThermostatScheduleId { get; set; } - - /// - /// ID of the workspace that contains the thermostat schedule. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesActiveThermostatScheduleErrors_model")] - public class DevicePropertiesActiveThermostatScheduleErrors - { - [JsonConstructorAttribute] - protected DevicePropertiesActiveThermostatScheduleErrors() { } - - public DevicePropertiesActiveThermostatScheduleErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAvailableClimatePresets_model")] - public class DevicePropertiesAvailableClimatePresets - { - [JsonConstructorAttribute] - protected DevicePropertiesAvailableClimatePresets() { } - - public DevicePropertiesAvailableClimatePresets( - bool canDelete = default, - bool canEdit = default, - bool canUseWithThermostatDailyPrograms = default, - string climatePresetKey = default, - DevicePropertiesAvailableClimatePresets.ClimatePresetModeEnum? climatePresetMode = - default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string displayName = default, - DevicePropertiesAvailableClimatePresetsEcobeeMetadata? ecobeeMetadata = default, - DevicePropertiesAvailableClimatePresets.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - DevicePropertiesAvailableClimatePresets.HvacModeSettingEnum? hvacModeSetting = default, - bool manualOverrideAllowed = default, - string? name = default - ) - { - CanDelete = canDelete; - CanEdit = canEdit; - CanUseWithThermostatDailyPrograms = canUseWithThermostatDailyPrograms; - ClimatePresetKey = climatePresetKey; - ClimatePresetMode = climatePresetMode; - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - DisplayName = displayName; - EcobeeMetadata = ecobeeMetadata; - FanModeSetting = fanModeSetting; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - HvacModeSetting = hvacModeSetting; - ManualOverrideAllowed = manualOverrideAllowed; - Name = name; - } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ClimatePresetModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "home")] - Home = 1, - - [EnumMember(Value = "away")] - Away = 2, - - [EnumMember(Value = "wake")] - Wake = 3, - - [EnumMember(Value = "sleep")] - Sleep = 4, - - [EnumMember(Value = "occupied")] - Occupied = 5, - - [EnumMember(Value = "unoccupied")] - Unoccupied = 6, - } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum FanModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum HvacModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "off")] - Off = 1, - - [EnumMember(Value = "heat")] - Heat = 2, - - [EnumMember(Value = "cool")] - Cool = 3, - - [EnumMember(Value = "heat_cool")] - HeatCool = 4, - - [EnumMember(Value = "eco")] - Eco = 5, - } - - /// - /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be deleted. - /// - [DataMember(Name = "can_delete", IsRequired = false, EmitDefaultValue = false)] - public bool CanDelete { get; set; } - - /// - /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be edited. - /// - [DataMember(Name = "can_edit", IsRequired = false, EmitDefaultValue = false)] - public bool CanEdit { get; set; } - - /// - /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be programmed in a thermostat daily program. - /// - [DataMember( - Name = "can_use_with_thermostat_daily_programs", - IsRequired = false, - EmitDefaultValue = false - )] - public bool CanUseWithThermostatDailyPrograms { get; set; } - - /// - /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [DataMember(Name = "climate_preset_mode", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAvailableClimatePresets.ClimatePresetModeEnum? ClimatePresetMode { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// Display name for the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Metadata specific to the Ecobee climate, if applicable. - /// - [DataMember(Name = "ecobee_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAvailableClimatePresetsEcobeeMetadata? EcobeeMetadata { get; set; } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [DataMember(Name = "fan_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAvailableClimatePresets.FanModeSettingEnum? FanModeSetting { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [DataMember(Name = "hvac_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAvailableClimatePresets.HvacModeSettingEnum? HvacModeSetting { get; set; } - - /// - /// Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] - [DataMember(Name = "manual_override_allowed", IsRequired = false, EmitDefaultValue = false)] - public bool ManualOverrideAllowed { get; set; } - - /// - /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesAvailableClimatePresetsEcobeeMetadata_model")] - public class DevicePropertiesAvailableClimatePresetsEcobeeMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesAvailableClimatePresetsEcobeeMetadata() { } - - public DevicePropertiesAvailableClimatePresetsEcobeeMetadata( - string? climateRef = default, - bool? isOptimized = default, - DevicePropertiesAvailableClimatePresetsEcobeeMetadata.OwnerEnum? owner = default - ) - { - ClimateRef = climateRef; - IsOptimized = isOptimized; - Owner = owner; - } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum OwnerEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "user")] - User = 1, - - [EnumMember(Value = "system")] - System = 2, - } - - /// - /// Reference to the Ecobee climate, if applicable. - /// - [DataMember(Name = "climate_ref", IsRequired = false, EmitDefaultValue = false)] - public string? ClimateRef { get; set; } - - /// - /// Indicates if the climate preset is optimized by Ecobee. - /// - [DataMember(Name = "is_optimized", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOptimized { get; set; } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [DataMember(Name = "owner", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesAvailableClimatePresetsEcobeeMetadata.OwnerEnum? Owner { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesCurrentClimateSetting_model")] - public class DevicePropertiesCurrentClimateSetting - { - [JsonConstructorAttribute] - protected DevicePropertiesCurrentClimateSetting() { } - - public DevicePropertiesCurrentClimateSetting( - bool? canDelete = default, - bool? canEdit = default, - bool? canUseWithThermostatDailyPrograms = default, - string? climatePresetKey = default, - DevicePropertiesCurrentClimateSetting.ClimatePresetModeEnum? climatePresetMode = - default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string? displayName = default, - DevicePropertiesCurrentClimateSettingEcobeeMetadata? ecobeeMetadata = default, - DevicePropertiesCurrentClimateSetting.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - DevicePropertiesCurrentClimateSetting.HvacModeSettingEnum? hvacModeSetting = default, - bool? manualOverrideAllowed = default, - string? name = default - ) - { - CanDelete = canDelete; - CanEdit = canEdit; - CanUseWithThermostatDailyPrograms = canUseWithThermostatDailyPrograms; - ClimatePresetKey = climatePresetKey; - ClimatePresetMode = climatePresetMode; - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - DisplayName = displayName; - EcobeeMetadata = ecobeeMetadata; - FanModeSetting = fanModeSetting; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - HvacModeSetting = hvacModeSetting; - ManualOverrideAllowed = manualOverrideAllowed; - Name = name; - } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ClimatePresetModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "home")] - Home = 1, - - [EnumMember(Value = "away")] - Away = 2, - - [EnumMember(Value = "wake")] - Wake = 3, - - [EnumMember(Value = "sleep")] - Sleep = 4, - - [EnumMember(Value = "occupied")] - Occupied = 5, - - [EnumMember(Value = "unoccupied")] - Unoccupied = 6, - } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum FanModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum HvacModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "off")] - Off = 1, - - [EnumMember(Value = "heat")] - Heat = 2, - - [EnumMember(Value = "cool")] - Cool = 3, - - [EnumMember(Value = "heat_cool")] - HeatCool = 4, - - [EnumMember(Value = "eco")] - Eco = 5, - } - - /// - /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be deleted. - /// - [DataMember(Name = "can_delete", IsRequired = false, EmitDefaultValue = false)] - public bool? CanDelete { get; set; } - - /// - /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be edited. - /// - [DataMember(Name = "can_edit", IsRequired = false, EmitDefaultValue = false)] - public bool? CanEdit { get; set; } - - /// - /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be programmed in a thermostat daily program. - /// - [DataMember( - Name = "can_use_with_thermostat_daily_programs", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanUseWithThermostatDailyPrograms { get; set; } - - /// - /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string? ClimatePresetKey { get; set; } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [DataMember(Name = "climate_preset_mode", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesCurrentClimateSetting.ClimatePresetModeEnum? ClimatePresetMode { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// Display name for the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string? DisplayName { get; set; } - - /// - /// Metadata specific to the Ecobee climate, if applicable. - /// - [DataMember(Name = "ecobee_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesCurrentClimateSettingEcobeeMetadata? EcobeeMetadata { get; set; } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [DataMember(Name = "fan_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesCurrentClimateSetting.FanModeSettingEnum? FanModeSetting { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [DataMember(Name = "hvac_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesCurrentClimateSetting.HvacModeSettingEnum? HvacModeSetting { get; set; } - - /// - /// Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] - [DataMember(Name = "manual_override_allowed", IsRequired = false, EmitDefaultValue = false)] - public bool? ManualOverrideAllowed { get; set; } - - /// - /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesCurrentClimateSettingEcobeeMetadata_model")] - public class DevicePropertiesCurrentClimateSettingEcobeeMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesCurrentClimateSettingEcobeeMetadata() { } - - public DevicePropertiesCurrentClimateSettingEcobeeMetadata( - string? climateRef = default, - bool? isOptimized = default, - DevicePropertiesCurrentClimateSettingEcobeeMetadata.OwnerEnum? owner = default - ) - { - ClimateRef = climateRef; - IsOptimized = isOptimized; - Owner = owner; - } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum OwnerEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "user")] - User = 1, - - [EnumMember(Value = "system")] - System = 2, - } - - /// - /// Reference to the Ecobee climate, if applicable. - /// - [DataMember(Name = "climate_ref", IsRequired = false, EmitDefaultValue = false)] - public string? ClimateRef { get; set; } - - /// - /// Indicates if the climate preset is optimized by Ecobee. - /// - [DataMember(Name = "is_optimized", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOptimized { get; set; } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [DataMember(Name = "owner", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesCurrentClimateSettingEcobeeMetadata.OwnerEnum? Owner { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesDefaultClimateSetting_model")] - public class DevicePropertiesDefaultClimateSetting - { - [JsonConstructorAttribute] - protected DevicePropertiesDefaultClimateSetting() { } - - public DevicePropertiesDefaultClimateSetting( - bool? canDelete = default, - bool? canEdit = default, - bool? canUseWithThermostatDailyPrograms = default, - string? climatePresetKey = default, - DevicePropertiesDefaultClimateSetting.ClimatePresetModeEnum? climatePresetMode = - default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string? displayName = default, - DevicePropertiesDefaultClimateSettingEcobeeMetadata? ecobeeMetadata = default, - DevicePropertiesDefaultClimateSetting.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - DevicePropertiesDefaultClimateSetting.HvacModeSettingEnum? hvacModeSetting = default, - bool? manualOverrideAllowed = default, - string? name = default - ) - { - CanDelete = canDelete; - CanEdit = canEdit; - CanUseWithThermostatDailyPrograms = canUseWithThermostatDailyPrograms; - ClimatePresetKey = climatePresetKey; - ClimatePresetMode = climatePresetMode; - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - DisplayName = displayName; - EcobeeMetadata = ecobeeMetadata; - FanModeSetting = fanModeSetting; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - HvacModeSetting = hvacModeSetting; - ManualOverrideAllowed = manualOverrideAllowed; - Name = name; - } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ClimatePresetModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "home")] - Home = 1, - - [EnumMember(Value = "away")] - Away = 2, - - [EnumMember(Value = "wake")] - Wake = 3, - - [EnumMember(Value = "sleep")] - Sleep = 4, - - [EnumMember(Value = "occupied")] - Occupied = 5, - - [EnumMember(Value = "unoccupied")] - Unoccupied = 6, - } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum FanModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum HvacModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "off")] - Off = 1, - - [EnumMember(Value = "heat")] - Heat = 2, - - [EnumMember(Value = "cool")] - Cool = 3, - - [EnumMember(Value = "heat_cool")] - HeatCool = 4, - - [EnumMember(Value = "eco")] - Eco = 5, - } - - /// - /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be deleted. - /// - [DataMember(Name = "can_delete", IsRequired = false, EmitDefaultValue = false)] - public bool? CanDelete { get; set; } - - /// - /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be edited. - /// - [DataMember(Name = "can_edit", IsRequired = false, EmitDefaultValue = false)] - public bool? CanEdit { get; set; } - - /// - /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be programmed in a thermostat daily program. - /// - [DataMember( - Name = "can_use_with_thermostat_daily_programs", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanUseWithThermostatDailyPrograms { get; set; } - - /// - /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string? ClimatePresetKey { get; set; } - - /// - /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. - /// - [DataMember(Name = "climate_preset_mode", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesDefaultClimateSetting.ClimatePresetModeEnum? ClimatePresetMode { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// Display name for the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string? DisplayName { get; set; } - - /// - /// Metadata specific to the Ecobee climate, if applicable. - /// - [DataMember(Name = "ecobee_metadata", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesDefaultClimateSettingEcobeeMetadata? EcobeeMetadata { get; set; } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [DataMember(Name = "fan_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesDefaultClimateSetting.FanModeSettingEnum? FanModeSetting { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [DataMember(Name = "hvac_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesDefaultClimateSetting.HvacModeSettingEnum? HvacModeSetting { get; set; } - - /// - /// Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] - [DataMember(Name = "manual_override_allowed", IsRequired = false, EmitDefaultValue = false)] - public bool? ManualOverrideAllowed { get; set; } - - /// - /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesDefaultClimateSettingEcobeeMetadata_model")] - public class DevicePropertiesDefaultClimateSettingEcobeeMetadata - { - [JsonConstructorAttribute] - protected DevicePropertiesDefaultClimateSettingEcobeeMetadata() { } - - public DevicePropertiesDefaultClimateSettingEcobeeMetadata( - string? climateRef = default, - bool? isOptimized = default, - DevicePropertiesDefaultClimateSettingEcobeeMetadata.OwnerEnum? owner = default - ) - { - ClimateRef = climateRef; - IsOptimized = isOptimized; - Owner = owner; - } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum OwnerEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "user")] - User = 1, - - [EnumMember(Value = "system")] - System = 2, - } - - /// - /// Reference to the Ecobee climate, if applicable. - /// - [DataMember(Name = "climate_ref", IsRequired = false, EmitDefaultValue = false)] - public string? ClimateRef { get; set; } - - /// - /// Indicates if the climate preset is optimized by Ecobee. - /// - [DataMember(Name = "is_optimized", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOptimized { get; set; } - - /// - /// Indicates whether the climate preset is owned by the user or the system. - /// - [DataMember(Name = "owner", IsRequired = false, EmitDefaultValue = false)] - public DevicePropertiesDefaultClimateSettingEcobeeMetadata.OwnerEnum? Owner { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesTemperatureThreshold_model")] - public class DevicePropertiesTemperatureThreshold - { - [JsonConstructorAttribute] - protected DevicePropertiesTemperatureThreshold() { } - - public DevicePropertiesTemperatureThreshold( - float? lowerLimitCelsius = default, - float? lowerLimitFahrenheit = default, - float? upperLimitCelsius = default, - float? upperLimitFahrenheit = default - ) - { - LowerLimitCelsius = lowerLimitCelsius; - LowerLimitFahrenheit = lowerLimitFahrenheit; - UpperLimitCelsius = upperLimitCelsius; - UpperLimitFahrenheit = upperLimitFahrenheit; - } - - /// - /// Lower limit in °C within the current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. - /// - [DataMember(Name = "lower_limit_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? LowerLimitCelsius { get; set; } - - /// - /// Lower limit in °F within the current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. - /// - [DataMember(Name = "lower_limit_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float? LowerLimitFahrenheit { get; set; } - - /// - /// Upper limit in °C within the current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. - /// - [DataMember(Name = "upper_limit_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? UpperLimitCelsius { get; set; } - - /// - /// Upper limit in °F within the current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. - /// - [DataMember(Name = "upper_limit_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float? UpperLimitFahrenheit { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesThermostatDailyPrograms_model")] - public class DevicePropertiesThermostatDailyPrograms - { - [JsonConstructorAttribute] - protected DevicePropertiesThermostatDailyPrograms() { } - - public DevicePropertiesThermostatDailyPrograms( - string createdAt = default, - string deviceId = default, - string? name = default, - List periods = default, - string thermostatDailyProgramId = default, - string workspaceId = default - ) - { - CreatedAt = createdAt; - DeviceId = deviceId; - Name = name; - Periods = periods; - ThermostatDailyProgramId = thermostatDailyProgramId; - WorkspaceId = workspaceId; - } - - /// - /// Date and time at which the thermostat daily program was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// ID of the thermostat device on which the thermostat daily program is configured. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// User-friendly name to identify the thermostat daily program. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Array of thermostat daily program periods. - /// - [DataMember(Name = "periods", IsRequired = false, EmitDefaultValue = false)] - public List Periods { get; set; } - - /// - /// ID of the thermostat daily program. - /// - [DataMember( - Name = "thermostat_daily_program_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string ThermostatDailyProgramId { get; set; } - - /// - /// ID of the workspace that contains the thermostat daily program. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesThermostatDailyProgramsPeriods_model")] - public class DevicePropertiesThermostatDailyProgramsPeriods - { - [JsonConstructorAttribute] - protected DevicePropertiesThermostatDailyProgramsPeriods() { } - - public DevicePropertiesThermostatDailyProgramsPeriods( - string climatePresetKey = default, - string startsAtTime = default - ) - { - ClimatePresetKey = climatePresetKey; - StartsAtTime = startsAtTime; - } - - /// - /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to activate at the `starts_at_time`. - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// Time at which the thermostat daily program period starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at_time", IsRequired = false, EmitDefaultValue = false)] - public string StartsAtTime { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_devicePropertiesThermostatWeeklyProgram_model")] - public class DevicePropertiesThermostatWeeklyProgram - { - [JsonConstructorAttribute] - protected DevicePropertiesThermostatWeeklyProgram() { } - - public DevicePropertiesThermostatWeeklyProgram( - string createdAt = default, - string? fridayProgramId = default, - string? mondayProgramId = default, - string? saturdayProgramId = default, - string? sundayProgramId = default, - string? thursdayProgramId = default, - string? tuesdayProgramId = default, - string? wednesdayProgramId = default - ) - { - CreatedAt = createdAt; - FridayProgramId = fridayProgramId; - MondayProgramId = mondayProgramId; - SaturdayProgramId = saturdayProgramId; - SundayProgramId = sundayProgramId; - ThursdayProgramId = thursdayProgramId; - TuesdayProgramId = tuesdayProgramId; - WednesdayProgramId = wednesdayProgramId; - } - - /// - /// Date and time at which the thermostat weekly program was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// ID of the thermostat daily program to run on Fridays. - /// - [DataMember(Name = "friday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? FridayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Mondays. - /// - [DataMember(Name = "monday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? MondayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Saturdays. - /// - [DataMember(Name = "saturday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? SaturdayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Sundays. - /// - [DataMember(Name = "sunday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? SundayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Thursdays. - /// - [DataMember(Name = "thursday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? ThursdayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Tuesdays. - /// - [DataMember(Name = "tuesday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? TuesdayProgramId { get; set; } - - /// - /// ID of the thermostat daily program to run on Wednesdays. - /// - [DataMember(Name = "wednesday_program_id", IsRequired = false, EmitDefaultValue = false)] - public string? WednesdayProgramId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/Event.cs b/src/Seam/Model/Event.cs deleted file mode 100644 index 3dd7034e..00000000 --- a/src/Seam/Model/Event.cs +++ /dev/null @@ -1,17909 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - [JsonConverter(typeof(JsonSubtypes), "event_type")] - [JsonSubtypes.FallBackSubType(typeof(EventUnrecognized))] - [JsonSubtypes.KnownSubType(typeof(EventSpaceDeleted), "space.deleted")] - [JsonSubtypes.KnownSubType(typeof(EventSpaceCreated), "space.created")] - [JsonSubtypes.KnownSubType( - typeof(EventSpaceDeviceMembershipChanged), - "space.device_membership_changed" - )] - [JsonSubtypes.KnownSubType(typeof(EventPhoneDeactivated), "phone.deactivated")] - [JsonSubtypes.KnownSubType(typeof(EventDeviceDoorbellRang), "device.doorbell_rang")] - [JsonSubtypes.KnownSubType(typeof(EventCameraActivated), "camera.activated")] - [JsonSubtypes.KnownSubType(typeof(EventDeviceNameChanged), "device.name_changed")] - [JsonSubtypes.KnownSubType( - typeof(EventThermostatTemperatureChanged), - "thermostat.temperature_changed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventThermostatTemperatureReachedSetPoint), - "thermostat.temperature_reached_set_point" - )] - [JsonSubtypes.KnownSubType( - typeof(EventThermostatTemperatureThresholdNoLongerExceeded), - "thermostat.temperature_threshold_no_longer_exceeded" - )] - [JsonSubtypes.KnownSubType( - typeof(EventThermostatTemperatureThresholdExceeded), - "thermostat.temperature_threshold_exceeded" - )] - [JsonSubtypes.KnownSubType( - typeof(EventThermostatManuallyAdjusted), - "thermostat.manually_adjusted" - )] - [JsonSubtypes.KnownSubType( - typeof(EventThermostatClimatePresetActivated), - "thermostat.climate_preset_activated" - )] - [JsonSubtypes.KnownSubType(typeof(EventLockAccessDenied), "lock.access_denied")] - [JsonSubtypes.KnownSubType(typeof(EventLockUnlocked), "lock.unlocked")] - [JsonSubtypes.KnownSubType(typeof(EventLockLocked), "lock.locked")] - [JsonSubtypes.KnownSubType( - typeof(EventNoiseSensorNoiseThresholdTriggered), - "noise_sensor.noise_threshold_triggered" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceAccessoryKeypadDisconnected), - "device.accessory_keypad_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceAccessoryKeypadConnected), - "device.accessory_keypad_connected" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceErrorSubscriptionRequiredResolved), - "device.error.subscription_required.resolved" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceErrorSubscriptionRequired), - "device.error.subscription_required" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceConnectionStabilized), - "device.connection_stabilized" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceConnectionBecameFlaky), - "device.connection_became_flaky" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceSaltoPrivacyModeDeactivated), - "device.salto.privacy_mode_deactivated" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceSaltoPrivacyModeActivated), - "device.salto.privacy_mode_activated" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceThirdPartyIntegrationNoLongerDetected), - "device.third_party_integration_no_longer_detected" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceThirdPartyIntegrationDetected), - "device.third_party_integration_detected" - )] - [JsonSubtypes.KnownSubType(typeof(EventDeviceDeleted), "device.deleted")] - [JsonSubtypes.KnownSubType(typeof(EventDeviceRemoved), "device.removed")] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceBatteryStatusChanged), - "device.battery_status_changed" - )] - [JsonSubtypes.KnownSubType(typeof(EventDeviceLowBattery), "device.low_battery")] - [JsonSubtypes.KnownSubType(typeof(EventDeviceTampered), "device.tampered")] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceUnmanagedDisconnected), - "device.unmanaged.disconnected" - )] - [JsonSubtypes.KnownSubType(typeof(EventDeviceDisconnected), "device.disconnected")] - [JsonSubtypes.KnownSubType(typeof(EventDeviceUnmanagedConnected), "device.unmanaged.connected")] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceUnmanagedConvertedToManaged), - "device.unmanaged.converted_to_managed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventDeviceConvertedToUnmanaged), - "device.converted_to_unmanaged" - )] - [JsonSubtypes.KnownSubType(typeof(EventDeviceAdded), "device.added")] - [JsonSubtypes.KnownSubType(typeof(EventDeviceConnected), "device.connected")] - [JsonSubtypes.KnownSubType( - typeof(EventConnectWebviewLoginFailed), - "connect_webview.login_failed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventConnectWebviewLoginSucceeded), - "connect_webview.login_succeeded" - )] - [JsonSubtypes.KnownSubType( - typeof(EventActionAttemptSimulateManualLockViaKeypadFailed), - "action_attempt.simulate_manual_lock_via_keypad.failed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventActionAttemptSimulateManualLockViaKeypadSucceeded), - "action_attempt.simulate_manual_lock_via_keypad.succeeded" - )] - [JsonSubtypes.KnownSubType( - typeof(EventActionAttemptSimulateKeypadCodeEntryFailed), - "action_attempt.simulate_keypad_code_entry.failed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventActionAttemptSimulateKeypadCodeEntrySucceeded), - "action_attempt.simulate_keypad_code_entry.succeeded" - )] - [JsonSubtypes.KnownSubType( - typeof(EventActionAttemptUnlockDoorFailed), - "action_attempt.unlock_door.failed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventActionAttemptUnlockDoorSucceeded), - "action_attempt.unlock_door.succeeded" - )] - [JsonSubtypes.KnownSubType( - typeof(EventActionAttemptLockDoorFailed), - "action_attempt.lock_door.failed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventActionAttemptLockDoorSucceeded), - "action_attempt.lock_door.succeeded" - )] - [JsonSubtypes.KnownSubType( - typeof(EventConnectedAccountReauthorizationRequested), - "connected_account.reauthorization_requested" - )] - [JsonSubtypes.KnownSubType( - typeof(EventConnectedAccountCompletedFirstSyncAfterReconnection), - "connected_account.completed_first_sync_after_reconnection" - )] - [JsonSubtypes.KnownSubType(typeof(EventConnectedAccountDeleted), "connected_account.deleted")] - [JsonSubtypes.KnownSubType( - typeof(EventConnectedAccountCompletedFirstSync), - "connected_account.completed_first_sync" - )] - [JsonSubtypes.KnownSubType( - typeof(EventConnectedAccountDisconnected), - "connected_account.disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(EventConnectedAccountSuccessfulLogin), - "connected_account.successful_login" - )] - [JsonSubtypes.KnownSubType(typeof(EventConnectedAccountCreated), "connected_account.created")] - [JsonSubtypes.KnownSubType( - typeof(EventConnectedAccountConnected), - "connected_account.connected" - )] - [JsonSubtypes.KnownSubType(typeof(EventClientSessionDeleted), "client_session.deleted")] - [JsonSubtypes.KnownSubType(typeof(EventAcsEntranceRemoved), "acs_entrance.removed")] - [JsonSubtypes.KnownSubType(typeof(EventAcsEntranceAdded), "acs_entrance.added")] - [JsonSubtypes.KnownSubType(typeof(EventAcsAccessGroupDeleted), "acs_access_group.deleted")] - [JsonSubtypes.KnownSubType(typeof(EventAcsEncoderRemoved), "acs_encoder.removed")] - [JsonSubtypes.KnownSubType(typeof(EventAcsEncoderAdded), "acs_encoder.added")] - [JsonSubtypes.KnownSubType(typeof(EventAcsUserDeleted), "acs_user.deleted")] - [JsonSubtypes.KnownSubType(typeof(EventAcsUserCreated), "acs_user.created")] - [JsonSubtypes.KnownSubType(typeof(EventAcsCredentialInvalidated), "acs_credential.invalidated")] - [JsonSubtypes.KnownSubType(typeof(EventAcsCredentialReissued), "acs_credential.reissued")] - [JsonSubtypes.KnownSubType(typeof(EventAcsCredentialIssued), "acs_credential.issued")] - [JsonSubtypes.KnownSubType(typeof(EventAcsCredentialDeleted), "acs_credential.deleted")] - [JsonSubtypes.KnownSubType(typeof(EventAcsSystemDisconnected), "acs_system.disconnected")] - [JsonSubtypes.KnownSubType(typeof(EventAcsSystemAdded), "acs_system.added")] - [JsonSubtypes.KnownSubType(typeof(EventAcsSystemConnected), "acs_system.connected")] - [JsonSubtypes.KnownSubType( - typeof(EventAccessMethodFailedToIssue), - "access_method.failed_to_issue" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessMethodDelayInIssuing), - "access_method.delay_in_issuing" - )] - [JsonSubtypes.KnownSubType(typeof(EventAccessMethodCreated), "access_method.created")] - [JsonSubtypes.KnownSubType(typeof(EventAccessMethodReissued), "access_method.reissued")] - [JsonSubtypes.KnownSubType(typeof(EventAccessMethodDeleted), "access_method.deleted")] - [JsonSubtypes.KnownSubType( - typeof(EventAccessMethodCardEncodingRequired), - "access_method.card_encoding_required" - )] - [JsonSubtypes.KnownSubType(typeof(EventAccessMethodRevoked), "access_method.revoked")] - [JsonSubtypes.KnownSubType(typeof(EventAccessMethodIssued), "access_method.issued")] - [JsonSubtypes.KnownSubType( - typeof(EventAccessGrantCouldNotCreateRequestedAccessMethods), - "access_grant.could_not_create_requested_access_methods" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessGrantAccessTimesChanged), - "access_grant.access_times_changed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessGrantAccessToDoorLost), - "access_grant.access_to_door_lost" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessGrantAccessGrantedToDoor), - "access_grant.access_granted_to_door" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessGrantAccessGrantedToAllDoors), - "access_grant.access_granted_to_all_doors" - )] - [JsonSubtypes.KnownSubType(typeof(EventAccessGrantDeleted), "access_grant.deleted")] - [JsonSubtypes.KnownSubType(typeof(EventAccessGrantCreated), "access_grant.created")] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeUnmanagedRemoved), - "access_code.unmanaged.removed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeUnmanagedCreated), - "access_code.unmanaged.created" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeUnmanagedFailedToConvertToManaged), - "access_code.unmanaged.failed_to_convert_to_managed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeUnmanagedConvertedToManaged), - "access_code.unmanaged.converted_to_managed" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeBackupAccessCodePulled), - "access_code.backup_access_code_pulled" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeDeletedExternalToSeam), - "access_code.deleted_external_to_seam" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeModifiedExternalToSeam), - "access_code.modified_external_to_seam" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeFailedToRemoveFromDevice), - "access_code.failed_to_remove_from_device" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeDelayInRemovingFromDevice), - "access_code.delay_in_removing_from_device" - )] - [JsonSubtypes.KnownSubType(typeof(EventAccessCodeDeleted), "access_code.deleted")] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeFailedToSetOnDevice), - "access_code.failed_to_set_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeDelayInSettingOnDevice), - "access_code.delay_in_setting_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeRemovedFromDevice), - "access_code.removed_from_device" - )] - [JsonSubtypes.KnownSubType(typeof(EventAccessCodeSetOnDevice), "access_code.set_on_device")] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeScheduledOnDevice), - "access_code.scheduled_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeMutationsRequested), - "access_code.mutations_requested" - )] - [JsonSubtypes.KnownSubType( - typeof(EventAccessCodeTimeFrameChanged), - "access_code.time_frame_changed" - )] - [JsonSubtypes.KnownSubType(typeof(EventAccessCodeCodeChanged), "access_code.code_changed")] - [JsonSubtypes.KnownSubType(typeof(EventAccessCodeNameChanged), "access_code.name_changed")] - [JsonSubtypes.KnownSubType(typeof(EventAccessCodeChanged), "access_code.changed")] - [JsonSubtypes.KnownSubType(typeof(EventAccessCodeCreated), "access_code.created")] - public abstract class Event - { - public abstract string EventType { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string? EventDescription { get; set; } - - public abstract string EventId { get; set; } - - public abstract string OccurredAt { get; set; } - - public abstract string WorkspaceId { get; set; } - - public abstract override string ToString(); - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was created. - /// - [DataContract(Name = "seamModel_eventAccessCodeCreated_model")] - public class EventAccessCodeCreated : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeCreated() { } - - public EventAccessCodeCreated( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.created"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was changed. - /// - [DataContract(Name = "seamModel_eventAccessCodeChanged_model")] - public class EventAccessCodeChanged : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeChanged() { } - - public EventAccessCodeChanged( - string accessCodeId = default, - string? changeReason = default, - List? changedProperties = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ChangeReason = changeReason; - ChangedProperties = changedProperties; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Human-readable reason for the change (e.g. `ongoing code auto-renewed`). - /// - [DataMember(Name = "change_reason", IsRequired = false, EmitDefaultValue = false)] - public string? ChangeReason { get; set; } - - /// - /// List of properties that changed on the access code. - /// - [DataMember(Name = "changed_properties", IsRequired = false, EmitDefaultValue = false)] - public List? ChangedProperties { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.changed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeChangedChangedProperties_model")] - public class EventAccessCodeChangedChangedProperties - { - [JsonConstructorAttribute] - protected EventAccessCodeChangedChangedProperties() { } - - public EventAccessCodeChangedChangedProperties( - string? from = default, - string property = default, - string? to = default - ) - { - From = from; - Property = property; - To = to; - } - - /// - /// Previous value of the property, or null if not set. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public string? From { get; set; } - - /// - /// Name of the property that changed (e.g. `code`). - /// - [DataMember(Name = "property", IsRequired = false, EmitDefaultValue = false)] - public string Property { get; set; } - - /// - /// New value of the property, or null if cleared. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public string? To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// The name of an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was changed on the device. - /// - [DataContract(Name = "seamModel_eventAccessCodeNameChanged_model")] - public class EventAccessCodeNameChanged : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeNameChanged() { } - - public EventAccessCodeNameChanged( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string description = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - EventAccessCodeNameChangedFrom from = default, - string occurredAt = default, - EventAccessCodeNameChangedTo to = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - Description = description; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - From = from; - OccurredAt = occurredAt; - To = to; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the change and its source. - /// - [DataMember(Name = "description", IsRequired = false, EmitDefaultValue = false)] - public string Description { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.name_changed"; - - /// - /// Previous access code name configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public EventAccessCodeNameChangedFrom From { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// New access code name configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public EventAccessCodeNameChangedTo To { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeNameChangedFrom_model")] - public class EventAccessCodeNameChangedFrom - { - [JsonConstructorAttribute] - protected EventAccessCodeNameChangedFrom() { } - - public EventAccessCodeNameChangedFrom(string? name = default) - { - Name = name; - } - - /// - /// Previous name of the access code. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeNameChangedTo_model")] - public class EventAccessCodeNameChangedTo - { - [JsonConstructorAttribute] - protected EventAccessCodeNameChangedTo() { } - - public EventAccessCodeNameChangedTo(string? name = default) - { - Name = name; - } - - /// - /// New name of the access code. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// The pin code of an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was changed on the device. - /// - [DataContract(Name = "seamModel_eventAccessCodeCodeChanged_model")] - public class EventAccessCodeCodeChanged : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeCodeChanged() { } - - public EventAccessCodeCodeChanged( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string description = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - EventAccessCodeCodeChangedFrom from = default, - string occurredAt = default, - EventAccessCodeCodeChangedTo to = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - Description = description; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - From = from; - OccurredAt = occurredAt; - To = to; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the change and its source. - /// - [DataMember(Name = "description", IsRequired = false, EmitDefaultValue = false)] - public string Description { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.code_changed"; - - /// - /// Previous pin code configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public EventAccessCodeCodeChangedFrom From { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// New pin code configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public EventAccessCodeCodeChangedTo To { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeCodeChangedFrom_model")] - public class EventAccessCodeCodeChangedFrom - { - [JsonConstructorAttribute] - protected EventAccessCodeCodeChangedFrom() { } - - public EventAccessCodeCodeChangedFrom(string? code = default) - { - Code = code; - } - - /// - /// Previous pin code. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeCodeChangedTo_model")] - public class EventAccessCodeCodeChangedTo - { - [JsonConstructorAttribute] - protected EventAccessCodeCodeChangedTo() { } - - public EventAccessCodeCodeChangedTo(string? code = default) - { - Code = code; - } - - /// - /// New pin code. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// The time frame of an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was changed on the device. - /// - [DataContract(Name = "seamModel_eventAccessCodeTimeFrameChanged_model")] - public class EventAccessCodeTimeFrameChanged : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeTimeFrameChanged() { } - - public EventAccessCodeTimeFrameChanged( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string description = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - EventAccessCodeTimeFrameChangedFrom from = default, - string occurredAt = default, - EventAccessCodeTimeFrameChangedTo to = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - Description = description; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - From = from; - OccurredAt = occurredAt; - To = to; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the change and its source. - /// - [DataMember(Name = "description", IsRequired = false, EmitDefaultValue = false)] - public string Description { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.time_frame_changed"; - - /// - /// Previous time frame configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public EventAccessCodeTimeFrameChangedFrom From { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// New time frame configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public EventAccessCodeTimeFrameChangedTo To { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeTimeFrameChangedFrom_model")] - public class EventAccessCodeTimeFrameChangedFrom - { - [JsonConstructorAttribute] - protected EventAccessCodeTimeFrameChangedFrom() { } - - public EventAccessCodeTimeFrameChangedFrom( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Previous end time. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Previous start time. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeTimeFrameChangedTo_model")] - public class EventAccessCodeTimeFrameChangedTo - { - [JsonConstructorAttribute] - protected EventAccessCodeTimeFrameChangedTo() { } - - public EventAccessCodeTimeFrameChangedTo( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// New end time. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// New start time. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Mutations were requested on an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). This event fires at request time, before the change is confirmed on the device. - /// - [DataContract(Name = "seamModel_eventAccessCodeMutationsRequested_model")] - public class EventAccessCodeMutationsRequested : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeMutationsRequested() { } - - public EventAccessCodeMutationsRequested( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - List requestedMutations = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - RequestedMutations = requestedMutations; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.mutations_requested"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Array of mutations requested on the access code, each containing the mutation type and from/to values. - /// - [DataMember(Name = "requested_mutations", IsRequired = false, EmitDefaultValue = false)] - public List RequestedMutations { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeMutationsRequestedRequestedMutations_model")] - public class EventAccessCodeMutationsRequestedRequestedMutations - { - [JsonConstructorAttribute] - protected EventAccessCodeMutationsRequestedRequestedMutations() { } - - public EventAccessCodeMutationsRequestedRequestedMutations( - object? from = default, - EventAccessCodeMutationsRequestedRequestedMutations.MutationCodeEnum mutationCode = - default, - object? to = default - ) - { - From = from; - MutationCode = mutationCode; - To = to; - } - - /// - /// Code identifying the type of mutation requested, such as `updating_name`, `updating_code`, `updating_time_frame`, or `deleting`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum MutationCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "updating_name")] - UpdatingName = 1, - - [EnumMember(Value = "updating_code")] - UpdatingCode = 2, - - [EnumMember(Value = "updating_time_frame")] - UpdatingTimeFrame = 3, - - [EnumMember(Value = "deleting")] - Deleting = 4, - - [EnumMember(Value = "creating")] - Creating = 5, - - [EnumMember(Value = "deferring_creation")] - DeferringCreation = 6, - } - - /// - /// Previous property values before the requested change. Keys depend on the mutation type. Absent for non-property mutations like `deleting`. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public object? From { get; set; } - - /// - /// Code identifying the type of mutation requested, such as `updating_name`, `updating_code`, `updating_time_frame`, or `deleting`. - /// - [DataMember(Name = "mutation_code", IsRequired = false, EmitDefaultValue = false)] - public EventAccessCodeMutationsRequestedRequestedMutations.MutationCodeEnum MutationCode { get; set; } - - /// - /// New property values after the requested change. Keys depend on the mutation type. Absent for non-property mutations like `deleting`. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public object? To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was [scheduled natively](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) on a device. - /// - [DataContract(Name = "seamModel_eventAccessCodeScheduledOnDevice_model")] - public class EventAccessCodeScheduledOnDevice : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeScheduledOnDevice() { } - - public EventAccessCodeScheduledOnDevice( - string accessCodeId = default, - string code = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - Code = code; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Code for the affected access code. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string Code { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.scheduled_on_device"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was set on a device. - /// - [DataContract(Name = "seamModel_eventAccessCodeSetOnDevice_model")] - public class EventAccessCodeSetOnDevice : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeSetOnDevice() { } - - public EventAccessCodeSetOnDevice( - string accessCodeId = default, - string code = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - Code = code; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Code for the affected access code. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string Code { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.set_on_device"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was removed from a device. - /// - [DataContract(Name = "seamModel_eventAccessCodeRemovedFromDevice_model")] - public class EventAccessCodeRemovedFromDevice : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeRemovedFromDevice() { } - - public EventAccessCodeRemovedFromDevice( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.removed_from_device"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// There was an unusually long delay in setting an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) on a device. - /// - [DataContract(Name = "seamModel_eventAccessCodeDelayInSettingOnDevice_model")] - public class EventAccessCodeDelayInSettingOnDevice : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInSettingOnDevice() { } - - public EventAccessCodeDelayInSettingOnDevice( - List accessCodeErrors = default, - string accessCodeId = default, - List accessCodeWarnings = - default, - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - object? deviceCustomMetadata = default, - List deviceErrors = default, - string deviceId = default, - List deviceWarnings = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeErrors = accessCodeErrors; - AccessCodeId = accessCodeId; - AccessCodeWarnings = accessCodeWarnings; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Errors associated with the access code. - /// - [DataMember(Name = "access_code_errors", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeErrors { get; set; } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Warnings associated with the access code. - /// - [DataMember(Name = "access_code_warnings", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeWarnings { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.delay_in_setting_on_device"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeDelayInSettingOnDeviceAccessCodeErrors_model")] - public class EventAccessCodeDelayInSettingOnDeviceAccessCodeErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInSettingOnDeviceAccessCodeErrors() { } - - public EventAccessCodeDelayInSettingOnDeviceAccessCodeErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeDelayInSettingOnDeviceAccessCodeWarnings_model")] - public class EventAccessCodeDelayInSettingOnDeviceAccessCodeWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInSettingOnDeviceAccessCodeWarnings() { } - - public EventAccessCodeDelayInSettingOnDeviceAccessCodeWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeDelayInSettingOnDeviceConnectedAccountErrors_model" - )] - public class EventAccessCodeDelayInSettingOnDeviceConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInSettingOnDeviceConnectedAccountErrors() { } - - public EventAccessCodeDelayInSettingOnDeviceConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeDelayInSettingOnDeviceConnectedAccountWarnings_model" - )] - public class EventAccessCodeDelayInSettingOnDeviceConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInSettingOnDeviceConnectedAccountWarnings() { } - - public EventAccessCodeDelayInSettingOnDeviceConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeDelayInSettingOnDeviceDeviceErrors_model")] - public class EventAccessCodeDelayInSettingOnDeviceDeviceErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInSettingOnDeviceDeviceErrors() { } - - public EventAccessCodeDelayInSettingOnDeviceDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeDelayInSettingOnDeviceDeviceWarnings_model")] - public class EventAccessCodeDelayInSettingOnDeviceDeviceWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInSettingOnDeviceDeviceWarnings() { } - - public EventAccessCodeDelayInSettingOnDeviceDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) failed to be set on a device. - /// - [DataContract(Name = "seamModel_eventAccessCodeFailedToSetOnDevice_model")] - public class EventAccessCodeFailedToSetOnDevice : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToSetOnDevice() { } - - public EventAccessCodeFailedToSetOnDevice( - List accessCodeErrors = default, - string accessCodeId = default, - List accessCodeWarnings = default, - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - object? deviceCustomMetadata = default, - List deviceErrors = default, - string deviceId = default, - List deviceWarnings = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeErrors = accessCodeErrors; - AccessCodeId = accessCodeId; - AccessCodeWarnings = accessCodeWarnings; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Errors associated with the access code. - /// - [DataMember(Name = "access_code_errors", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeErrors { get; set; } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Warnings associated with the access code. - /// - [DataMember(Name = "access_code_warnings", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeWarnings { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.failed_to_set_on_device"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeFailedToSetOnDeviceAccessCodeErrors_model")] - public class EventAccessCodeFailedToSetOnDeviceAccessCodeErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToSetOnDeviceAccessCodeErrors() { } - - public EventAccessCodeFailedToSetOnDeviceAccessCodeErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeFailedToSetOnDeviceAccessCodeWarnings_model")] - public class EventAccessCodeFailedToSetOnDeviceAccessCodeWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToSetOnDeviceAccessCodeWarnings() { } - - public EventAccessCodeFailedToSetOnDeviceAccessCodeWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeFailedToSetOnDeviceConnectedAccountErrors_model" - )] - public class EventAccessCodeFailedToSetOnDeviceConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToSetOnDeviceConnectedAccountErrors() { } - - public EventAccessCodeFailedToSetOnDeviceConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeFailedToSetOnDeviceConnectedAccountWarnings_model" - )] - public class EventAccessCodeFailedToSetOnDeviceConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToSetOnDeviceConnectedAccountWarnings() { } - - public EventAccessCodeFailedToSetOnDeviceConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeFailedToSetOnDeviceDeviceErrors_model")] - public class EventAccessCodeFailedToSetOnDeviceDeviceErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToSetOnDeviceDeviceErrors() { } - - public EventAccessCodeFailedToSetOnDeviceDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeFailedToSetOnDeviceDeviceWarnings_model")] - public class EventAccessCodeFailedToSetOnDeviceDeviceWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToSetOnDeviceDeviceWarnings() { } - - public EventAccessCodeFailedToSetOnDeviceDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was deleted. - /// - [DataContract(Name = "seamModel_eventAccessCodeDeleted_model")] - public class EventAccessCodeDeleted : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeDeleted() { } - - public EventAccessCodeDeleted( - string accessCodeId = default, - string? code = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - Code = code; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Code for the affected access code. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// There was an unusually long delay in removing an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) from a device. - /// - [Obsolete( - "Seam no longer emits this event. Use `access_code.failed_to_remove_from_device` instead." - )] - [DataContract(Name = "seamModel_eventAccessCodeDelayInRemovingFromDevice_model")] - public class EventAccessCodeDelayInRemovingFromDevice : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInRemovingFromDevice() { } - - public EventAccessCodeDelayInRemovingFromDevice( - List accessCodeErrors = - default, - string accessCodeId = default, - List accessCodeWarnings = - default, - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - object? deviceCustomMetadata = default, - List deviceErrors = default, - string deviceId = default, - List deviceWarnings = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeErrors = accessCodeErrors; - AccessCodeId = accessCodeId; - AccessCodeWarnings = accessCodeWarnings; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Errors associated with the access code. - /// - [DataMember(Name = "access_code_errors", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeErrors { get; set; } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Warnings associated with the access code. - /// - [DataMember(Name = "access_code_warnings", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeWarnings { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.delay_in_removing_from_device"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeDelayInRemovingFromDeviceAccessCodeErrors_model" - )] - public class EventAccessCodeDelayInRemovingFromDeviceAccessCodeErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInRemovingFromDeviceAccessCodeErrors() { } - - public EventAccessCodeDelayInRemovingFromDeviceAccessCodeErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeDelayInRemovingFromDeviceAccessCodeWarnings_model" - )] - public class EventAccessCodeDelayInRemovingFromDeviceAccessCodeWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInRemovingFromDeviceAccessCodeWarnings() { } - - public EventAccessCodeDelayInRemovingFromDeviceAccessCodeWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeDelayInRemovingFromDeviceConnectedAccountErrors_model" - )] - public class EventAccessCodeDelayInRemovingFromDeviceConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInRemovingFromDeviceConnectedAccountErrors() { } - - public EventAccessCodeDelayInRemovingFromDeviceConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeDelayInRemovingFromDeviceConnectedAccountWarnings_model" - )] - public class EventAccessCodeDelayInRemovingFromDeviceConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInRemovingFromDeviceConnectedAccountWarnings() { } - - public EventAccessCodeDelayInRemovingFromDeviceConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeDelayInRemovingFromDeviceDeviceErrors_model")] - public class EventAccessCodeDelayInRemovingFromDeviceDeviceErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInRemovingFromDeviceDeviceErrors() { } - - public EventAccessCodeDelayInRemovingFromDeviceDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeDelayInRemovingFromDeviceDeviceWarnings_model")] - public class EventAccessCodeDelayInRemovingFromDeviceDeviceWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeDelayInRemovingFromDeviceDeviceWarnings() { } - - public EventAccessCodeDelayInRemovingFromDeviceDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) failed to be removed from a device. - /// - [DataContract(Name = "seamModel_eventAccessCodeFailedToRemoveFromDevice_model")] - public class EventAccessCodeFailedToRemoveFromDevice : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToRemoveFromDevice() { } - - public EventAccessCodeFailedToRemoveFromDevice( - List accessCodeErrors = - default, - string accessCodeId = default, - List accessCodeWarnings = - default, - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - object? deviceCustomMetadata = default, - List deviceErrors = default, - string deviceId = default, - List deviceWarnings = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeErrors = accessCodeErrors; - AccessCodeId = accessCodeId; - AccessCodeWarnings = accessCodeWarnings; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Errors associated with the access code. - /// - [DataMember(Name = "access_code_errors", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeErrors { get; set; } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Warnings associated with the access code. - /// - [DataMember(Name = "access_code_warnings", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeWarnings { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.failed_to_remove_from_device"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeFailedToRemoveFromDeviceAccessCodeErrors_model")] - public class EventAccessCodeFailedToRemoveFromDeviceAccessCodeErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToRemoveFromDeviceAccessCodeErrors() { } - - public EventAccessCodeFailedToRemoveFromDeviceAccessCodeErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeFailedToRemoveFromDeviceAccessCodeWarnings_model" - )] - public class EventAccessCodeFailedToRemoveFromDeviceAccessCodeWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToRemoveFromDeviceAccessCodeWarnings() { } - - public EventAccessCodeFailedToRemoveFromDeviceAccessCodeWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeFailedToRemoveFromDeviceConnectedAccountErrors_model" - )] - public class EventAccessCodeFailedToRemoveFromDeviceConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToRemoveFromDeviceConnectedAccountErrors() { } - - public EventAccessCodeFailedToRemoveFromDeviceConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeFailedToRemoveFromDeviceConnectedAccountWarnings_model" - )] - public class EventAccessCodeFailedToRemoveFromDeviceConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToRemoveFromDeviceConnectedAccountWarnings() { } - - public EventAccessCodeFailedToRemoveFromDeviceConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeFailedToRemoveFromDeviceDeviceErrors_model")] - public class EventAccessCodeFailedToRemoveFromDeviceDeviceErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToRemoveFromDeviceDeviceErrors() { } - - public EventAccessCodeFailedToRemoveFromDeviceDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAccessCodeFailedToRemoveFromDeviceDeviceWarnings_model")] - public class EventAccessCodeFailedToRemoveFromDeviceDeviceWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeFailedToRemoveFromDeviceDeviceWarnings() { } - - public EventAccessCodeFailedToRemoveFromDeviceDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was modified outside of Seam. - /// - [DataContract(Name = "seamModel_eventAccessCodeModifiedExternalToSeam_model")] - public class EventAccessCodeModifiedExternalToSeam : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeModifiedExternalToSeam() { } - - public EventAccessCodeModifiedExternalToSeam( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.modified_external_to_seam"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was deleted outside of Seam. - /// - [DataContract(Name = "seamModel_eventAccessCodeDeletedExternalToSeam_model")] - public class EventAccessCodeDeletedExternalToSeam : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeDeletedExternalToSeam() { } - - public EventAccessCodeDeletedExternalToSeam( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.deleted_external_to_seam"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [backup access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) was pulled from the backup access code pool and set on a device. - /// - [DataContract(Name = "seamModel_eventAccessCodeBackupAccessCodePulled_model")] - public class EventAccessCodeBackupAccessCodePulled : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeBackupAccessCodePulled() { } - - public EventAccessCodeBackupAccessCodePulled( - string accessCodeId = default, - string backupAccessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - BackupAccessCodeId = backupAccessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// ID of the backup access code that was pulled from the pool. - /// - [DataMember(Name = "backup_access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string BackupAccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.backup_access_code_pulled"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) was converted successfully to a managed access code. - /// - [DataContract(Name = "seamModel_eventAccessCodeUnmanagedConvertedToManaged_model")] - public class EventAccessCodeUnmanagedConvertedToManaged : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedConvertedToManaged() { } - - public EventAccessCodeUnmanagedConvertedToManaged( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.unmanaged.converted_to_managed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) failed to be converted to a managed access code. - /// - [DataContract(Name = "seamModel_eventAccessCodeUnmanagedFailedToConvertToManaged_model")] - public class EventAccessCodeUnmanagedFailedToConvertToManaged : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedFailedToConvertToManaged() { } - - public EventAccessCodeUnmanagedFailedToConvertToManaged( - List accessCodeErrors = - default, - string accessCodeId = default, - List accessCodeWarnings = - default, - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - object? deviceCustomMetadata = default, - List deviceErrors = - default, - string deviceId = default, - List deviceWarnings = - default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeErrors = accessCodeErrors; - AccessCodeId = accessCodeId; - AccessCodeWarnings = accessCodeWarnings; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Errors associated with the access code. - /// - [DataMember(Name = "access_code_errors", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeErrors { get; set; } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Warnings associated with the access code. - /// - [DataMember(Name = "access_code_warnings", IsRequired = false, EmitDefaultValue = false)] - public List AccessCodeWarnings { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = - "access_code.unmanaged.failed_to_convert_to_managed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeErrors_model" - )] - public class EventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeErrors() { } - - public EventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeWarnings_model" - )] - public class EventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeWarnings() { } - - public EventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountErrors_model" - )] - public class EventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountErrors() { } - - public EventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountWarnings_model" - )] - public class EventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountWarnings() { } - - public EventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeUnmanagedFailedToConvertToManagedDeviceErrors_model" - )] - public class EventAccessCodeUnmanagedFailedToConvertToManagedDeviceErrors - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedFailedToConvertToManagedDeviceErrors() { } - - public EventAccessCodeUnmanagedFailedToConvertToManagedDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventAccessCodeUnmanagedFailedToConvertToManagedDeviceWarnings_model" - )] - public class EventAccessCodeUnmanagedFailedToConvertToManagedDeviceWarnings - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedFailedToConvertToManagedDeviceWarnings() { } - - public EventAccessCodeUnmanagedFailedToConvertToManagedDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) was created on a device. - /// - [DataContract(Name = "seamModel_eventAccessCodeUnmanagedCreated_model")] - public class EventAccessCodeUnmanagedCreated : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedCreated() { } - - public EventAccessCodeUnmanagedCreated( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.unmanaged.created"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) was removed from a device. - /// - [DataContract(Name = "seamModel_eventAccessCodeUnmanagedRemoved_model")] - public class EventAccessCodeUnmanagedRemoved : Event - { - [JsonConstructorAttribute] - protected EventAccessCodeUnmanagedRemoved() { } - - public EventAccessCodeUnmanagedRemoved( - string accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the affected access code. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the device associated with the affected access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_code.unmanaged.removed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An Access Grant was created. - /// - [DataContract(Name = "seamModel_eventAccessGrantCreated_model")] - public class EventAccessGrantCreated : Event - { - [JsonConstructorAttribute] - protected EventAccessGrantCreated() { } - - public EventAccessGrantCreated( - string accessGrantId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantId = accessGrantId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected Access Grant. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_grant.created"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An Access Grant was deleted. - /// - [DataContract(Name = "seamModel_eventAccessGrantDeleted_model")] - public class EventAccessGrantDeleted : Event - { - [JsonConstructorAttribute] - protected EventAccessGrantDeleted() { } - - public EventAccessGrantDeleted( - string accessGrantId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantId = accessGrantId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected Access Grant. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_grant.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// All access requested for an Access Grant was successfully granted. - /// - [DataContract(Name = "seamModel_eventAccessGrantAccessGrantedToAllDoors_model")] - public class EventAccessGrantAccessGrantedToAllDoors : Event - { - [JsonConstructorAttribute] - protected EventAccessGrantAccessGrantedToAllDoors() { } - - public EventAccessGrantAccessGrantedToAllDoors( - string accessGrantId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantId = accessGrantId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected Access Grant. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_grant.access_granted_to_all_doors"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Access requested as part of an Access Grant to a particular door was successfully granted. - /// - [DataContract(Name = "seamModel_eventAccessGrantAccessGrantedToDoor_model")] - public class EventAccessGrantAccessGrantedToDoor : Event - { - [JsonConstructorAttribute] - protected EventAccessGrantAccessGrantedToDoor() { } - - public EventAccessGrantAccessGrantedToDoor( - string accessGrantId = default, - string acsEntranceId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantId = accessGrantId; - AcsEntranceId = acsEntranceId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected Access Grant. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// ID of the affected [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_grant.access_granted_to_door"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Access to a particular door that was requested as part of an Access Grant was lost. - /// - [DataContract(Name = "seamModel_eventAccessGrantAccessToDoorLost_model")] - public class EventAccessGrantAccessToDoorLost : Event - { - [JsonConstructorAttribute] - protected EventAccessGrantAccessToDoorLost() { } - - public EventAccessGrantAccessToDoorLost( - string accessGrantId = default, - string acsEntranceId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantId = accessGrantId; - AcsEntranceId = acsEntranceId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected Access Grant. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// ID of the affected [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_grant.access_to_door_lost"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An Access Grant's start or end time was changed. - /// - [DataContract(Name = "seamModel_eventAccessGrantAccessTimesChanged_model")] - public class EventAccessGrantAccessTimesChanged : Event - { - [JsonConstructorAttribute] - protected EventAccessGrantAccessTimesChanged() { } - - public EventAccessGrantAccessTimesChanged( - string accessGrantId = default, - string? accessGrantKey = default, - string createdAt = default, - string? endsAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string? startsAt = default, - string workspaceId = default - ) - { - AccessGrantId = accessGrantId; - AccessGrantKey = accessGrantKey; - CreatedAt = createdAt; - EndsAt = endsAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - StartsAt = startsAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected Access Grant. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// Key of the affected Access Grant (if present). - /// - [DataMember(Name = "access_grant_key", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantKey { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The new end time for the access grant. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_grant.access_times_changed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// The new start time for the access grant. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// One or more requested access methods could not be created for an Access Grant. - /// - [DataContract(Name = "seamModel_eventAccessGrantCouldNotCreateRequestedAccessMethods_model")] - public class EventAccessGrantCouldNotCreateRequestedAccessMethods : Event - { - [JsonConstructorAttribute] - protected EventAccessGrantCouldNotCreateRequestedAccessMethods() { } - - public EventAccessGrantCouldNotCreateRequestedAccessMethods( - string accessGrantId = default, - string createdAt = default, - string errorMessage = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - List? missingDeviceIds = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantId = accessGrantId; - CreatedAt = createdAt; - ErrorMessage = errorMessage; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - MissingDeviceIds = missingDeviceIds; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected Access Grant. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Description of why the access methods could not be created. - /// - [DataMember(Name = "error_message", IsRequired = false, EmitDefaultValue = false)] - public string ErrorMessage { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = - "access_grant.could_not_create_requested_access_methods"; - - /// - /// IDs of the devices that did not receive a requested access method. Use these to identify which specific devices failed without having to fetch the Access Grant. - /// - [DataMember(Name = "missing_device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? MissingDeviceIds { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An access method was issued. - /// - [DataContract(Name = "seamModel_eventAccessMethodIssued_model")] - public class EventAccessMethodIssued : Event - { - [JsonConstructorAttribute] - protected EventAccessMethodIssued() { } - - public EventAccessMethodIssued( - List accessGrantIds = default, - List? accessGrantKeys = default, - string accessMethodId = default, - string? code = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - bool? isBackupCode = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantIds = accessGrantIds; - AccessGrantKeys = accessGrantKeys; - AccessMethodId = accessMethodId; - Code = code; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - IsBackupCode = isBackupCode; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// IDs of the access grants associated with this access method. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrantIds { get; set; } - - /// - /// Keys of the access grants associated with this access method (if present). - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - /// - /// ID of the affected access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// The actual PIN code for code access methods (only present when mode is 'code'). - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_method.issued"; - - /// - /// Indicates whether the code is a backup code (only present when mode is 'code' and a backup code was used). - /// - [DataMember(Name = "is_backup_code", IsRequired = false, EmitDefaultValue = false)] - public bool? IsBackupCode { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An access method was revoked. - /// - [DataContract(Name = "seamModel_eventAccessMethodRevoked_model")] - public class EventAccessMethodRevoked : Event - { - [JsonConstructorAttribute] - protected EventAccessMethodRevoked() { } - - public EventAccessMethodRevoked( - List accessGrantIds = default, - List? accessGrantKeys = default, - string accessMethodId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantIds = accessGrantIds; - AccessGrantKeys = accessGrantKeys; - AccessMethodId = accessMethodId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// IDs of the access grants associated with this access method. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrantIds { get; set; } - - /// - /// Keys of the access grants associated with this access method (if present). - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - /// - /// ID of the affected access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_method.revoked"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An access method representing a physical card requires encoding. - /// - [DataContract(Name = "seamModel_eventAccessMethodCardEncodingRequired_model")] - public class EventAccessMethodCardEncodingRequired : Event - { - [JsonConstructorAttribute] - protected EventAccessMethodCardEncodingRequired() { } - - public EventAccessMethodCardEncodingRequired( - List accessGrantIds = default, - List? accessGrantKeys = default, - string accessMethodId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantIds = accessGrantIds; - AccessGrantKeys = accessGrantKeys; - AccessMethodId = accessMethodId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// IDs of the access grants associated with this access method. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrantIds { get; set; } - - /// - /// Keys of the access grants associated with this access method (if present). - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - /// - /// ID of the affected access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_method.card_encoding_required"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An access method was deleted. - /// - [DataContract(Name = "seamModel_eventAccessMethodDeleted_model")] - public class EventAccessMethodDeleted : Event - { - [JsonConstructorAttribute] - protected EventAccessMethodDeleted() { } - - public EventAccessMethodDeleted( - List accessGrantIds = default, - List? accessGrantKeys = default, - string accessMethodId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantIds = accessGrantIds; - AccessGrantKeys = accessGrantKeys; - AccessMethodId = accessMethodId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// IDs of the access grants associated with this access method. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrantIds { get; set; } - - /// - /// Keys of the access grants associated with this access method (if present). - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - /// - /// ID of the affected access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_method.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An access method was reissued. - /// - [DataContract(Name = "seamModel_eventAccessMethodReissued_model")] - public class EventAccessMethodReissued : Event - { - [JsonConstructorAttribute] - protected EventAccessMethodReissued() { } - - public EventAccessMethodReissued( - List accessGrantIds = default, - List? accessGrantKeys = default, - string accessMethodId = default, - string? code = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - bool? isBackupCode = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantIds = accessGrantIds; - AccessGrantKeys = accessGrantKeys; - AccessMethodId = accessMethodId; - Code = code; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - IsBackupCode = isBackupCode; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// IDs of the access grants associated with this access method. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrantIds { get; set; } - - /// - /// Keys of the access grants associated with this access method (if present). - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - /// - /// ID of the affected access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// The actual PIN code for code access methods (only present when mode is 'code'). - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_method.reissued"; - - /// - /// Indicates whether the code is a backup code (only present when mode is 'code' and a backup code was used). - /// - [DataMember(Name = "is_backup_code", IsRequired = false, EmitDefaultValue = false)] - public bool? IsBackupCode { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An access method was created. - /// - [DataContract(Name = "seamModel_eventAccessMethodCreated_model")] - public class EventAccessMethodCreated : Event - { - [JsonConstructorAttribute] - protected EventAccessMethodCreated() { } - - public EventAccessMethodCreated( - List accessGrantIds = default, - List? accessGrantKeys = default, - string accessMethodId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantIds = accessGrantIds; - AccessGrantKeys = accessGrantKeys; - AccessMethodId = accessMethodId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// IDs of the access grants associated with this access method. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrantIds { get; set; } - - /// - /// Keys of the access grants associated with this access method (if present). - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - /// - /// ID of the affected access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_method.created"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Seam has not yet issued this access method, even though its access grant is about to begin, so access may not be ready when the recipient arrives. Seam is still attempting to issue it, and the accompanying `delay_in_issuing` warning clears automatically once issuance succeeds. - /// - [DataContract(Name = "seamModel_eventAccessMethodDelayInIssuing_model")] - public class EventAccessMethodDelayInIssuing : Event - { - [JsonConstructorAttribute] - protected EventAccessMethodDelayInIssuing() { } - - public EventAccessMethodDelayInIssuing( - List accessGrantIds = default, - List? accessGrantKeys = default, - string accessMethodId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantIds = accessGrantIds; - AccessGrantKeys = accessGrantKeys; - AccessMethodId = accessMethodId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// IDs of the access grants associated with this access method. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrantIds { get; set; } - - /// - /// Keys of the access grants associated with this access method (if present). - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - /// - /// ID of the affected access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_method.delay_in_issuing"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Seam was unable to issue this access method before its access grant started, so the recipient may be unable to access the space. This usually points to a problem that needs attention, such as an offline or disconnected device. Seam keeps retrying, and the accompanying `failed_to_issue` error clears automatically if the access method is eventually issued. - /// - [DataContract(Name = "seamModel_eventAccessMethodFailedToIssue_model")] - public class EventAccessMethodFailedToIssue : Event - { - [JsonConstructorAttribute] - protected EventAccessMethodFailedToIssue() { } - - public EventAccessMethodFailedToIssue( - List accessGrantIds = default, - List? accessGrantKeys = default, - string accessMethodId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessGrantIds = accessGrantIds; - AccessGrantKeys = accessGrantKeys; - AccessMethodId = accessMethodId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// IDs of the access grants associated with this access method. - /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessGrantIds { get; set; } - - /// - /// Keys of the access grants associated with this access method (if present). - /// - [DataMember(Name = "access_grant_keys", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantKeys { get; set; } - - /// - /// ID of the affected access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "access_method.failed_to_issue"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system](https://docs.seam.co/low-level-apis/access-systems) was connected. - /// - [DataContract(Name = "seamModel_eventAcsSystemConnected_model")] - public class EventAcsSystemConnected : Event - { - [JsonConstructorAttribute] - protected EventAcsSystemConnected() { } - - public EventAcsSystemConnected( - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_system.connected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system](https://docs.seam.co/low-level-apis/access-systems) was added. - /// - [DataContract(Name = "seamModel_eventAcsSystemAdded_model")] - public class EventAcsSystemAdded : Event - { - [JsonConstructorAttribute] - protected EventAcsSystemAdded() { } - - public EventAcsSystemAdded( - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_system.added"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system](https://docs.seam.co/low-level-apis/access-systems) was disconnected. - /// - [DataContract(Name = "seamModel_eventAcsSystemDisconnected_model")] - public class EventAcsSystemDisconnected : Event - { - [JsonConstructorAttribute] - protected EventAcsSystemDisconnected() { } - - public EventAcsSystemDisconnected( - List acsSystemErrors = default, - string acsSystemId = default, - List acsSystemWarnings = default, - List connectedAccountErrors = default, - string? connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsSystemErrors = acsSystemErrors; - AcsSystemId = acsSystemId; - AcsSystemWarnings = acsSystemWarnings; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Errors associated with the access control system. - /// - [DataMember(Name = "acs_system_errors", IsRequired = false, EmitDefaultValue = false)] - public List AcsSystemErrors { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// Warnings associated with the access control system. - /// - [DataMember(Name = "acs_system_warnings", IsRequired = false, EmitDefaultValue = false)] - public List AcsSystemWarnings { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_system.disconnected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAcsSystemDisconnectedAcsSystemErrors_model")] - public class EventAcsSystemDisconnectedAcsSystemErrors - { - [JsonConstructorAttribute] - protected EventAcsSystemDisconnectedAcsSystemErrors() { } - - public EventAcsSystemDisconnectedAcsSystemErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAcsSystemDisconnectedAcsSystemWarnings_model")] - public class EventAcsSystemDisconnectedAcsSystemWarnings - { - [JsonConstructorAttribute] - protected EventAcsSystemDisconnectedAcsSystemWarnings() { } - - public EventAcsSystemDisconnectedAcsSystemWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAcsSystemDisconnectedConnectedAccountErrors_model")] - public class EventAcsSystemDisconnectedConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventAcsSystemDisconnectedConnectedAccountErrors() { } - - public EventAcsSystemDisconnectedConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventAcsSystemDisconnectedConnectedAccountWarnings_model")] - public class EventAcsSystemDisconnectedConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventAcsSystemDisconnectedConnectedAccountWarnings() { } - - public EventAcsSystemDisconnectedConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was deleted. - /// - [DataContract(Name = "seamModel_eventAcsCredentialDeleted_model")] - public class EventAcsCredentialDeleted : Event - { - [JsonConstructorAttribute] - protected EventAcsCredentialDeleted() { } - - public EventAcsCredentialDeleted( - string acsCredentialId = default, - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsCredentialId = acsCredentialId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected credential. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_credential.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was issued. - /// - [DataContract(Name = "seamModel_eventAcsCredentialIssued_model")] - public class EventAcsCredentialIssued : Event - { - [JsonConstructorAttribute] - protected EventAcsCredentialIssued() { } - - public EventAcsCredentialIssued( - string acsCredentialId = default, - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsCredentialId = acsCredentialId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected credential. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_credential.issued"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was reissued. - /// - [DataContract(Name = "seamModel_eventAcsCredentialReissued_model")] - public class EventAcsCredentialReissued : Event - { - [JsonConstructorAttribute] - protected EventAcsCredentialReissued() { } - - public EventAcsCredentialReissued( - string acsCredentialId = default, - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsCredentialId = acsCredentialId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected credential. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_credential.reissued"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was invalidated. That is, the credential cannot be used anymore. - /// - [DataContract(Name = "seamModel_eventAcsCredentialInvalidated_model")] - public class EventAcsCredentialInvalidated : Event - { - [JsonConstructorAttribute] - protected EventAcsCredentialInvalidated() { } - - public EventAcsCredentialInvalidated( - string acsCredentialId = default, - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsCredentialId = acsCredentialId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected credential. - /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsCredentialId { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_credential.invalidated"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) was created. - /// - [DataContract(Name = "seamModel_eventAcsUserCreated_model")] - public class EventAcsUserCreated : Event - { - [JsonConstructorAttribute] - protected EventAcsUserCreated() { } - - public EventAcsUserCreated( - string acsSystemId = default, - string acsUserId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the affected access system user. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsUserId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_user.created"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) was deleted. - /// - [DataContract(Name = "seamModel_eventAcsUserDeleted_model")] - public class EventAcsUserDeleted : Event - { - [JsonConstructorAttribute] - protected EventAcsUserDeleted() { } - - public EventAcsUserDeleted( - string acsSystemId = default, - string acsUserId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the affected access system user. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsUserId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_user.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) was added. - /// - [DataContract(Name = "seamModel_eventAcsEncoderAdded_model")] - public class EventAcsEncoderAdded : Event - { - [JsonConstructorAttribute] - protected EventAcsEncoderAdded() { } - - public EventAcsEncoderAdded( - string acsEncoderId = default, - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsEncoderId = acsEncoderId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected encoder. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_encoder.added"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) was removed. - /// - [DataContract(Name = "seamModel_eventAcsEncoderRemoved_model")] - public class EventAcsEncoderRemoved : Event - { - [JsonConstructorAttribute] - protected EventAcsEncoderRemoved() { } - - public EventAcsEncoderRemoved( - string acsEncoderId = default, - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsEncoderId = acsEncoderId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected encoder. - /// - [DataMember(Name = "acs_encoder_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsEncoderId { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_encoder.removed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An ACS access group was deleted. - /// - [DataContract(Name = "seamModel_eventAcsAccessGroupDeleted_model")] - public class EventAcsAccessGroupDeleted : Event - { - [JsonConstructorAttribute] - protected EventAcsAccessGroupDeleted() { } - - public EventAcsAccessGroupDeleted( - string acsAccessGroupId = default, - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsAccessGroupId = acsAccessGroupId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected access group. - /// - [DataMember(Name = "acs_access_group_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsAccessGroupId { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_access_group.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) was added. - /// - [DataContract(Name = "seamModel_eventAcsEntranceAdded_model")] - public class EventAcsEntranceAdded : Event - { - [JsonConstructorAttribute] - protected EventAcsEntranceAdded() { } - - public EventAcsEntranceAdded( - string acsEntranceId = default, - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsEntranceId = acsEntranceId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected entrance. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_entrance.added"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) was removed. - /// - [DataContract(Name = "seamModel_eventAcsEntranceRemoved_model")] - public class EventAcsEntranceRemoved : Event - { - [JsonConstructorAttribute] - protected EventAcsEntranceRemoved() { } - - public EventAcsEntranceRemoved( - string acsEntranceId = default, - string acsSystemId = default, - string? connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - AcsEntranceId = acsEntranceId; - AcsSystemId = acsSystemId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected entrance. - /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsEntranceId { get; set; } - - /// - /// ID of the access system. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string AcsSystemId { get; set; } - - /// - /// ID of the connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "acs_entrance.removed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A client session was deleted. - /// - [DataContract(Name = "seamModel_eventClientSessionDeleted_model")] - public class EventClientSessionDeleted : Event - { - [JsonConstructorAttribute] - protected EventClientSessionDeleted() { } - - public EventClientSessionDeleted( - string clientSessionId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ClientSessionId = clientSessionId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected client session. - /// - [DataMember(Name = "client_session_id", IsRequired = false, EmitDefaultValue = false)] - public string ClientSessionId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "client_session.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A connected account was connected for the first time or was reconnected after being disconnected. - /// - [DataContract(Name = "seamModel_eventConnectedAccountConnected_model")] - public class EventConnectedAccountConnected : Event - { - [JsonConstructorAttribute] - protected EventConnectedAccountConnected() { } - - public EventConnectedAccountConnected( - string? connectWebviewId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectWebviewId = connectWebviewId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the Connect Webview associated with the event. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectWebviewId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the affected connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with this connected account, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "connected_account.connected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A connected account was created. - /// - [DataContract(Name = "seamModel_eventConnectedAccountCreated_model")] - public class EventConnectedAccountCreated : Event - { - [JsonConstructorAttribute] - protected EventConnectedAccountCreated() { } - - public EventConnectedAccountCreated( - string connectWebviewId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectWebviewId = connectWebviewId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the Connect Webview associated with the event. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectWebviewId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the affected connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "connected_account.created"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A connected account had a successful login using a Connect Webview. - /// - [Obsolete("Use `connect_webview.login_succeeded`.")] - [DataContract(Name = "seamModel_eventConnectedAccountSuccessfulLogin_model")] - public class EventConnectedAccountSuccessfulLogin : Event - { - [JsonConstructorAttribute] - protected EventConnectedAccountSuccessfulLogin() { } - - public EventConnectedAccountSuccessfulLogin( - string connectWebviewId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectWebviewId = connectWebviewId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the Connect Webview associated with the event. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectWebviewId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the affected connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "connected_account.successful_login"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A connected account was disconnected. - /// - [DataContract(Name = "seamModel_eventConnectedAccountDisconnected_model")] - public class EventConnectedAccountDisconnected : Event - { - [JsonConstructorAttribute] - protected EventConnectedAccountDisconnected() { } - - public EventConnectedAccountDisconnected( - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the affected connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "connected_account.disconnected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventConnectedAccountDisconnectedConnectedAccountErrors_model")] - public class EventConnectedAccountDisconnectedConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventConnectedAccountDisconnectedConnectedAccountErrors() { } - - public EventConnectedAccountDisconnectedConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventConnectedAccountDisconnectedConnectedAccountWarnings_model" - )] - public class EventConnectedAccountDisconnectedConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventConnectedAccountDisconnectedConnectedAccountWarnings() { } - - public EventConnectedAccountDisconnectedConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A connected account completed the first sync with Seam, and the corresponding devices or systems are now available. - /// - [DataContract(Name = "seamModel_eventConnectedAccountCompletedFirstSync_model")] - public class EventConnectedAccountCompletedFirstSync : Event - { - [JsonConstructorAttribute] - protected EventConnectedAccountCompletedFirstSync() { } - - public EventConnectedAccountCompletedFirstSync( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the affected connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "connected_account.completed_first_sync"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A connected account was deleted. - /// - [DataContract(Name = "seamModel_eventConnectedAccountDeleted_model")] - public class EventConnectedAccountDeleted : Event - { - [JsonConstructorAttribute] - protected EventConnectedAccountDeleted() { } - - public EventConnectedAccountDeleted( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the affected connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with this connected account, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "connected_account.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A connected account completed the first sync after reconnection with Seam, and the corresponding devices or systems are now available. - /// - [DataContract( - Name = "seamModel_eventConnectedAccountCompletedFirstSyncAfterReconnection_model" - )] - public class EventConnectedAccountCompletedFirstSyncAfterReconnection : Event - { - [JsonConstructorAttribute] - protected EventConnectedAccountCompletedFirstSyncAfterReconnection() { } - - public EventConnectedAccountCompletedFirstSyncAfterReconnection( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the affected connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = - "connected_account.completed_first_sync_after_reconnection"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A connected account requires reauthorization using a new Connect Webview. The account is still connected, but cannot access new features. Delaying reauthorization too long will eventually cause the Connected Account to become disconnected. - /// - [DataContract(Name = "seamModel_eventConnectedAccountReauthorizationRequested_model")] - public class EventConnectedAccountReauthorizationRequested : Event - { - [JsonConstructorAttribute] - protected EventConnectedAccountReauthorizationRequested() { } - - public EventConnectedAccountReauthorizationRequested( - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the affected connected account. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "connected_account.reauthorization_requested"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventConnectedAccountReauthorizationRequestedConnectedAccountErrors_model" - )] - public class EventConnectedAccountReauthorizationRequestedConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventConnectedAccountReauthorizationRequestedConnectedAccountErrors() { } - - public EventConnectedAccountReauthorizationRequestedConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventConnectedAccountReauthorizationRequestedConnectedAccountWarnings_model" - )] - public class EventConnectedAccountReauthorizationRequestedConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventConnectedAccountReauthorizationRequestedConnectedAccountWarnings() { } - - public EventConnectedAccountReauthorizationRequestedConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A lock door action attempt succeeded. - /// - [DataContract(Name = "seamModel_eventActionAttemptLockDoorSucceeded_model")] - public class EventActionAttemptLockDoorSucceeded : Event - { - [JsonConstructorAttribute] - protected EventActionAttemptLockDoorSucceeded() { } - - public EventActionAttemptLockDoorSucceeded( - string actionAttemptId = default, - string actionType = default, - string? connectedAccountId = default, - string createdAt = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string status = default, - string workspaceId = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - Status = status; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string ActionAttemptId { get; set; } - - /// - /// Type of the action. - /// - [DataMember(Name = "action_type", IsRequired = false, EmitDefaultValue = false)] - public string ActionType { get; set; } - - /// - /// ID of the connected account associated with the action attempt, if applicable. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device associated with the action attempt, if applicable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "action_attempt.lock_door.succeeded"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Status of the action. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public string Status { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A lock door action attempt failed. - /// - [DataContract(Name = "seamModel_eventActionAttemptLockDoorFailed_model")] - public class EventActionAttemptLockDoorFailed : Event - { - [JsonConstructorAttribute] - protected EventActionAttemptLockDoorFailed() { } - - public EventActionAttemptLockDoorFailed( - string actionAttemptId = default, - string actionType = default, - string? connectedAccountId = default, - string createdAt = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string status = default, - string workspaceId = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - Status = status; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string ActionAttemptId { get; set; } - - /// - /// Type of the action. - /// - [DataMember(Name = "action_type", IsRequired = false, EmitDefaultValue = false)] - public string ActionType { get; set; } - - /// - /// ID of the connected account associated with the action attempt, if applicable. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device associated with the action attempt, if applicable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "action_attempt.lock_door.failed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Status of the action. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public string Status { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An unlock door action attempt succeeded. - /// - [DataContract(Name = "seamModel_eventActionAttemptUnlockDoorSucceeded_model")] - public class EventActionAttemptUnlockDoorSucceeded : Event - { - [JsonConstructorAttribute] - protected EventActionAttemptUnlockDoorSucceeded() { } - - public EventActionAttemptUnlockDoorSucceeded( - string actionAttemptId = default, - string actionType = default, - string? connectedAccountId = default, - string createdAt = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string status = default, - string workspaceId = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - Status = status; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string ActionAttemptId { get; set; } - - /// - /// Type of the action. - /// - [DataMember(Name = "action_type", IsRequired = false, EmitDefaultValue = false)] - public string ActionType { get; set; } - - /// - /// ID of the connected account associated with the action attempt, if applicable. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device associated with the action attempt, if applicable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "action_attempt.unlock_door.succeeded"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Status of the action. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public string Status { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An unlock door action attempt failed. - /// - [DataContract(Name = "seamModel_eventActionAttemptUnlockDoorFailed_model")] - public class EventActionAttemptUnlockDoorFailed : Event - { - [JsonConstructorAttribute] - protected EventActionAttemptUnlockDoorFailed() { } - - public EventActionAttemptUnlockDoorFailed( - string actionAttemptId = default, - string actionType = default, - string? connectedAccountId = default, - string createdAt = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string status = default, - string workspaceId = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - Status = status; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string ActionAttemptId { get; set; } - - /// - /// Type of the action. - /// - [DataMember(Name = "action_type", IsRequired = false, EmitDefaultValue = false)] - public string ActionType { get; set; } - - /// - /// ID of the connected account associated with the action attempt, if applicable. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device associated with the action attempt, if applicable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "action_attempt.unlock_door.failed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Status of the action. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public string Status { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A simulate keypad code entry action attempt succeeded. - /// - [DataContract(Name = "seamModel_eventActionAttemptSimulateKeypadCodeEntrySucceeded_model")] - public class EventActionAttemptSimulateKeypadCodeEntrySucceeded : Event - { - [JsonConstructorAttribute] - protected EventActionAttemptSimulateKeypadCodeEntrySucceeded() { } - - public EventActionAttemptSimulateKeypadCodeEntrySucceeded( - string actionAttemptId = default, - string actionType = default, - string? connectedAccountId = default, - string createdAt = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string status = default, - string workspaceId = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - Status = status; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string ActionAttemptId { get; set; } - - /// - /// Type of the action. - /// - [DataMember(Name = "action_type", IsRequired = false, EmitDefaultValue = false)] - public string ActionType { get; set; } - - /// - /// ID of the connected account associated with the action attempt, if applicable. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device associated with the action attempt, if applicable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = - "action_attempt.simulate_keypad_code_entry.succeeded"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Status of the action. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public string Status { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A simulate keypad code entry action attempt failed. - /// - [DataContract(Name = "seamModel_eventActionAttemptSimulateKeypadCodeEntryFailed_model")] - public class EventActionAttemptSimulateKeypadCodeEntryFailed : Event - { - [JsonConstructorAttribute] - protected EventActionAttemptSimulateKeypadCodeEntryFailed() { } - - public EventActionAttemptSimulateKeypadCodeEntryFailed( - string actionAttemptId = default, - string actionType = default, - string? connectedAccountId = default, - string createdAt = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string status = default, - string workspaceId = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - Status = status; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string ActionAttemptId { get; set; } - - /// - /// Type of the action. - /// - [DataMember(Name = "action_type", IsRequired = false, EmitDefaultValue = false)] - public string ActionType { get; set; } - - /// - /// ID of the connected account associated with the action attempt, if applicable. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device associated with the action attempt, if applicable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = - "action_attempt.simulate_keypad_code_entry.failed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Status of the action. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public string Status { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A simulate manual lock via keypad action attempt succeeded. - /// - [DataContract(Name = "seamModel_eventActionAttemptSimulateManualLockViaKeypadSucceeded_model")] - public class EventActionAttemptSimulateManualLockViaKeypadSucceeded : Event - { - [JsonConstructorAttribute] - protected EventActionAttemptSimulateManualLockViaKeypadSucceeded() { } - - public EventActionAttemptSimulateManualLockViaKeypadSucceeded( - string actionAttemptId = default, - string actionType = default, - string? connectedAccountId = default, - string createdAt = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string status = default, - string workspaceId = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - Status = status; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string ActionAttemptId { get; set; } - - /// - /// Type of the action. - /// - [DataMember(Name = "action_type", IsRequired = false, EmitDefaultValue = false)] - public string ActionType { get; set; } - - /// - /// ID of the connected account associated with the action attempt, if applicable. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device associated with the action attempt, if applicable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = - "action_attempt.simulate_manual_lock_via_keypad.succeeded"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Status of the action. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public string Status { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A simulate manual lock via keypad action attempt failed. - /// - [DataContract(Name = "seamModel_eventActionAttemptSimulateManualLockViaKeypadFailed_model")] - public class EventActionAttemptSimulateManualLockViaKeypadFailed : Event - { - [JsonConstructorAttribute] - protected EventActionAttemptSimulateManualLockViaKeypadFailed() { } - - public EventActionAttemptSimulateManualLockViaKeypadFailed( - string actionAttemptId = default, - string actionType = default, - string? connectedAccountId = default, - string createdAt = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string status = default, - string workspaceId = default - ) - { - ActionAttemptId = actionAttemptId; - ActionType = actionType; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - Status = status; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected action attempt. - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string ActionAttemptId { get; set; } - - /// - /// Type of the action. - /// - [DataMember(Name = "action_type", IsRequired = false, EmitDefaultValue = false)] - public string ActionType { get; set; } - - /// - /// ID of the connected account associated with the action attempt, if applicable. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device associated with the action attempt, if applicable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = - "action_attempt.simulate_manual_lock_via_keypad.failed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Status of the action. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public string Status { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A Connect Webview login succeeded. - /// - [DataContract(Name = "seamModel_eventConnectWebviewLoginSucceeded_model")] - public class EventConnectWebviewLoginSucceeded : Event - { - [JsonConstructorAttribute] - protected EventConnectWebviewLoginSucceeded() { } - - public EventConnectWebviewLoginSucceeded( - string connectWebviewId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectWebviewId = connectWebviewId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected Connect Webview. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectWebviewId { get; set; } - - /// - /// Custom metadata of the connected account; present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with this connect webview, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "connect_webview.login_succeeded"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A Connect Webview login failed. - /// - [DataContract(Name = "seamModel_eventConnectWebviewLoginFailed_model")] - public class EventConnectWebviewLoginFailed : Event - { - [JsonConstructorAttribute] - protected EventConnectWebviewLoginFailed() { } - - public EventConnectWebviewLoginFailed( - string connectWebviewId = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectWebviewId = connectWebviewId; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// ID of the affected Connect Webview. - /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectWebviewId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "connect_webview.login_failed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// The status of a device changed from offline to online. That is, the `device.properties.online` property changed from `false` to `true`. Note that some devices operate entirely in offline mode, so Seam never emits a `device.connected` event for these devices. - /// - [DataContract(Name = "seamModel_eventDeviceConnected_model")] - public class EventDeviceConnected : Event - { - [JsonConstructorAttribute] - protected EventDeviceConnected() { } - - public EventDeviceConnected( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.connected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A device was added to Seam or was re-added to Seam after having been removed. - /// - [DataContract(Name = "seamModel_eventDeviceAdded_model")] - public class EventDeviceAdded : Event - { - [JsonConstructorAttribute] - protected EventDeviceAdded() { } - - public EventDeviceAdded( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.added"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A managed device was successfully converted to an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - [DataContract(Name = "seamModel_eventDeviceConvertedToUnmanaged_model")] - public class EventDeviceConvertedToUnmanaged : Event - { - [JsonConstructorAttribute] - protected EventDeviceConvertedToUnmanaged() { } - - public EventDeviceConvertedToUnmanaged( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.converted_to_unmanaged"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices) was successfully converted to a managed device. - /// - [DataContract(Name = "seamModel_eventDeviceUnmanagedConvertedToManaged_model")] - public class EventDeviceUnmanagedConvertedToManaged : Event - { - [JsonConstructorAttribute] - protected EventDeviceUnmanagedConvertedToManaged() { } - - public EventDeviceUnmanagedConvertedToManaged( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.unmanaged.converted_to_managed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// The status of an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices) changed from offline to online. That is, the `device.properties.online` property changed from `false` to `true`. - /// - [DataContract(Name = "seamModel_eventDeviceUnmanagedConnected_model")] - public class EventDeviceUnmanagedConnected : Event - { - [JsonConstructorAttribute] - protected EventDeviceUnmanagedConnected() { } - - public EventDeviceUnmanagedConnected( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.unmanaged.connected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// The status of a device changed from online to offline. That is, the `device.properties.online` property changed from `true` to `false`. - /// - [DataContract(Name = "seamModel_eventDeviceDisconnected_model")] - public class EventDeviceDisconnected : Event - { - [JsonConstructorAttribute] - protected EventDeviceDisconnected() { } - - public EventDeviceDisconnected( - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - List deviceErrors = default, - string deviceId = default, - List deviceWarnings = default, - EventDeviceDisconnected.ErrorCodeEnum errorCode = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - ErrorCode = errorCode; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Error code associated with the disconnection event, if any. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ErrorCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "account_disconnected")] - AccountDisconnected = 1, - - [EnumMember(Value = "hub_disconnected")] - HubDisconnected = 2, - - [EnumMember(Value = "device_disconnected")] - DeviceDisconnected = 3, - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Error code associated with the disconnection event, if any. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public EventDeviceDisconnected.ErrorCodeEnum ErrorCode { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.disconnected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceDisconnectedConnectedAccountErrors_model")] - public class EventDeviceDisconnectedConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventDeviceDisconnectedConnectedAccountErrors() { } - - public EventDeviceDisconnectedConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceDisconnectedConnectedAccountWarnings_model")] - public class EventDeviceDisconnectedConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventDeviceDisconnectedConnectedAccountWarnings() { } - - public EventDeviceDisconnectedConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceDisconnectedDeviceErrors_model")] - public class EventDeviceDisconnectedDeviceErrors - { - [JsonConstructorAttribute] - protected EventDeviceDisconnectedDeviceErrors() { } - - public EventDeviceDisconnectedDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceDisconnectedDeviceWarnings_model")] - public class EventDeviceDisconnectedDeviceWarnings - { - [JsonConstructorAttribute] - protected EventDeviceDisconnectedDeviceWarnings() { } - - public EventDeviceDisconnectedDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// The status of an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices) changed from online to offline. That is, the `device.properties.online` property changed from `true` to `false`. - /// - [DataContract(Name = "seamModel_eventDeviceUnmanagedDisconnected_model")] - public class EventDeviceUnmanagedDisconnected : Event - { - [JsonConstructorAttribute] - protected EventDeviceUnmanagedDisconnected() { } - - public EventDeviceUnmanagedDisconnected( - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - List deviceErrors = default, - string deviceId = default, - List deviceWarnings = default, - EventDeviceUnmanagedDisconnected.ErrorCodeEnum errorCode = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - ErrorCode = errorCode; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Error code associated with the disconnection event, if any. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ErrorCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "account_disconnected")] - AccountDisconnected = 1, - - [EnumMember(Value = "hub_disconnected")] - HubDisconnected = 2, - - [EnumMember(Value = "device_disconnected")] - DeviceDisconnected = 3, - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Error code associated with the disconnection event, if any. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public EventDeviceUnmanagedDisconnected.ErrorCodeEnum ErrorCode { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.unmanaged.disconnected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceUnmanagedDisconnectedConnectedAccountErrors_model")] - public class EventDeviceUnmanagedDisconnectedConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventDeviceUnmanagedDisconnectedConnectedAccountErrors() { } - - public EventDeviceUnmanagedDisconnectedConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventDeviceUnmanagedDisconnectedConnectedAccountWarnings_model" - )] - public class EventDeviceUnmanagedDisconnectedConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventDeviceUnmanagedDisconnectedConnectedAccountWarnings() { } - - public EventDeviceUnmanagedDisconnectedConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceUnmanagedDisconnectedDeviceErrors_model")] - public class EventDeviceUnmanagedDisconnectedDeviceErrors - { - [JsonConstructorAttribute] - protected EventDeviceUnmanagedDisconnectedDeviceErrors() { } - - public EventDeviceUnmanagedDisconnectedDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceUnmanagedDisconnectedDeviceWarnings_model")] - public class EventDeviceUnmanagedDisconnectedDeviceWarnings - { - [JsonConstructorAttribute] - protected EventDeviceUnmanagedDisconnectedDeviceWarnings() { } - - public EventDeviceUnmanagedDisconnectedDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A device detected that it was tampered with, for example, opened or moved. - /// - [DataContract(Name = "seamModel_eventDeviceTampered_model")] - public class EventDeviceTampered : Event - { - [JsonConstructorAttribute] - protected EventDeviceTampered() { } - - public EventDeviceTampered( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.tampered"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A device battery level dropped below the low threshold. - /// - [DataContract(Name = "seamModel_eventDeviceLowBattery_model")] - public class EventDeviceLowBattery : Event - { - [JsonConstructorAttribute] - protected EventDeviceLowBattery() { } - - public EventDeviceLowBattery( - float batteryLevel = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - BatteryLevel = batteryLevel; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. - /// - [DataMember(Name = "battery_level", IsRequired = false, EmitDefaultValue = false)] - public float BatteryLevel { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.low_battery"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A device battery status changed since the last `battery_status_changed` event. - /// - [DataContract(Name = "seamModel_eventDeviceBatteryStatusChanged_model")] - public class EventDeviceBatteryStatusChanged : Event - { - [JsonConstructorAttribute] - protected EventDeviceBatteryStatusChanged() { } - - public EventDeviceBatteryStatusChanged( - float batteryLevel = default, - EventDeviceBatteryStatusChanged.BatteryStatusEnum batteryStatus = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - BatteryLevel = batteryLevel; - BatteryStatus = batteryStatus; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Battery status of the affected device, calculated from the numeric `battery_level` value. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum BatteryStatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "critical")] - Critical = 1, - - [EnumMember(Value = "low")] - Low = 2, - - [EnumMember(Value = "good")] - Good = 3, - - [EnumMember(Value = "full")] - Full = 4, - } - - /// - /// Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. - /// - [DataMember(Name = "battery_level", IsRequired = false, EmitDefaultValue = false)] - public float BatteryLevel { get; set; } - - /// - /// Battery status of the affected device, calculated from the numeric `battery_level` value. - /// - [DataMember(Name = "battery_status", IsRequired = false, EmitDefaultValue = false)] - public EventDeviceBatteryStatusChanged.BatteryStatusEnum BatteryStatus { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.battery_status_changed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A device was removed externally from the connected account. - /// - [DataContract(Name = "seamModel_eventDeviceRemoved_model")] - public class EventDeviceRemoved : Event - { - [JsonConstructorAttribute] - protected EventDeviceRemoved() { } - - public EventDeviceRemoved( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.removed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A device was deleted. - /// - [DataContract(Name = "seamModel_eventDeviceDeleted_model")] - public class EventDeviceDeleted : Event - { - [JsonConstructorAttribute] - protected EventDeviceDeleted() { } - - public EventDeviceDeleted( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? deviceName = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - DeviceName = deviceName; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Name of the deleted device, captured at deletion time. The device record no longer exists when this event fires, so the name is preserved here. Null when the device had no resolvable name. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceName { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Seam detected that a device is using a third-party integration that will interfere with Seam device management. - /// - [DataContract(Name = "seamModel_eventDeviceThirdPartyIntegrationDetected_model")] - public class EventDeviceThirdPartyIntegrationDetected : Event - { - [JsonConstructorAttribute] - protected EventDeviceThirdPartyIntegrationDetected() { } - - public EventDeviceThirdPartyIntegrationDetected( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.third_party_integration_detected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Seam detected that a device is no longer using a third-party integration that was interfering with Seam device management. - /// - [DataContract(Name = "seamModel_eventDeviceThirdPartyIntegrationNoLongerDetected_model")] - public class EventDeviceThirdPartyIntegrationNoLongerDetected : Event - { - [JsonConstructorAttribute] - protected EventDeviceThirdPartyIntegrationNoLongerDetected() { } - - public EventDeviceThirdPartyIntegrationNoLongerDetected( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = - "device.third_party_integration_no_longer_detected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [Salto device](https://docs.seam.co/device-and-system-integration-guides/salto-locks) activated privacy mode. - /// - [DataContract(Name = "seamModel_eventDeviceSaltoPrivacyModeActivated_model")] - public class EventDeviceSaltoPrivacyModeActivated : Event - { - [JsonConstructorAttribute] - protected EventDeviceSaltoPrivacyModeActivated() { } - - public EventDeviceSaltoPrivacyModeActivated( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.salto.privacy_mode_activated"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [Salto device](https://docs.seam.co/device-and-system-integration-guides/salto-locks) deactivated privacy mode. - /// - [DataContract(Name = "seamModel_eventDeviceSaltoPrivacyModeDeactivated_model")] - public class EventDeviceSaltoPrivacyModeDeactivated : Event - { - [JsonConstructorAttribute] - protected EventDeviceSaltoPrivacyModeDeactivated() { } - - public EventDeviceSaltoPrivacyModeDeactivated( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.salto.privacy_mode_deactivated"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Seam detected a flaky device connection. - /// - [DataContract(Name = "seamModel_eventDeviceConnectionBecameFlaky_model")] - public class EventDeviceConnectionBecameFlaky : Event - { - [JsonConstructorAttribute] - protected EventDeviceConnectionBecameFlaky() { } - - public EventDeviceConnectionBecameFlaky( - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - List deviceErrors = default, - string deviceId = default, - List deviceWarnings = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.connection_became_flaky"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceConnectionBecameFlakyConnectedAccountErrors_model")] - public class EventDeviceConnectionBecameFlakyConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventDeviceConnectionBecameFlakyConnectedAccountErrors() { } - - public EventDeviceConnectionBecameFlakyConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventDeviceConnectionBecameFlakyConnectedAccountWarnings_model" - )] - public class EventDeviceConnectionBecameFlakyConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventDeviceConnectionBecameFlakyConnectedAccountWarnings() { } - - public EventDeviceConnectionBecameFlakyConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceConnectionBecameFlakyDeviceErrors_model")] - public class EventDeviceConnectionBecameFlakyDeviceErrors - { - [JsonConstructorAttribute] - protected EventDeviceConnectionBecameFlakyDeviceErrors() { } - - public EventDeviceConnectionBecameFlakyDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceConnectionBecameFlakyDeviceWarnings_model")] - public class EventDeviceConnectionBecameFlakyDeviceWarnings - { - [JsonConstructorAttribute] - protected EventDeviceConnectionBecameFlakyDeviceWarnings() { } - - public EventDeviceConnectionBecameFlakyDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Seam detected that a previously-flaky device connection stabilized. - /// - [DataContract(Name = "seamModel_eventDeviceConnectionStabilized_model")] - public class EventDeviceConnectionStabilized : Event - { - [JsonConstructorAttribute] - protected EventDeviceConnectionStabilized() { } - - public EventDeviceConnectionStabilized( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.connection_stabilized"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A third-party subscription is required to use all device features. - /// - [DataContract(Name = "seamModel_eventDeviceErrorSubscriptionRequired_model")] - public class EventDeviceErrorSubscriptionRequired : Event - { - [JsonConstructorAttribute] - protected EventDeviceErrorSubscriptionRequired() { } - - public EventDeviceErrorSubscriptionRequired( - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - List deviceErrors = default, - string deviceId = default, - List deviceWarnings = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.error.subscription_required"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventDeviceErrorSubscriptionRequiredConnectedAccountErrors_model" - )] - public class EventDeviceErrorSubscriptionRequiredConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventDeviceErrorSubscriptionRequiredConnectedAccountErrors() { } - - public EventDeviceErrorSubscriptionRequiredConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventDeviceErrorSubscriptionRequiredConnectedAccountWarnings_model" - )] - public class EventDeviceErrorSubscriptionRequiredConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventDeviceErrorSubscriptionRequiredConnectedAccountWarnings() { } - - public EventDeviceErrorSubscriptionRequiredConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceErrorSubscriptionRequiredDeviceErrors_model")] - public class EventDeviceErrorSubscriptionRequiredDeviceErrors - { - [JsonConstructorAttribute] - protected EventDeviceErrorSubscriptionRequiredDeviceErrors() { } - - public EventDeviceErrorSubscriptionRequiredDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceErrorSubscriptionRequiredDeviceWarnings_model")] - public class EventDeviceErrorSubscriptionRequiredDeviceWarnings - { - [JsonConstructorAttribute] - protected EventDeviceErrorSubscriptionRequiredDeviceWarnings() { } - - public EventDeviceErrorSubscriptionRequiredDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A third-party subscription is active or no longer required to use all device features. - /// - [DataContract(Name = "seamModel_eventDeviceErrorSubscriptionRequiredResolved_model")] - public class EventDeviceErrorSubscriptionRequiredResolved : Event - { - [JsonConstructorAttribute] - protected EventDeviceErrorSubscriptionRequiredResolved() { } - - public EventDeviceErrorSubscriptionRequiredResolved( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.error.subscription_required.resolved"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An accessory keypad was connected to a device. - /// - [DataContract(Name = "seamModel_eventDeviceAccessoryKeypadConnected_model")] - public class EventDeviceAccessoryKeypadConnected : Event - { - [JsonConstructorAttribute] - protected EventDeviceAccessoryKeypadConnected() { } - - public EventDeviceAccessoryKeypadConnected( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.accessory_keypad_connected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// An accessory keypad was disconnected from a device. - /// - [DataContract(Name = "seamModel_eventDeviceAccessoryKeypadDisconnected_model")] - public class EventDeviceAccessoryKeypadDisconnected : Event - { - [JsonConstructorAttribute] - protected EventDeviceAccessoryKeypadDisconnected() { } - - public EventDeviceAccessoryKeypadDisconnected( - object? connectedAccountCustomMetadata = default, - List connectedAccountErrors = - default, - string connectedAccountId = default, - List connectedAccountWarnings = - default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - List deviceErrors = default, - string deviceId = default, - List deviceWarnings = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountErrors = connectedAccountErrors; - ConnectedAccountId = connectedAccountId; - ConnectedAccountWarnings = connectedAccountWarnings; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceErrors = deviceErrors; - DeviceId = deviceId; - DeviceWarnings = deviceWarnings; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// Errors associated with the connected account. - /// - [DataMember( - Name = "connected_account_errors", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountErrors { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Warnings associated with the connected account. - /// - [DataMember( - Name = "connected_account_warnings", - IsRequired = false, - EmitDefaultValue = false - )] - public List ConnectedAccountWarnings { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// Errors associated with the device. - /// - [DataMember(Name = "device_errors", IsRequired = false, EmitDefaultValue = false)] - public List DeviceErrors { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Warnings associated with the device. - /// - [DataMember(Name = "device_warnings", IsRequired = false, EmitDefaultValue = false)] - public List DeviceWarnings { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.accessory_keypad_disconnected"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventDeviceAccessoryKeypadDisconnectedConnectedAccountErrors_model" - )] - public class EventDeviceAccessoryKeypadDisconnectedConnectedAccountErrors - { - [JsonConstructorAttribute] - protected EventDeviceAccessoryKeypadDisconnectedConnectedAccountErrors() { } - - public EventDeviceAccessoryKeypadDisconnectedConnectedAccountErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_eventDeviceAccessoryKeypadDisconnectedConnectedAccountWarnings_model" - )] - public class EventDeviceAccessoryKeypadDisconnectedConnectedAccountWarnings - { - [JsonConstructorAttribute] - protected EventDeviceAccessoryKeypadDisconnectedConnectedAccountWarnings() { } - - public EventDeviceAccessoryKeypadDisconnectedConnectedAccountWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceAccessoryKeypadDisconnectedDeviceErrors_model")] - public class EventDeviceAccessoryKeypadDisconnectedDeviceErrors - { - [JsonConstructorAttribute] - protected EventDeviceAccessoryKeypadDisconnectedDeviceErrors() { } - - public EventDeviceAccessoryKeypadDisconnectedDeviceErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventDeviceAccessoryKeypadDisconnectedDeviceWarnings_model")] - public class EventDeviceAccessoryKeypadDisconnectedDeviceWarnings - { - [JsonConstructorAttribute] - protected EventDeviceAccessoryKeypadDisconnectedDeviceWarnings() { } - - public EventDeviceAccessoryKeypadDisconnectedDeviceWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Extended periods of noise or noise exceeding a [threshold](https://docs.seam.co/capability-guides/noise-sensors#what-is-a-threshold) were detected. - /// - [DataContract(Name = "seamModel_eventNoiseSensorNoiseThresholdTriggered_model")] - public class EventNoiseSensorNoiseThresholdTriggered : Event - { - [JsonConstructorAttribute] - protected EventNoiseSensorNoiseThresholdTriggered() { } - - public EventNoiseSensorNoiseThresholdTriggered( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - object? minutMetadata = default, - float? noiseLevelDecibels = default, - float? noiseLevelNrs = default, - string? noiseThresholdId = default, - string? noiseThresholdName = default, - object? noiseawareMetadata = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - MinutMetadata = minutMetadata; - NoiseLevelDecibels = noiseLevelDecibels; - NoiseLevelNrs = noiseLevelNrs; - NoiseThresholdId = noiseThresholdId; - NoiseThresholdName = noiseThresholdName; - NoiseawareMetadata = noiseawareMetadata; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "noise_sensor.noise_threshold_triggered"; - - /// - /// Metadata from Minut. - /// - [DataMember(Name = "minut_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? MinutMetadata { get; set; } - - /// - /// Detected noise level in decibels. - /// - [DataMember(Name = "noise_level_decibels", IsRequired = false, EmitDefaultValue = false)] - public float? NoiseLevelDecibels { get; set; } - - /// - /// Detected noise level in Noiseaware Noise Risk Score (NRS). - /// - [DataMember(Name = "noise_level_nrs", IsRequired = false, EmitDefaultValue = false)] - public float? NoiseLevelNrs { get; set; } - - /// - /// ID of the noise threshold that was triggered. - /// - [DataMember(Name = "noise_threshold_id", IsRequired = false, EmitDefaultValue = false)] - public string? NoiseThresholdId { get; set; } - - /// - /// Name of the noise threshold that was triggered. - /// - [DataMember(Name = "noise_threshold_name", IsRequired = false, EmitDefaultValue = false)] - public string? NoiseThresholdName { get; set; } - - /// - /// Metadata from Noiseaware. - /// - [DataMember(Name = "noiseaware_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? NoiseawareMetadata { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [lock](https://docs.seam.co/low-level-apis/smart-locks) was locked. - /// - [DataContract(Name = "seamModel_eventLockLocked_model")] - public class EventLockLocked : Event - { - [JsonConstructorAttribute] - protected EventLockLocked() { } - - public EventLockLocked( - string? accessCodeId = default, - bool? accessCodeIsManaged = default, - string? actionAttemptId = default, - string? code = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - bool? isViaBluetooth = default, - bool? isViaNfc = default, - EventLockLocked.MethodEnum method = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - AccessCodeIsManaged = accessCodeIsManaged; - ActionAttemptId = actionAttemptId; - Code = code; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - IsViaBluetooth = isViaBluetooth; - IsViaNfc = isViaNfc; - Method = method; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Method by which the lock was locked. `keycode`: an access code was used (see `access_code_id`). `manual`: a physical action such as a thumbturn or button press. `remote`: a remote action via an app, Bluetooth, or the Seam API (see `action_attempt_id` if Seam-initiated; see `is_via_bluetooth` or `is_via_nfc` for the transport). `automatic`: triggered automatically, for example by an auto-relock timer. `unknown`: could not be determined. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum MethodEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "keycode")] - Keycode = 1, - - [EnumMember(Value = "manual")] - Manual = 2, - - [EnumMember(Value = "automatic")] - Automatic = 3, - - [EnumMember(Value = "unknown")] - Unknown = 4, - - [EnumMember(Value = "remote")] - Remote = 5, - - [EnumMember(Value = "card")] - Card = 6, - } - - /// - /// ID of the access code that was used to lock the device. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessCodeId { get; set; } - - /// - /// Whether the access code is managed by Seam (true) or unmanaged (false). Only present when access_code_id is set. - /// - [DataMember(Name = "access_code_is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool? AccessCodeIsManaged { get; set; } - - /// - /// ID of the Seam action attempt that triggered this lock. Present only when the lock was initiated through Seam (via a `LOCK_DOOR` action attempt). - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string? ActionAttemptId { get; set; } - - /// - /// Code (PIN) that was used to lock the device, if known. Taken from the matched managed or unmanaged access code, or from the code reported by the provider when no access code matched. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "lock.locked"; - - /// - /// Whether the lock action was performed over Bluetooth by a remote client (such as the provider's mobile app), rather than a direct physical interaction or a Seam-initiated remote action. - /// - [DataMember(Name = "is_via_bluetooth", IsRequired = false, EmitDefaultValue = false)] - public bool? IsViaBluetooth { get; set; } - - /// - /// Whether the lock action was performed by an NFC credential tap (such as an Apple Home Key or an NFC key fob) presented to the lock, rather than a direct physical interaction or a Seam-initiated remote action. - /// - [DataMember(Name = "is_via_nfc", IsRequired = false, EmitDefaultValue = false)] - public bool? IsViaNfc { get; set; } - - /// - /// Method by which the lock was locked. `keycode`: an access code was used (see `access_code_id`). `manual`: a physical action such as a thumbturn or button press. `remote`: a remote action via an app, Bluetooth, or the Seam API (see `action_attempt_id` if Seam-initiated; see `is_via_bluetooth` or `is_via_nfc` for the transport). `automatic`: triggered automatically, for example by an auto-relock timer. `unknown`: could not be determined. - /// - [DataMember(Name = "method", IsRequired = false, EmitDefaultValue = false)] - public EventLockLocked.MethodEnum Method { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [lock](https://docs.seam.co/low-level-apis/smart-locks) was unlocked. - /// - [DataContract(Name = "seamModel_eventLockUnlocked_model")] - public class EventLockUnlocked : Event - { - [JsonConstructorAttribute] - protected EventLockUnlocked() { } - - public EventLockUnlocked( - string? accessCodeId = default, - bool? accessCodeIsManaged = default, - string? actionAttemptId = default, - string? code = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - bool? isViaBluetooth = default, - bool? isViaNfc = default, - EventLockUnlocked.MethodEnum method = default, - string occurredAt = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - AccessCodeIsManaged = accessCodeIsManaged; - ActionAttemptId = actionAttemptId; - Code = code; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - IsViaBluetooth = isViaBluetooth; - IsViaNfc = isViaNfc; - Method = method; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Method by which the lock was unlocked. `keycode`: an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was used (see `access_code_id`). `manual`: a physical action such as a thumbturn or handle press. `remote`: a remote action via an app, Bluetooth, or the Seam API (see `action_attempt_id` if Seam-initiated; see `is_via_bluetooth` or `is_via_nfc` for the transport). `automatic`: triggered automatically, for example by a time-based schedule. `unknown`: could not be determined. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum MethodEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "keycode")] - Keycode = 1, - - [EnumMember(Value = "manual")] - Manual = 2, - - [EnumMember(Value = "automatic")] - Automatic = 3, - - [EnumMember(Value = "unknown")] - Unknown = 4, - - [EnumMember(Value = "remote")] - Remote = 5, - - [EnumMember(Value = "card")] - Card = 6, - } - - /// - /// ID of the access code that was used to unlock the affected device. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessCodeId { get; set; } - - /// - /// Whether the access code is managed by Seam (true) or unmanaged (false). Only present when access_code_id is set. - /// - [DataMember(Name = "access_code_is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool? AccessCodeIsManaged { get; set; } - - /// - /// ID of the Seam action attempt that triggered this unlock. Present only when the unlock was initiated through Seam (via an `UNLOCK_DOOR` action attempt). - /// - [DataMember(Name = "action_attempt_id", IsRequired = false, EmitDefaultValue = false)] - public string? ActionAttemptId { get; set; } - - /// - /// Code (PIN) that was used to unlock the affected device, if known. Taken from the matched managed or unmanaged access code, or from the code reported by the provider when no access code matched. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "lock.unlocked"; - - /// - /// Whether the unlock action was performed over Bluetooth by a remote client (such as the provider's mobile app), rather than a direct physical interaction or a Seam-initiated remote action. - /// - [DataMember(Name = "is_via_bluetooth", IsRequired = false, EmitDefaultValue = false)] - public bool? IsViaBluetooth { get; set; } - - /// - /// Whether the unlock action was performed by an NFC credential tap (such as an Apple Home Key or an NFC key fob) presented to the lock, rather than a direct physical interaction or a Seam-initiated remote action. - /// - [DataMember(Name = "is_via_nfc", IsRequired = false, EmitDefaultValue = false)] - public bool? IsViaNfc { get; set; } - - /// - /// Method by which the lock was unlocked. `keycode`: an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was used (see `access_code_id`). `manual`: a physical action such as a thumbturn or handle press. `remote`: a remote action via an app, Bluetooth, or the Seam API (see `action_attempt_id` if Seam-initiated; see `is_via_bluetooth` or `is_via_nfc` for the transport). `automatic`: triggered automatically, for example by a time-based schedule. `unknown`: could not be determined. - /// - [DataMember(Name = "method", IsRequired = false, EmitDefaultValue = false)] - public EventLockUnlocked.MethodEnum Method { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// The [lock](https://docs.seam.co/low-level-apis/smart-locks) denied access to a user after one or more consecutive invalid attempts to unlock the device. - /// - [DataContract(Name = "seamModel_eventLockAccessDenied_model")] - public class EventLockAccessDenied : Event - { - [JsonConstructorAttribute] - protected EventLockAccessDenied() { } - - public EventLockAccessDenied( - string? accessCodeId = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string? deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - EventLockAccessDeniedReason? reason = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - Reason = reason; - WorkspaceId = workspaceId; - } - - /// - /// ID of the access code that was used in the unlock attempts. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessCodeId { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "lock.access_denied"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Why access was denied, when the provider reports a determinable cause. Omitted when unknown. - /// - [DataMember(Name = "reason", IsRequired = false, EmitDefaultValue = false)] - public EventLockAccessDeniedReason? Reason { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventLockAccessDeniedReason_model")] - public class EventLockAccessDeniedReason - { - [JsonConstructorAttribute] - protected EventLockAccessDeniedReason() { } - - public EventLockAccessDeniedReason( - string message = default, - EventLockAccessDeniedReason.ReasonCodeEnum reasonCode = default - ) - { - Message = message; - ReasonCode = reasonCode; - } - - /// - /// Normalized reason a lock denied access. Provider-agnostic; not all providers report every value. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ReasonCodeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "unknown_code")] - UnknownCode = 1, - - [EnumMember(Value = "expired_code")] - ExpiredCode = 2, - - [EnumMember(Value = "blocklisted_code")] - BlocklistedCode = 3, - - [EnumMember(Value = "too_many_attempts")] - TooManyAttempts = 4, - - [EnumMember(Value = "blocked_by_privacy_mode")] - BlockedByPrivacyMode = 5, - - [EnumMember(Value = "credential_error")] - CredentialError = 6, - } - - /// - /// Human-readable explanation of why access was denied. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Normalized reason a lock denied access. Provider-agnostic; not all providers report every value. - /// - [DataMember(Name = "reason_code", IsRequired = false, EmitDefaultValue = false)] - public EventLockAccessDeniedReason.ReasonCodeEnum ReasonCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A thermostat [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) was activated. - /// - [DataContract(Name = "seamModel_eventThermostatClimatePresetActivated_model")] - public class EventThermostatClimatePresetActivated : Event - { - [JsonConstructorAttribute] - protected EventThermostatClimatePresetActivated() { } - - public EventThermostatClimatePresetActivated( - string climatePresetKey = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - bool isFallbackClimatePreset = default, - string occurredAt = default, - string? thermostatScheduleId = default, - string workspaceId = default - ) - { - ClimatePresetKey = climatePresetKey; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - IsFallbackClimatePreset = isFallbackClimatePreset; - OccurredAt = occurredAt; - ThermostatScheduleId = thermostatScheduleId; - WorkspaceId = workspaceId; - } - - /// - /// Key of the climate preset that was activated. - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "thermostat.climate_preset_activated"; - - /// - /// Indicates whether the climate preset that was activated is the fallback climate preset for the thermostat. - /// - [DataMember( - Name = "is_fallback_climate_preset", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsFallbackClimatePreset { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the thermostat schedule that prompted the affected climate preset to be activated. - /// - [DataMember(Name = "thermostat_schedule_id", IsRequired = false, EmitDefaultValue = false)] - public string? ThermostatScheduleId { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [thermostat](https://docs.seam.co/capability-guides/thermostats) was adjusted manually. - /// - [DataContract(Name = "seamModel_eventThermostatManuallyAdjusted_model")] - public class EventThermostatManuallyAdjusted : Event - { - [JsonConstructorAttribute] - protected EventThermostatManuallyAdjusted() { } - - public EventThermostatManuallyAdjusted( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - float? coolingSetPointCelsius = default, - float? coolingSetPointFahrenheit = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - EventThermostatManuallyAdjusted.FanModeSettingEnum? fanModeSetting = default, - float? heatingSetPointCelsius = default, - float? heatingSetPointFahrenheit = default, - EventThermostatManuallyAdjusted.HvacModeSettingEnum? hvacModeSetting = default, - EventThermostatManuallyAdjusted.MethodEnum method = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CoolingSetPointCelsius = coolingSetPointCelsius; - CoolingSetPointFahrenheit = coolingSetPointFahrenheit; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - FanModeSetting = fanModeSetting; - HeatingSetPointCelsius = heatingSetPointCelsius; - HeatingSetPointFahrenheit = heatingSetPointFahrenheit; - HvacModeSetting = hvacModeSetting; - Method = method; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum FanModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "auto")] - Auto = 1, - - [EnumMember(Value = "on")] - On = 2, - - [EnumMember(Value = "circulate")] - Circulate = 3, - } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum HvacModeSettingEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "off")] - Off = 1, - - [EnumMember(Value = "heat")] - Heat = 2, - - [EnumMember(Value = "cool")] - Cool = 3, - - [EnumMember(Value = "heat_cool")] - HeatCool = 4, - - [EnumMember(Value = "eco")] - Eco = 5, - } - - /// - /// Method used to adjust the affected thermostat manually. `seam` indicates that the Seam API, Seam CLI, or Seam Console was used to adjust the thermostat. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum MethodEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "seam")] - Seam = 1, - - [EnumMember(Value = "external")] - External = 2, - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "cooling_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? CoolingSetPointFahrenheit { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "thermostat.manually_adjusted"; - - /// - /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. - /// - [DataMember(Name = "fan_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public EventThermostatManuallyAdjusted.FanModeSettingEnum? FanModeSetting { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointCelsius { get; set; } - - /// - /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataMember( - Name = "heating_set_point_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? HeatingSetPointFahrenheit { get; set; } - - /// - /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - /// - [DataMember(Name = "hvac_mode_setting", IsRequired = false, EmitDefaultValue = false)] - public EventThermostatManuallyAdjusted.HvacModeSettingEnum? HvacModeSetting { get; set; } - - /// - /// Method used to adjust the affected thermostat manually. `seam` indicates that the Seam API, Seam CLI, or Seam Console was used to adjust the thermostat. - /// - [DataMember(Name = "method", IsRequired = false, EmitDefaultValue = false)] - public EventThermostatManuallyAdjusted.MethodEnum Method { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [thermostat's](https://docs.seam.co/capability-guides/thermostats) temperature reading exceeded the set [threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds). - /// - [DataContract(Name = "seamModel_eventThermostatTemperatureThresholdExceeded_model")] - public class EventThermostatTemperatureThresholdExceeded : Event - { - [JsonConstructorAttribute] - protected EventThermostatTemperatureThresholdExceeded() { } - - public EventThermostatTemperatureThresholdExceeded( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - float? lowerLimitCelsius = default, - float? lowerLimitFahrenheit = default, - string occurredAt = default, - float temperatureCelsius = default, - float temperatureFahrenheit = default, - float? upperLimitCelsius = default, - float? upperLimitFahrenheit = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - LowerLimitCelsius = lowerLimitCelsius; - LowerLimitFahrenheit = lowerLimitFahrenheit; - OccurredAt = occurredAt; - TemperatureCelsius = temperatureCelsius; - TemperatureFahrenheit = temperatureFahrenheit; - UpperLimitCelsius = upperLimitCelsius; - UpperLimitFahrenheit = upperLimitFahrenheit; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "thermostat.temperature_threshold_exceeded"; - - /// - /// Lower temperature limit, in °C, defined by the set threshold. - /// - [DataMember(Name = "lower_limit_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? LowerLimitCelsius { get; set; } - - /// - /// Lower temperature limit, in °F, defined by the set threshold. - /// - [DataMember(Name = "lower_limit_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float? LowerLimitFahrenheit { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Temperature, in °C, reported by the affected thermostat. - /// - [DataMember(Name = "temperature_celsius", IsRequired = false, EmitDefaultValue = false)] - public float TemperatureCelsius { get; set; } - - /// - /// Temperature, in °F, reported by the affected thermostat. - /// - [DataMember(Name = "temperature_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float TemperatureFahrenheit { get; set; } - - /// - /// Upper temperature limit, in °C, defined by the set threshold. - /// - [DataMember(Name = "upper_limit_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? UpperLimitCelsius { get; set; } - - /// - /// Upper temperature limit, in °F, defined by the set threshold. - /// - [DataMember(Name = "upper_limit_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float? UpperLimitFahrenheit { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [thermostat's](https://docs.seam.co/capability-guides/thermostats) temperature reading no longer exceeds the set [threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds). - /// - [DataContract(Name = "seamModel_eventThermostatTemperatureThresholdNoLongerExceeded_model")] - public class EventThermostatTemperatureThresholdNoLongerExceeded : Event - { - [JsonConstructorAttribute] - protected EventThermostatTemperatureThresholdNoLongerExceeded() { } - - public EventThermostatTemperatureThresholdNoLongerExceeded( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - float? lowerLimitCelsius = default, - float? lowerLimitFahrenheit = default, - string occurredAt = default, - float temperatureCelsius = default, - float temperatureFahrenheit = default, - float? upperLimitCelsius = default, - float? upperLimitFahrenheit = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - LowerLimitCelsius = lowerLimitCelsius; - LowerLimitFahrenheit = lowerLimitFahrenheit; - OccurredAt = occurredAt; - TemperatureCelsius = temperatureCelsius; - TemperatureFahrenheit = temperatureFahrenheit; - UpperLimitCelsius = upperLimitCelsius; - UpperLimitFahrenheit = upperLimitFahrenheit; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = - "thermostat.temperature_threshold_no_longer_exceeded"; - - /// - /// Lower temperature limit, in °C, defined by the set threshold. - /// - [DataMember(Name = "lower_limit_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? LowerLimitCelsius { get; set; } - - /// - /// Lower temperature limit, in °F, defined by the set threshold. - /// - [DataMember(Name = "lower_limit_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float? LowerLimitFahrenheit { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Temperature, in °C, reported by the affected thermostat. - /// - [DataMember(Name = "temperature_celsius", IsRequired = false, EmitDefaultValue = false)] - public float TemperatureCelsius { get; set; } - - /// - /// Temperature, in °F, reported by the affected thermostat. - /// - [DataMember(Name = "temperature_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float TemperatureFahrenheit { get; set; } - - /// - /// Upper temperature limit, in °C, defined by the set threshold. - /// - [DataMember(Name = "upper_limit_celsius", IsRequired = false, EmitDefaultValue = false)] - public float? UpperLimitCelsius { get; set; } - - /// - /// Upper temperature limit, in °F, defined by the set threshold. - /// - [DataMember(Name = "upper_limit_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float? UpperLimitFahrenheit { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [thermostat's](https://docs.seam.co/capability-guides/thermostats) temperature reading is within 1 °C of the configured cooling or heating [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). - /// - [DataContract(Name = "seamModel_eventThermostatTemperatureReachedSetPoint_model")] - public class EventThermostatTemperatureReachedSetPoint : Event - { - [JsonConstructorAttribute] - protected EventThermostatTemperatureReachedSetPoint() { } - - public EventThermostatTemperatureReachedSetPoint( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - float? desiredTemperatureCelsius = default, - float? desiredTemperatureFahrenheit = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - float temperatureCelsius = default, - float temperatureFahrenheit = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DesiredTemperatureCelsius = desiredTemperatureCelsius; - DesiredTemperatureFahrenheit = desiredTemperatureFahrenheit; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - TemperatureCelsius = temperatureCelsius; - TemperatureFahrenheit = temperatureFahrenheit; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Desired temperature, in °C, defined by the affected thermostat's cooling or heating set point. - /// - [DataMember( - Name = "desired_temperature_celsius", - IsRequired = false, - EmitDefaultValue = false - )] - public float? DesiredTemperatureCelsius { get; set; } - - /// - /// Desired temperature, in °F, defined by the affected thermostat's cooling or heating set point. - /// - [DataMember( - Name = "desired_temperature_fahrenheit", - IsRequired = false, - EmitDefaultValue = false - )] - public float? DesiredTemperatureFahrenheit { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "thermostat.temperature_reached_set_point"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Temperature, in °C, reported by the affected thermostat. - /// - [DataMember(Name = "temperature_celsius", IsRequired = false, EmitDefaultValue = false)] - public float TemperatureCelsius { get; set; } - - /// - /// Temperature, in °F, reported by the affected thermostat. - /// - [DataMember(Name = "temperature_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float TemperatureFahrenheit { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A [thermostat's](https://docs.seam.co/capability-guides/thermostats) reported temperature changed by at least 1 °C. - /// - [DataContract(Name = "seamModel_eventThermostatTemperatureChanged_model")] - public class EventThermostatTemperatureChanged : Event - { - [JsonConstructorAttribute] - protected EventThermostatTemperatureChanged() { } - - public EventThermostatTemperatureChanged( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - float temperatureCelsius = default, - float temperatureFahrenheit = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - TemperatureCelsius = temperatureCelsius; - TemperatureFahrenheit = temperatureFahrenheit; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "thermostat.temperature_changed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// Temperature, in °C, reported by the affected thermostat. - /// - [DataMember(Name = "temperature_celsius", IsRequired = false, EmitDefaultValue = false)] - public float TemperatureCelsius { get; set; } - - /// - /// Temperature, in °F, reported by the affected thermostat. - /// - [DataMember(Name = "temperature_fahrenheit", IsRequired = false, EmitDefaultValue = false)] - public float TemperatureFahrenheit { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// The name of a device was changed. - /// - [DataContract(Name = "seamModel_eventDeviceNameChanged_model")] - public class EventDeviceNameChanged : Event - { - [JsonConstructorAttribute] - protected EventDeviceNameChanged() { } - - public EventDeviceNameChanged( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string deviceName = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - DeviceName = deviceName; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// The new name of the affected device. - /// - [DataMember(Name = "device_name", IsRequired = false, EmitDefaultValue = false)] - public string DeviceName { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.name_changed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A camera was activated, for example, by motion detection. - /// - [DataContract(Name = "seamModel_eventCameraActivated_model")] - public class EventCameraActivated : Event - { - [JsonConstructorAttribute] - protected EventCameraActivated() { } - - public EventCameraActivated( - EventCameraActivated.ActivationReasonEnum activationReason = default, - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string? imageUrl = default, - EventCameraActivated.MotionSubTypeEnum? motionSubType = default, - string occurredAt = default, - string? videoUrl = default, - string workspaceId = default - ) - { - ActivationReason = activationReason; - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - ImageUrl = imageUrl; - MotionSubType = motionSubType; - OccurredAt = occurredAt; - VideoUrl = videoUrl; - WorkspaceId = workspaceId; - } - - /// - /// The reason the camera was activated. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ActivationReasonEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "motion_detected")] - MotionDetected = 1, - } - - /// - /// Sub-type of motion detected, if available. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum MotionSubTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "human")] - Human = 1, - - [EnumMember(Value = "vehicle")] - Vehicle = 2, - - [EnumMember(Value = "package")] - Package = 3, - - [EnumMember(Value = "other")] - Other = 4, - } - - /// - /// The reason the camera was activated. - /// - [DataMember(Name = "activation_reason", IsRequired = false, EmitDefaultValue = false)] - public EventCameraActivated.ActivationReasonEnum ActivationReason { get; set; } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "camera.activated"; - - /// - /// URL to a thumbnail image captured at the time of activation. - /// - [DataMember(Name = "image_url", IsRequired = false, EmitDefaultValue = false)] - public string? ImageUrl { get; set; } - - /// - /// Sub-type of motion detected, if available. - /// - [DataMember(Name = "motion_sub_type", IsRequired = false, EmitDefaultValue = false)] - public EventCameraActivated.MotionSubTypeEnum? MotionSubType { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// URL to a short video clip captured at the time of activation. - /// - [DataMember(Name = "video_url", IsRequired = false, EmitDefaultValue = false)] - public string? VideoUrl { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A doorbell button was pressed on a device. - /// - [DataContract(Name = "seamModel_eventDeviceDoorbellRang_model")] - public class EventDeviceDoorbellRang : Event - { - [JsonConstructorAttribute] - protected EventDeviceDoorbellRang() { } - - public EventDeviceDoorbellRang( - object? connectedAccountCustomMetadata = default, - string connectedAccountId = default, - string createdAt = default, - string? customerKey = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string? imageUrl = default, - string occurredAt = default, - string? videoUrl = default, - string workspaceId = default - ) - { - ConnectedAccountCustomMetadata = connectedAccountCustomMetadata; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomerKey = customerKey; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - ImageUrl = imageUrl; - OccurredAt = occurredAt; - VideoUrl = videoUrl; - WorkspaceId = workspaceId; - } - - /// - /// Custom metadata of the connected account, present when connected_account_id is provided. - /// - [DataMember( - Name = "connected_account_custom_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ConnectedAccountCustomMetadata { get; set; } - - /// - /// ID of the connected account associated with the event. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// The customer key associated with the device, if any. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Custom metadata of the device, present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "device.doorbell_rang"; - - /// - /// URL to a thumbnail image captured at the time the doorbell was pressed. - /// - [DataMember(Name = "image_url", IsRequired = false, EmitDefaultValue = false)] - public string? ImageUrl { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// URL to a short video clip captured at the time the doorbell was pressed. - /// - [DataMember(Name = "video_url", IsRequired = false, EmitDefaultValue = false)] - public string? VideoUrl { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A phone device was deactivated. - /// - [DataContract(Name = "seamModel_eventPhoneDeactivated_model")] - public class EventPhoneDeactivated : Event - { - [JsonConstructorAttribute] - protected EventPhoneDeactivated() { } - - public EventPhoneDeactivated( - string createdAt = default, - object? deviceCustomMetadata = default, - string deviceId = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string workspaceId = default - ) - { - CreatedAt = createdAt; - DeviceCustomMetadata = deviceCustomMetadata; - DeviceId = deviceId; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Custom metadata of the device; present when device_id is provided. - /// - [DataMember(Name = "device_custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? DeviceCustomMetadata { get; set; } - - /// - /// ID of the affected phone device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "phone.deactivated"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A device was added or removed from a space. - /// - [DataContract(Name = "seamModel_eventSpaceDeviceMembershipChanged_model")] - public class EventSpaceDeviceMembershipChanged : Event - { - [JsonConstructorAttribute] - protected EventSpaceDeviceMembershipChanged() { } - - public EventSpaceDeviceMembershipChanged( - List acsEntranceIds = default, - string createdAt = default, - List deviceIds = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string spaceId = default, - string? spaceKey = default, - string workspaceId = default - ) - { - AcsEntranceIds = acsEntranceIds; - CreatedAt = createdAt; - DeviceIds = deviceIds; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - SpaceId = spaceId; - SpaceKey = spaceKey; - WorkspaceId = workspaceId; - } - - /// - /// IDs of all ACS entrances currently attached to the space. - /// - [DataMember(Name = "acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List AcsEntranceIds { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// IDs of all devices currently attached to the space. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "space.device_membership_changed"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the affected space. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - /// - /// Unique key for the space within the workspace. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A space was created. - /// - [DataContract(Name = "seamModel_eventSpaceCreated_model")] - public class EventSpaceCreated : Event - { - [JsonConstructorAttribute] - protected EventSpaceCreated() { } - - public EventSpaceCreated( - List acsEntranceIds = default, - string createdAt = default, - List deviceIds = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string spaceId = default, - string? spaceKey = default, - string workspaceId = default - ) - { - AcsEntranceIds = acsEntranceIds; - CreatedAt = createdAt; - DeviceIds = deviceIds; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - SpaceId = spaceId; - SpaceKey = spaceKey; - WorkspaceId = workspaceId; - } - - /// - /// IDs of all ACS entrances attached to the space when it was created. - /// - [DataMember(Name = "acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List AcsEntranceIds { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// IDs of all devices attached to the space when it was created. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "space.created"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the affected space. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - /// - /// Unique key for the space within the workspace. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// A space was deleted. - /// - [DataContract(Name = "seamModel_eventSpaceDeleted_model")] - public class EventSpaceDeleted : Event - { - [JsonConstructorAttribute] - protected EventSpaceDeleted() { } - - public EventSpaceDeleted( - List acsEntranceIds = default, - string createdAt = default, - List deviceIds = default, - string? eventDescription = default, - string eventId = default, - string eventType = default, - string occurredAt = default, - string spaceId = default, - string? spaceKey = default, - string workspaceId = default - ) - { - AcsEntranceIds = acsEntranceIds; - CreatedAt = createdAt; - DeviceIds = deviceIds; - EventDescription = eventDescription; - EventId = eventId; - EventType = eventType; - OccurredAt = occurredAt; - SpaceId = spaceId; - SpaceKey = spaceKey; - WorkspaceId = workspaceId; - } - - /// - /// IDs of all ACS entrances currently attached to the space when it was deleted. - /// - [DataMember(Name = "acs_entrance_ids", IsRequired = false, EmitDefaultValue = false)] - public List AcsEntranceIds { get; set; } - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// IDs of all devices attached to the space when it was deleted. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "space.deleted"; - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the affected space. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - /// - /// Unique key for the space within the workspace. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_eventUnrecognized_model")] - public class EventUnrecognized : Event - { - [JsonConstructorAttribute] - protected EventUnrecognized() { } - - public EventUnrecognized( - string eventType = default, - string createdAt = default, - string? eventDescription = default, - string eventId = default, - string occurredAt = default, - string workspaceId = default - ) - { - EventType = eventType; - CreatedAt = createdAt; - EventDescription = eventDescription; - EventId = eventId; - OccurredAt = occurredAt; - WorkspaceId = workspaceId; - } - - [DataMember(Name = "event_type", IsRequired = true, EmitDefaultValue = false)] - public override string EventType { get; } = "unrecognized"; - - /// - /// Date and time at which the event was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. - /// - [DataMember(Name = "event_description", IsRequired = false, EmitDefaultValue = false)] - public override string? EventDescription { get; set; } - - /// - /// ID of the event. - /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public override string EventId { get; set; } - - /// - /// Date and time at which the event occurred. - /// - [DataMember(Name = "occurred_at", IsRequired = false, EmitDefaultValue = false)] - public override string OccurredAt { get; set; } - - /// - /// ID of the workspace associated with the event. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public override string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/InstantKey.cs b/src/Seam/Model/InstantKey.cs deleted file mode 100644 index 030b9b52..00000000 --- a/src/Seam/Model/InstantKey.cs +++ /dev/null @@ -1,177 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a Seam Instant Key. For issuing Bluetooth mobile keys, Instant Keys are the fastest way to share access. With a single API call, you can create a mobile key and send it through text or email or embed it in your own app. - /// - /// There’s no app to install, nor account to create. Your user just taps a link and gets a lightweight, native-feeling experience using iOS App Clip or Instant Apps on Android. Further, Instant Keys work offline, so even in areas with poor cellular or Wi-Fi, like elevator banks or concrete-walled hallways, the Instant Keys still work. - /// - [DataContract(Name = "seamModel_instantKey_model")] - public class InstantKey - { - [JsonConstructorAttribute] - protected InstantKey() { } - - public InstantKey( - string clientSessionId = default, - string createdAt = default, - InstantKeyCustomization? customization = default, - string? customizationProfileId = default, - string expiresAt = default, - string instantKeyId = default, - string instantKeyUrl = default, - string userIdentityId = default, - string workspaceId = default - ) - { - ClientSessionId = clientSessionId; - CreatedAt = createdAt; - Customization = customization; - CustomizationProfileId = customizationProfileId; - ExpiresAt = expiresAt; - InstantKeyId = instantKeyId; - InstantKeyUrl = instantKeyUrl; - UserIdentityId = userIdentityId; - WorkspaceId = workspaceId; - } - - /// - /// ID of the client session associated with the Instant Key. - /// - [DataMember(Name = "client_session_id", IsRequired = false, EmitDefaultValue = false)] - public string ClientSessionId { get; set; } - - /// - /// Date and time at which the Instant Key was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Customization applied to the Instant Key UI. - /// - [DataMember(Name = "customization", IsRequired = false, EmitDefaultValue = false)] - public InstantKeyCustomization? Customization { get; set; } - - /// - /// ID of the customization profile associated with the Instant Key. - /// - [DataMember( - Name = "customization_profile_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomizationProfileId { get; set; } - - /// - /// Date and time at which the Instant Key expires. - /// - [DataMember(Name = "expires_at", IsRequired = false, EmitDefaultValue = false)] - public string ExpiresAt { get; set; } - - /// - /// ID of the Instant Key. - /// - [DataMember(Name = "instant_key_id", IsRequired = false, EmitDefaultValue = false)] - public string InstantKeyId { get; set; } - - /// - /// Shareable URL for the Instant Key. Use the URL to deliver the Instant Key to your user through a link in a text message or email or by embedding it in your web app. - /// - [DataMember(Name = "instant_key_url", IsRequired = false, EmitDefaultValue = false)] - public string InstantKeyUrl { get; set; } - - /// - /// ID of the user identity associated with the Instant Key. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - /// - /// ID of the workspace that contains the Instant Key. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_instantKeyCustomization_model")] - public class InstantKeyCustomization - { - [JsonConstructorAttribute] - protected InstantKeyCustomization() { } - - public InstantKeyCustomization( - string? logoUrl = default, - string? primaryColor = default, - string? secondaryColor = default - ) - { - LogoUrl = logoUrl; - PrimaryColor = primaryColor; - SecondaryColor = secondaryColor; - } - - /// - /// URL of the logo displayed on the Instant Key. - /// - [DataMember(Name = "logo_url", IsRequired = false, EmitDefaultValue = false)] - public string? LogoUrl { get; set; } - - /// - /// Primary color used in the Instant Key UI. - /// - [DataMember(Name = "primary_color", IsRequired = false, EmitDefaultValue = false)] - public string? PrimaryColor { get; set; } - - /// - /// Secondary color used in the Instant Key UI. - /// - [DataMember(Name = "secondary_color", IsRequired = false, EmitDefaultValue = false)] - public string? SecondaryColor { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/NoiseThreshold.cs b/src/Seam/Model/NoiseThreshold.cs deleted file mode 100644 index 4f00ab63..00000000 --- a/src/Seam/Model/NoiseThreshold.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. - /// - [DataContract(Name = "seamModel_noiseThreshold_model")] - public class NoiseThreshold - { - [JsonConstructorAttribute] - protected NoiseThreshold() { } - - public NoiseThreshold( - string deviceId = default, - string endsDailyAt = default, - string name = default, - float noiseThresholdDecibels = default, - string noiseThresholdId = default, - float? noiseThresholdNrs = default, - string startsDailyAt = default - ) - { - DeviceId = deviceId; - EndsDailyAt = endsDailyAt; - Name = name; - NoiseThresholdDecibels = noiseThresholdDecibels; - NoiseThresholdId = noiseThresholdId; - NoiseThresholdNrs = noiseThresholdNrs; - StartsDailyAt = startsDailyAt; - } - - /// - /// Unique identifier for the device that contains the noise threshold. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Time at which the noise threshold should become inactive daily. - /// - [DataMember(Name = "ends_daily_at", IsRequired = false, EmitDefaultValue = false)] - public string EndsDailyAt { get; set; } - - /// - /// Name of the noise threshold. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Noise level in decibels for the noise threshold. - /// - [DataMember( - Name = "noise_threshold_decibels", - IsRequired = false, - EmitDefaultValue = false - )] - public float NoiseThresholdDecibels { get; set; } - - /// - /// Unique identifier for the noise threshold. - /// - [DataMember(Name = "noise_threshold_id", IsRequired = false, EmitDefaultValue = false)] - public string NoiseThresholdId { get; set; } - - /// - /// Noise level in Noiseaware Noise Risk Score (NRS) for the noise threshold. This parameter is only relevant for [Noiseaware sensors](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors). - /// - [DataMember(Name = "noise_threshold_nrs", IsRequired = false, EmitDefaultValue = false)] - public float? NoiseThresholdNrs { get; set; } - - /// - /// Time at which the noise threshold should become active daily. - /// - [DataMember(Name = "starts_daily_at", IsRequired = false, EmitDefaultValue = false)] - public string StartsDailyAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/Phone.cs b/src/Seam/Model/Phone.cs deleted file mode 100644 index 751ec03e..00000000 --- a/src/Seam/Model/Phone.cs +++ /dev/null @@ -1,440 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an app user's mobile phone. - /// - [DataContract(Name = "seamModel_phone_model")] - public class Phone - { - [JsonConstructorAttribute] - protected Phone() { } - - public Phone( - string createdAt = default, - object customMetadata = default, - string deviceId = default, - Phone.DeviceTypeEnum deviceType = default, - string displayName = default, - List errors = default, - string? nickname = default, - PhoneProperties properties = default, - List warnings = default, - string workspaceId = default - ) - { - CreatedAt = createdAt; - CustomMetadata = customMetadata; - DeviceId = deviceId; - DeviceType = deviceType; - DisplayName = displayName; - Errors = errors; - Nickname = nickname; - Properties = properties; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - /// - /// Type of the phone device, such as `ios_phone` or `android_phone`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "ios_phone")] - IosPhone = 1, - - [EnumMember(Value = "android_phone")] - AndroidPhone = 2, - } - - /// - /// Date and time at which the phone was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Optional [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for the phone. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object CustomMetadata { get; set; } - - /// - /// ID of the phone. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Type of the phone device, such as `ios_phone` or `android_phone`. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public Phone.DeviceTypeEnum DeviceType { get; set; } - - /// - /// Display name of the phone. Defaults to `nickname` (if it is set) or `properties.appearance.name`, otherwise. Enables administrators and users to identify the phone easily, especially when there are numerous phones. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Errors associated with the phone. - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Optional nickname to describe the phone, settable through Seam. - /// - [DataMember(Name = "nickname", IsRequired = false, EmitDefaultValue = false)] - public string? Nickname { get; set; } - - /// - /// Properties of the phone. - /// - [DataMember(Name = "properties", IsRequired = false, EmitDefaultValue = false)] - public PhoneProperties Properties { get; set; } - - /// - /// Warnings associated with the phone. - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the phone. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_phoneErrors_model")] - public class PhoneErrors - { - [JsonConstructorAttribute] - protected PhoneErrors() { } - - public PhoneErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_phoneProperties_model")] - public class PhoneProperties - { - [JsonConstructorAttribute] - protected PhoneProperties() { } - - public PhoneProperties( - PhonePropertiesAssaAbloyCredentialServiceMetadata? assaAbloyCredentialServiceMetadata = - default, - PhonePropertiesSaltoSpaceCredentialServiceMetadata? saltoSpaceCredentialServiceMetadata = - default - ) - { - AssaAbloyCredentialServiceMetadata = assaAbloyCredentialServiceMetadata; - SaltoSpaceCredentialServiceMetadata = saltoSpaceCredentialServiceMetadata; - } - - /// - /// ASSA ABLOY Credential Service metadata for the phone. - /// - [DataMember( - Name = "assa_abloy_credential_service_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public PhonePropertiesAssaAbloyCredentialServiceMetadata? AssaAbloyCredentialServiceMetadata { get; set; } - - /// - /// Salto Space credential service metadata for the phone. - /// - [DataMember( - Name = "salto_space_credential_service_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public PhonePropertiesSaltoSpaceCredentialServiceMetadata? SaltoSpaceCredentialServiceMetadata { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_phonePropertiesAssaAbloyCredentialServiceMetadata_model")] - public class PhonePropertiesAssaAbloyCredentialServiceMetadata - { - [JsonConstructorAttribute] - protected PhonePropertiesAssaAbloyCredentialServiceMetadata() { } - - public PhonePropertiesAssaAbloyCredentialServiceMetadata( - List? endpoints = default, - bool? hasActiveEndpoint = default - ) - { - Endpoints = endpoints; - HasActiveEndpoint = hasActiveEndpoint; - } - - /// - /// Endpoints associated with the phone. - /// - [DataMember(Name = "endpoints", IsRequired = false, EmitDefaultValue = false)] - public List? Endpoints { get; set; } - - /// - /// Indicates whether the credential service has active endpoints associated with the phone. - /// - [DataMember(Name = "has_active_endpoint", IsRequired = false, EmitDefaultValue = false)] - public bool? HasActiveEndpoint { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_phonePropertiesAssaAbloyCredentialServiceMetadataEndpoints_model" - )] - public class PhonePropertiesAssaAbloyCredentialServiceMetadataEndpoints - { - [JsonConstructorAttribute] - protected PhonePropertiesAssaAbloyCredentialServiceMetadataEndpoints() { } - - public PhonePropertiesAssaAbloyCredentialServiceMetadataEndpoints( - string? endpointId = default, - bool? isActive = default - ) - { - EndpointId = endpointId; - IsActive = isActive; - } - - /// - /// ID of the associated endpoint. - /// - [DataMember(Name = "endpoint_id", IsRequired = false, EmitDefaultValue = false)] - public string? EndpointId { get; set; } - - /// - /// Indicated whether the endpoint is active. - /// - [DataMember(Name = "is_active", IsRequired = false, EmitDefaultValue = false)] - public bool? IsActive { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_phonePropertiesSaltoSpaceCredentialServiceMetadata_model")] - public class PhonePropertiesSaltoSpaceCredentialServiceMetadata - { - [JsonConstructorAttribute] - protected PhonePropertiesSaltoSpaceCredentialServiceMetadata() { } - - public PhonePropertiesSaltoSpaceCredentialServiceMetadata(bool? hasActivePhone = default) - { - HasActivePhone = hasActivePhone; - } - - /// - /// Indicates whether the credential service has an active associated phone. - /// - [DataMember(Name = "has_active_phone", IsRequired = false, EmitDefaultValue = false)] - public bool? HasActivePhone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_phoneWarnings_model")] - public class PhoneWarnings - { - [JsonConstructorAttribute] - protected PhoneWarnings() { } - - public PhoneWarnings( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - /// - /// Unique identifier of the type of warning. - /// - [DataMember(Name = "warning_code", IsRequired = false, EmitDefaultValue = false)] - public string WarningCode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/SafeStringEnumConverter.cs b/src/Seam/Model/SafeStringEnumConverter.cs deleted file mode 100644 index 48c4a524..00000000 --- a/src/Seam/Model/SafeStringEnumConverter.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Seam.Model -{ - public class SafeStringEnumConverter : StringEnumConverter - { - public override object ReadJson( - JsonReader reader, - Type objectType, - object existingValue, - JsonSerializer serializer - ) - { - try - { - return base.ReadJson(reader, objectType, existingValue, serializer); - } - catch (JsonSerializationException) - { - // If the enum value can't be parsed, return the first enum value (0) - // which should be "Unrecognized" in our enums - return Activator.CreateInstance(objectType); - } - } - } -} diff --git a/src/Seam/Model/Space.cs b/src/Seam/Model/Space.cs deleted file mode 100644 index ef105583..00000000 --- a/src/Seam/Model/Space.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a space that is a logical grouping of devices and entrances. You can assign access to an entire space, thereby making granting access more efficient. - /// - [DataContract(Name = "seamModel_space_model")] - public class Space - { - [JsonConstructorAttribute] - protected Space() { } - - public Space( - float acsEntranceCount = default, - string createdAt = default, - SpaceCustomerData? customerData = default, - string? customerKey = default, - float deviceCount = default, - string displayName = default, - SpaceGeolocation? geolocation = default, - string name = default, - string spaceId = default, - string? spaceKey = default, - string workspaceId = default - ) - { - AcsEntranceCount = acsEntranceCount; - CreatedAt = createdAt; - CustomerData = customerData; - CustomerKey = customerKey; - DeviceCount = deviceCount; - DisplayName = displayName; - Geolocation = geolocation; - Name = name; - SpaceId = spaceId; - SpaceKey = spaceKey; - WorkspaceId = workspaceId; - } - - /// - /// Number of entrances in the space. - /// - [DataMember(Name = "acs_entrance_count", IsRequired = false, EmitDefaultValue = false)] - public float AcsEntranceCount { get; set; } - - /// - /// Date and time at which the space was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Reservation/stay-related defaults for the space. Also carries the provider/PMS-supplied name under a `<connector_type>_name` key (e.g. `guesty_name`), which Seam preserves when you rename the space (read-only — managed by Seam). - /// - [DataMember(Name = "customer_data", IsRequired = false, EmitDefaultValue = false)] - public SpaceCustomerData? CustomerData { get; set; } - - /// - /// Customer key associated with the space. - /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } - - /// - /// Number of devices in the space. - /// - [DataMember(Name = "device_count", IsRequired = false, EmitDefaultValue = false)] - public float DeviceCount { get; set; } - - /// - /// Display name for the space. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Geographic coordinates (latitude and longitude) of the space. - /// - [DataMember(Name = "geolocation", IsRequired = false, EmitDefaultValue = false)] - public SpaceGeolocation? Geolocation { get; set; } - - /// - /// Name of the space. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// ID of the space. - /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string SpaceId { get; set; } - - /// - /// Unique key for the space within the workspace. - /// - [DataMember(Name = "space_key", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceKey { get; set; } - - /// - /// ID of the workspace associated with the space. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_spaceCustomerData_model")] - public class SpaceCustomerData - { - [JsonConstructorAttribute] - protected SpaceCustomerData() { } - - public SpaceCustomerData( - string? address = default, - string? defaultCheckinTime = default, - string? defaultCheckoutTime = default, - string? timeZone = default - ) - { - Address = address; - DefaultCheckinTime = defaultCheckinTime; - DefaultCheckoutTime = defaultCheckoutTime; - TimeZone = timeZone; - } - - /// - /// Postal address for the space. - /// - [DataMember(Name = "address", IsRequired = false, EmitDefaultValue = false)] - public string? Address { get; set; } - - /// - /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember(Name = "default_checkin_time", IsRequired = false, EmitDefaultValue = false)] - public string? DefaultCheckinTime { get; set; } - - /// - /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. - /// - [DataMember(Name = "default_checkout_time", IsRequired = false, EmitDefaultValue = false)] - public string? DefaultCheckoutTime { get; set; } - - /// - /// IANA time zone for the space, e.g. America/Los_Angeles. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_spaceGeolocation_model")] - public class SpaceGeolocation - { - [JsonConstructorAttribute] - protected SpaceGeolocation() { } - - public SpaceGeolocation(float latitude = default, float longitude = default) - { - Latitude = latitude; - Longitude = longitude; - } - - /// - /// Latitude of the space, in decimal degrees. - /// - [DataMember(Name = "latitude", IsRequired = false, EmitDefaultValue = false)] - public float Latitude { get; set; } - - /// - /// Longitude of the space, in decimal degrees. - /// - [DataMember(Name = "longitude", IsRequired = false, EmitDefaultValue = false)] - public float Longitude { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/ThermostatDailyProgram.cs b/src/Seam/Model/ThermostatDailyProgram.cs deleted file mode 100644 index 3430f044..00000000 --- a/src/Seam/Model/ThermostatDailyProgram.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a thermostat daily program, consisting of a set of periods, each of which has a starting time and the key that identifies the climate preset to apply at the starting time. - /// - [DataContract(Name = "seamModel_thermostatDailyProgram_model")] - public class ThermostatDailyProgram - { - [JsonConstructorAttribute] - protected ThermostatDailyProgram() { } - - public ThermostatDailyProgram( - string createdAt = default, - string deviceId = default, - string? name = default, - List periods = default, - string thermostatDailyProgramId = default, - string workspaceId = default - ) - { - CreatedAt = createdAt; - DeviceId = deviceId; - Name = name; - Periods = periods; - ThermostatDailyProgramId = thermostatDailyProgramId; - WorkspaceId = workspaceId; - } - - /// - /// Date and time at which the thermostat daily program was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// ID of the thermostat device on which the thermostat daily program is configured. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// User-friendly name to identify the thermostat daily program. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Array of thermostat daily program periods. - /// - [DataMember(Name = "periods", IsRequired = false, EmitDefaultValue = false)] - public List Periods { get; set; } - - /// - /// ID of the thermostat daily program. - /// - [DataMember( - Name = "thermostat_daily_program_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string ThermostatDailyProgramId { get; set; } - - /// - /// ID of the workspace that contains the thermostat daily program. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_thermostatDailyProgramPeriods_model")] - public class ThermostatDailyProgramPeriods - { - [JsonConstructorAttribute] - protected ThermostatDailyProgramPeriods() { } - - public ThermostatDailyProgramPeriods( - string climatePresetKey = default, - string startsAtTime = default - ) - { - ClimatePresetKey = climatePresetKey; - StartsAtTime = startsAtTime; - } - - /// - /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to activate at the `starts_at_time`. - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// Time at which the thermostat daily program period starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at_time", IsRequired = false, EmitDefaultValue = false)] - public string StartsAtTime { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/ThermostatSchedule.cs b/src/Seam/Model/ThermostatSchedule.cs deleted file mode 100644 index 71eba887..00000000 --- a/src/Seam/Model/ThermostatSchedule.cs +++ /dev/null @@ -1,191 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) that activates a configured [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) on a [thermostat](https://docs.seam.co/capability-guides/thermostats) at a specified starting time and deactivates the climate preset at a specified ending time. - /// - [DataContract(Name = "seamModel_thermostatSchedule_model")] - public class ThermostatSchedule - { - [JsonConstructorAttribute] - protected ThermostatSchedule() { } - - public ThermostatSchedule( - string climatePresetKey = default, - string createdAt = default, - string deviceId = default, - string endsAt = default, - List errors = default, - bool? isOverrideAllowed = default, - int? maxOverridePeriodMinutes = default, - string? name = default, - string startsAt = default, - string thermostatScheduleId = default, - string workspaceId = default - ) - { - ClimatePresetKey = climatePresetKey; - CreatedAt = createdAt; - DeviceId = deviceId; - EndsAt = endsAt; - Errors = errors; - IsOverrideAllowed = isOverrideAllowed; - MaxOverridePeriodMinutes = maxOverridePeriodMinutes; - Name = name; - StartsAt = startsAt; - ThermostatScheduleId = thermostatScheduleId; - WorkspaceId = workspaceId; - } - - /// - /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [DataMember(Name = "climate_preset_key", IsRequired = false, EmitDefaultValue = false)] - public string ClimatePresetKey { get; set; } - - /// - /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// ID of the desired [thermostat](https://docs.seam.co/capability-guides/thermostats) device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string EndsAt { get; set; } - - /// - /// Errors associated with the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Indicates whether a person at the thermostat can change the thermostat's settings after the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts. - /// - [DataMember(Name = "is_override_allowed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOverrideAllowed { get; set; } - - /// - /// Number of minutes for which a person at the thermostat can change the thermostat's settings after the activation of the scheduled [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). - /// - [DataMember( - Name = "max_override_period_minutes", - IsRequired = false, - EmitDefaultValue = false - )] - public int? MaxOverridePeriodMinutes { get; set; } - - /// - /// User-friendly name to identify the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string StartsAt { get; set; } - - /// - /// ID of the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). - /// - [DataMember(Name = "thermostat_schedule_id", IsRequired = false, EmitDefaultValue = false)] - public string ThermostatScheduleId { get; set; } - - /// - /// ID of the workspace that contains the thermostat schedule. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_thermostatScheduleErrors_model")] - public class ThermostatScheduleErrors - { - [JsonConstructorAttribute] - protected ThermostatScheduleErrors() { } - - public ThermostatScheduleErrors( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/UnmanagedAccessCode.cs b/src/Seam/Model/UnmanagedAccessCode.cs deleted file mode 100644 index 06d086c7..00000000 --- a/src/Seam/Model/UnmanagedAccessCode.cs +++ /dev/null @@ -1,3106 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an [unmanaged smart lock access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). - /// - /// An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. - /// - /// When you create an access code on a device in Seam, it is created as a managed access code. Access codes that exist on a device that were not created through Seam are considered unmanaged codes. We strictly limit the operations that can be performed on unmanaged codes. - /// - /// Prior to using Seam to manage your devices, you may have used another lock management system to manage the access codes on your devices. Where possible, we help you keep any existing access codes on devices and transition those codes to ones managed by your Seam workspace. - /// - /// Not all providers support unmanaged access codes. The following providers do not support unmanaged access codes: - /// - /// - [Kwikset](https://docs.seam.co/device-and-system-integration-guides/kwikset-locks) - /// - [DataContract(Name = "seamModel_unmanagedAccessCode_model")] - public class UnmanagedAccessCode - { - [JsonConstructorAttribute] - protected UnmanagedAccessCode() { } - - public UnmanagedAccessCode( - string accessCodeId = default, - bool? cannotBeManaged = default, - bool? cannotDeleteUnmanagedAccessCode = default, - string? code = default, - string createdAt = default, - string deviceId = default, - UnmanagedAccessCodeDormakabaOracodeMetadata? dormakabaOracodeMetadata = default, - string? endsAt = default, - List errors = default, - bool isManaged = default, - string? name = default, - string? startsAt = default, - UnmanagedAccessCode.StatusEnum status = default, - UnmanagedAccessCode.TypeEnum type = default, - List warnings = default, - string workspaceId = default - ) - { - AccessCodeId = accessCodeId; - CannotBeManaged = cannotBeManaged; - CannotDeleteUnmanagedAccessCode = cannotDeleteUnmanagedAccessCode; - Code = code; - CreatedAt = createdAt; - DeviceId = deviceId; - DormakabaOracodeMetadata = dormakabaOracodeMetadata; - EndsAt = endsAt; - Errors = errors; - IsManaged = isManaged; - Name = name; - StartsAt = startsAt; - Status = status; - Type = type; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedAccessCodeErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsBridgeDisconnected), - "bridge_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsSubscriptionRequired), - "subscription_required" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsAuxiliaryHeatRunning), - "auxiliary_heat_running" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsMissingDeviceCredentials), - "missing_device_credentials" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsAugustLockNotAuthorized), - "august_lock_not_authorized" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsEmptyBackupAccessCodePool), - "empty_backup_access_code_pool" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsDeviceDisconnected), - "device_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsHubDisconnected), - "hub_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsDeviceRemoved), - "device_removed" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsDeviceOffline), - "device_offline" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsDormakabaSitesDisconnected), - "dormakaba_sites_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsInsufficientPermissions), - "insufficient_permissions" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsSaltoKsSubscriptionLimitExceeded), - "salto_ks_subscription_limit_exceeded" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsAccountDisconnected), - "account_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsFailedToExpire), - "failed_to_expire" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsFailedToApplyMutations), - "failed_to_apply_mutations" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsFailedToIssue), - "failed_to_issue" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsCodeConstraintsViolated), - "code_constraints_violated" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsAccessCodeInactive), - "access_code_inactive" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsConflictingExternalModification), - "conflicting_external_modification" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsNoSpaceForAccessCodeOnDevice), - "no_space_for_access_code_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsDuplicateCodeOnDevice), - "duplicate_code_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsFailedToRemoveFromDevice), - "failed_to_remove_from_device" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsFailedToSetOnDevice), - "failed_to_set_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeErrorsProviderIssue), - "provider_issue" - )] - public abstract class UnmanagedAccessCodeErrors - { - public abstract string ErrorCode { get; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsProviderIssue_model")] - public class UnmanagedAccessCodeErrorsProviderIssue : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsProviderIssue() { } - - public UnmanagedAccessCodeErrorsProviderIssue( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "provider_issue"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsFailedToSetOnDevice_model")] - public class UnmanagedAccessCodeErrorsFailedToSetOnDevice : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsFailedToSetOnDevice() { } - - public UnmanagedAccessCodeErrorsFailedToSetOnDevice( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_set_on_device"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsFailedToRemoveFromDevice_model")] - public class UnmanagedAccessCodeErrorsFailedToRemoveFromDevice : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsFailedToRemoveFromDevice() { } - - public UnmanagedAccessCodeErrorsFailedToRemoveFromDevice( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_remove_from_device"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsDuplicateCodeOnDevice_model")] - public class UnmanagedAccessCodeErrorsDuplicateCodeOnDevice : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsDuplicateCodeOnDevice() { } - - public UnmanagedAccessCodeErrorsDuplicateCodeOnDevice( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string? managedAccessCodeId = default, - string message = default, - string? unmanagedAccessCodeId = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - ManagedAccessCodeId = managedAccessCodeId; - Message = message; - UnmanagedAccessCodeId = unmanagedAccessCodeId; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "duplicate_code_on_device"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// ID of the managed access code that conflicts with this managed access code, when Seam can identify it. - /// - [DataMember( - Name = "managed_access_code_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ManagedAccessCodeId { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// ID of the unmanaged access code that conflicts with this managed access code, when Seam can identify it. - /// - [DataMember( - Name = "unmanaged_access_code_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? UnmanagedAccessCodeId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeErrorsNoSpaceForAccessCodeOnDevice_model" - )] - public class UnmanagedAccessCodeErrorsNoSpaceForAccessCodeOnDevice - : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsNoSpaceForAccessCodeOnDevice() { } - - public UnmanagedAccessCodeErrorsNoSpaceForAccessCodeOnDevice( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "no_space_for_access_code_on_device"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeErrorsConflictingExternalModification_model" - )] - public class UnmanagedAccessCodeErrorsConflictingExternalModification - : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsConflictingExternalModification() { } - - public UnmanagedAccessCodeErrorsConflictingExternalModification( - UnmanagedAccessCodeErrorsConflictingExternalModification.ChangeTypeEnum? changeType = - default, - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default, - List? modifiedFields = - default - ) - { - ChangeType = changeType; - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - ModifiedFields = modifiedFields; - } - - /// - /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ChangeTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "modified")] - Modified = 1, - - [EnumMember(Value = "removed")] - Removed = 2, - } - - /// - /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. - /// - [DataMember(Name = "change_type", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessCodeErrorsConflictingExternalModification.ChangeTypeEnum? ChangeType { get; set; } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "conflicting_external_modification"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// List of fields that were changed externally, with their previous and new values. - /// - [DataMember(Name = "modified_fields", IsRequired = false, EmitDefaultValue = false)] - public List? ModifiedFields { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeErrorsConflictingExternalModificationModifiedFields_model" - )] - public class UnmanagedAccessCodeErrorsConflictingExternalModificationModifiedFields - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsConflictingExternalModificationModifiedFields() { } - - public UnmanagedAccessCodeErrorsConflictingExternalModificationModifiedFields( - string field = default, - string? from = default, - string? to = default - ) - { - Field = field; - From = from; - To = to; - } - - /// - /// The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). - /// - [DataMember(Name = "field", IsRequired = false, EmitDefaultValue = false)] - public string Field { get; set; } - - /// - /// The previous value of the field. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public string? From { get; set; } - - /// - /// The new value of the field. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public string? To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsAccessCodeInactive_model")] - public class UnmanagedAccessCodeErrorsAccessCodeInactive : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsAccessCodeInactive() { } - - public UnmanagedAccessCodeErrorsAccessCodeInactive( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "access_code_inactive"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsCodeConstraintsViolated_model")] - public class UnmanagedAccessCodeErrorsCodeConstraintsViolated : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsCodeConstraintsViolated() { } - - public UnmanagedAccessCodeErrorsCodeConstraintsViolated( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "code_constraints_violated"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsFailedToIssue_model")] - public class UnmanagedAccessCodeErrorsFailedToIssue : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsFailedToIssue() { } - - public UnmanagedAccessCodeErrorsFailedToIssue( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_issue"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsFailedToApplyMutations_model")] - public class UnmanagedAccessCodeErrorsFailedToApplyMutations : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsFailedToApplyMutations() { } - - public UnmanagedAccessCodeErrorsFailedToApplyMutations( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_apply_mutations"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsFailedToExpire_model")] - public class UnmanagedAccessCodeErrorsFailedToExpire : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsFailedToExpire() { } - - public UnmanagedAccessCodeErrorsFailedToExpire( - string? createdAt = default, - string errorCode = default, - bool isAccessCodeError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsAccessCodeError = isAccessCodeError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_expire"; - - /// - /// Indicates that this is an access code error. - /// - [DataMember( - Name = "is_access_code_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsAccessCodeError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsAccountDisconnected_model")] - public class UnmanagedAccessCodeErrorsAccountDisconnected : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsAccountDisconnected() { } - - public UnmanagedAccessCodeErrorsAccountDisconnected( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "account_disconnected"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeErrorsSaltoKsSubscriptionLimitExceeded_model" - )] - public class UnmanagedAccessCodeErrorsSaltoKsSubscriptionLimitExceeded - : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsSaltoKsSubscriptionLimitExceeded() { } - - public UnmanagedAccessCodeErrorsSaltoKsSubscriptionLimitExceeded( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsInsufficientPermissions_model")] - public class UnmanagedAccessCodeErrorsInsufficientPermissions : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsInsufficientPermissions() { } - - public UnmanagedAccessCodeErrorsInsufficientPermissions( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "insufficient_permissions"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsDormakabaSitesDisconnected_model")] - public class UnmanagedAccessCodeErrorsDormakabaSitesDisconnected : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsDormakabaSitesDisconnected() { } - - public UnmanagedAccessCodeErrorsDormakabaSitesDisconnected( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsDeviceOffline_model")] - public class UnmanagedAccessCodeErrorsDeviceOffline : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsDeviceOffline() { } - - public UnmanagedAccessCodeErrorsDeviceOffline( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_offline"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsDeviceRemoved_model")] - public class UnmanagedAccessCodeErrorsDeviceRemoved : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsDeviceRemoved() { } - - public UnmanagedAccessCodeErrorsDeviceRemoved( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_removed"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsHubDisconnected_model")] - public class UnmanagedAccessCodeErrorsHubDisconnected : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsHubDisconnected() { } - - public UnmanagedAccessCodeErrorsHubDisconnected( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "hub_disconnected"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsDeviceDisconnected_model")] - public class UnmanagedAccessCodeErrorsDeviceDisconnected : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsDeviceDisconnected() { } - - public UnmanagedAccessCodeErrorsDeviceDisconnected( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_disconnected"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsEmptyBackupAccessCodePool_model")] - public class UnmanagedAccessCodeErrorsEmptyBackupAccessCodePool : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsEmptyBackupAccessCodePool() { } - - public UnmanagedAccessCodeErrorsEmptyBackupAccessCodePool( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "empty_backup_access_code_pool"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsAugustLockNotAuthorized_model")] - public class UnmanagedAccessCodeErrorsAugustLockNotAuthorized : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsAugustLockNotAuthorized() { } - - public UnmanagedAccessCodeErrorsAugustLockNotAuthorized( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "august_lock_not_authorized"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsMissingDeviceCredentials_model")] - public class UnmanagedAccessCodeErrorsMissingDeviceCredentials : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsMissingDeviceCredentials() { } - - public UnmanagedAccessCodeErrorsMissingDeviceCredentials( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "missing_device_credentials"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsAuxiliaryHeatRunning_model")] - public class UnmanagedAccessCodeErrorsAuxiliaryHeatRunning : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsAuxiliaryHeatRunning() { } - - public UnmanagedAccessCodeErrorsAuxiliaryHeatRunning( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "auxiliary_heat_running"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsSubscriptionRequired_model")] - public class UnmanagedAccessCodeErrorsSubscriptionRequired : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsSubscriptionRequired() { } - - public UnmanagedAccessCodeErrorsSubscriptionRequired( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "subscription_required"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsBridgeDisconnected_model")] - public class UnmanagedAccessCodeErrorsBridgeDisconnected : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsBridgeDisconnected() { } - - public UnmanagedAccessCodeErrorsBridgeDisconnected( - string createdAt = default, - string errorCode = default, - bool? isBridgeError = default, - bool? isConnectedAccountError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsBridgeError = isBridgeError; - IsConnectedAccountError = isConnectedAccountError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "bridge_disconnected"; - - /// - /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public bool? IsBridgeError { get; set; } - - /// - /// Indicates whether the error is related specifically to the connected account. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsConnectedAccountError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeErrorsUnrecognized_model")] - public class UnmanagedAccessCodeErrorsUnrecognized : UnmanagedAccessCodeErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeErrorsUnrecognized() { } - - public UnmanagedAccessCodeErrorsUnrecognized( - string errorCode = default, - string message = default - ) - { - ErrorCode = errorCode; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Current status of the access code within the operational lifecycle. `set` indicates that the code is active and operational. `unset` indicates that the code exists on the provider but is not usable on the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "set")] - Set = 1, - - [EnumMember(Value = "unset")] - Unset = 2, - } - - /// - /// Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum TypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "time_bound")] - TimeBound = 1, - - [EnumMember(Value = "ongoing")] - Ongoing = 2, - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedAccessCodeWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsUnknownIssueWithAccessCode), - "unknown_issue_with_access_code" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsBeingDeleted), - "being_deleted" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsUsingBackupAccessCode), - "using_backup_access_code" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsManagementTransferred), - "management_transferred" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours), - "igloo_algopin_must_be_used_within_24_hours" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsThirdPartyIntegrationDetected), - "third_party_integration_detected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsDelayInApplyingMutations), - "delay_in_applying_mutations" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsDelayInIssuing), - "delay_in_issuing" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsDelayInRemovingFromDevice), - "delay_in_removing_from_device" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsDelayInSettingOnDevice), - "delay_in_setting_on_device" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsExternalModificationInEffect), - "external_modification_in_effect" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone), - "time_frame_adjusted_for_unknown_time_zone" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessCodeWarningsCodeRotatesPeriodically), - "code_rotates_periodically" - )] - public abstract class UnmanagedAccessCodeWarnings - { - public abstract string WarningCode { get; } - - public abstract string? CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeWarningsCodeRotatesPeriodically_model")] - public class UnmanagedAccessCodeWarningsCodeRotatesPeriodically - : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsCodeRotatesPeriodically() { } - - public UnmanagedAccessCodeWarningsCodeRotatesPeriodically( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "code_rotates_periodically"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone_model" - )] - public class UnmanagedAccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone - : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone() { } - - public UnmanagedAccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "time_frame_adjusted_for_unknown_time_zone"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeWarningsExternalModificationInEffect_model" - )] - public class UnmanagedAccessCodeWarningsExternalModificationInEffect - : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsExternalModificationInEffect() { } - - public UnmanagedAccessCodeWarningsExternalModificationInEffect( - UnmanagedAccessCodeWarningsExternalModificationInEffect.ChangeTypeEnum? changeType = - default, - string? createdAt = default, - string message = default, - List? modifiedFields = - default, - string warningCode = default - ) - { - ChangeType = changeType; - CreatedAt = createdAt; - Message = message; - ModifiedFields = modifiedFields; - WarningCode = warningCode; - } - - /// - /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ChangeTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "modified")] - Modified = 1, - - [EnumMember(Value = "removed")] - Removed = 2, - } - - /// - /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. - /// - [DataMember(Name = "change_type", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessCodeWarningsExternalModificationInEffect.ChangeTypeEnum? ChangeType { get; set; } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// List of fields that were changed externally, with their previous and new values. - /// - [DataMember(Name = "modified_fields", IsRequired = false, EmitDefaultValue = false)] - public List? ModifiedFields { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "external_modification_in_effect"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeWarningsExternalModificationInEffectModifiedFields_model" - )] - public class UnmanagedAccessCodeWarningsExternalModificationInEffectModifiedFields - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsExternalModificationInEffectModifiedFields() { } - - public UnmanagedAccessCodeWarningsExternalModificationInEffectModifiedFields( - string field = default, - string? from = default, - string? to = default - ) - { - Field = field; - From = from; - To = to; - } - - /// - /// The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). - /// - [DataMember(Name = "field", IsRequired = false, EmitDefaultValue = false)] - public string Field { get; set; } - - /// - /// The previous value of the field. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public string? From { get; set; } - - /// - /// The new value of the field. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public string? To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeWarningsDelayInSettingOnDevice_model")] - public class UnmanagedAccessCodeWarningsDelayInSettingOnDevice : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsDelayInSettingOnDevice() { } - - public UnmanagedAccessCodeWarningsDelayInSettingOnDevice( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_setting_on_device"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeWarningsDelayInRemovingFromDevice_model" - )] - public class UnmanagedAccessCodeWarningsDelayInRemovingFromDevice - : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsDelayInRemovingFromDevice() { } - - public UnmanagedAccessCodeWarningsDelayInRemovingFromDevice( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_removing_from_device"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeWarningsDelayInIssuing_model")] - public class UnmanagedAccessCodeWarningsDelayInIssuing : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsDelayInIssuing() { } - - public UnmanagedAccessCodeWarningsDelayInIssuing( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_issuing"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeWarningsDelayInApplyingMutations_model")] - public class UnmanagedAccessCodeWarningsDelayInApplyingMutations - : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsDelayInApplyingMutations() { } - - public UnmanagedAccessCodeWarningsDelayInApplyingMutations( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_applying_mutations"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeWarningsThirdPartyIntegrationDetected_model" - )] - public class UnmanagedAccessCodeWarningsThirdPartyIntegrationDetected - : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsThirdPartyIntegrationDetected() { } - - public UnmanagedAccessCodeWarningsThirdPartyIntegrationDetected( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "third_party_integration_detected"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours_model" - )] - public class UnmanagedAccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours - : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours() { } - - public UnmanagedAccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "igloo_algopin_must_be_used_within_24_hours"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeWarningsManagementTransferred_model")] - public class UnmanagedAccessCodeWarningsManagementTransferred : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsManagementTransferred() { } - - public UnmanagedAccessCodeWarningsManagementTransferred( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "management_transferred"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeWarningsUsingBackupAccessCode_model")] - public class UnmanagedAccessCodeWarningsUsingBackupAccessCode : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsUsingBackupAccessCode() { } - - public UnmanagedAccessCodeWarningsUsingBackupAccessCode( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "using_backup_access_code"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeWarningsBeingDeleted_model")] - public class UnmanagedAccessCodeWarningsBeingDeleted : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsBeingDeleted() { } - - public UnmanagedAccessCodeWarningsBeingDeleted( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessCodeWarningsUnknownIssueWithAccessCode_model" - )] - public class UnmanagedAccessCodeWarningsUnknownIssueWithAccessCode - : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsUnknownIssueWithAccessCode() { } - - public UnmanagedAccessCodeWarningsUnknownIssueWithAccessCode( - string? createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unknown_issue_with_access_code"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeWarningsUnrecognized_model")] - public class UnmanagedAccessCodeWarningsUnrecognized : UnmanagedAccessCodeWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeWarningsUnrecognized() { } - - public UnmanagedAccessCodeWarningsUnrecognized( - string warningCode = default, - string? createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string? CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Unique identifier for the access code. - /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessCodeId { get; set; } - - /// - /// Indicates that Seam cannot convert this unmanaged access code to a managed access code. Some providers do not support management of unmanaged access codes through API integrations. - /// - [DataMember(Name = "cannot_be_managed", IsRequired = false, EmitDefaultValue = false)] - public bool? CannotBeManaged { get; set; } - - /// - /// Indicates that Seam cannot delete this unmanaged access code through the provider. If this access code needs to be deleted, it will only be possible from the manufacturer app. - /// - [DataMember( - Name = "cannot_delete_unmanaged_access_code", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CannotDeleteUnmanagedAccessCode { get; set; } - - /// - /// Code used for access. Typically, a numeric or alphanumeric string. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Date and time at which the access code was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Unique identifier for the device associated with the access code. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Metadata for a dormakaba Oracode unmanaged access code. Only present for unmanaged access codes from dormakaba Oracode devices. - /// - [DataMember( - Name = "dormakaba_oracode_metadata", - IsRequired = false, - EmitDefaultValue = false - )] - public UnmanagedAccessCodeDormakabaOracodeMetadata? DormakabaOracodeMetadata { get; set; } - - /// - /// Date and time after which the time-bound access code becomes inactive. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Errors associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Indicates that Seam does not manage the access code. - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// Date and time at which the time-bound access code becomes active. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - /// - /// Current status of the access code within the operational lifecycle. `set` indicates that the code is active and operational. `unset` indicates that the code exists on the provider but is not usable on the device. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessCode.StatusEnum Status { get; set; } - - /// - /// Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. - /// - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessCode.TypeEnum Type { get; set; } - - /// - /// Warnings associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// Unique identifier for the Seam workspace associated with the access code. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessCodeDormakabaOracodeMetadata_model")] - public class UnmanagedAccessCodeDormakabaOracodeMetadata - { - [JsonConstructorAttribute] - protected UnmanagedAccessCodeDormakabaOracodeMetadata() { } - - public UnmanagedAccessCodeDormakabaOracodeMetadata( - bool? isCancellable = default, - bool? isEarlyCheckinAble = default, - bool? isExtendable = default, - bool? isOverridable = default, - string? siteName = default, - float? stayId = default, - string? userLevelId = default, - string? userLevelName = default - ) - { - IsCancellable = isCancellable; - IsEarlyCheckinAble = isEarlyCheckinAble; - IsExtendable = isExtendable; - IsOverridable = isOverridable; - SiteName = siteName; - StayId = stayId; - UserLevelId = userLevelId; - UserLevelName = userLevelName; - } - - /// - /// Indicates whether the stay can be cancelled via the Dormakaba Oracode API. - /// - [DataMember(Name = "is_cancellable", IsRequired = false, EmitDefaultValue = false)] - public bool? IsCancellable { get; set; } - - /// - /// Indicates whether early check-in is available for this stay. - /// - [DataMember(Name = "is_early_checkin_able", IsRequired = false, EmitDefaultValue = false)] - public bool? IsEarlyCheckinAble { get; set; } - - /// - /// Indicates whether the stay can be extended via the Dormakaba Oracode API. - /// - [DataMember(Name = "is_extendable", IsRequired = false, EmitDefaultValue = false)] - public bool? IsExtendable { get; set; } - - /// - /// Indicates whether the access code can be overridden. When false, the maximum number of overrides has been reached. - /// - [DataMember(Name = "is_overridable", IsRequired = false, EmitDefaultValue = false)] - public bool? IsOverridable { get; set; } - - /// - /// Dormakaba Oracode site name associated with this access code. - /// - [DataMember(Name = "site_name", IsRequired = false, EmitDefaultValue = false)] - public string? SiteName { get; set; } - - /// - /// Dormakaba Oracode stay ID associated with this access code. - /// - [DataMember(Name = "stay_id", IsRequired = false, EmitDefaultValue = false)] - public float? StayId { get; set; } - - /// - /// Dormakaba Oracode user level ID associated with this access code. - /// - [DataMember(Name = "user_level_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserLevelId { get; set; } - - /// - /// Dormakaba Oracode user level name associated with this access code. - /// - [DataMember(Name = "user_level_name", IsRequired = false, EmitDefaultValue = false)] - public string? UserLevelName { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/UnmanagedAccessGrant.cs b/src/Seam/Model/UnmanagedAccessGrant.cs deleted file mode 100644 index beecf8f4..00000000 --- a/src/Seam/Model/UnmanagedAccessGrant.cs +++ /dev/null @@ -1,1435 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an unmanaged Access Grant. Unmanaged Access Grants do not have client sessions, instant keys, customization profiles, or keys. - /// - [DataContract(Name = "seamModel_unmanagedAccessGrant_model")] - public class UnmanagedAccessGrant - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrant() { } - - public UnmanagedAccessGrant( - string accessGrantId = default, - List accessMethodIds = default, - string createdAt = default, - string displayName = default, - string? endsAt = default, - List errors = default, - List locationIds = default, - string? name = default, - List pendingMutations = default, - List requestedAccessMethods = default, - string? reservationKey = default, - List spaceIds = default, - string startsAt = default, - string? userIdentityId = default, - List warnings = default, - string workspaceId = default - ) - { - AccessGrantId = accessGrantId; - AccessMethodIds = accessMethodIds; - CreatedAt = createdAt; - DisplayName = displayName; - EndsAt = endsAt; - Errors = errors; - LocationIds = locationIds; - Name = name; - PendingMutations = pendingMutations; - RequestedAccessMethods = requestedAccessMethods; - ReservationKey = reservationKey; - SpaceIds = spaceIds; - StartsAt = startsAt; - UserIdentityId = userIdentityId; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedAccessGrantErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantErrorsCannotCreateRequestedAccessMethods), - "cannot_create_requested_access_methods" - )] - public abstract class UnmanagedAccessGrantErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantErrorsCannotCreateRequestedAccessMethods_model" - )] - public class UnmanagedAccessGrantErrorsCannotCreateRequestedAccessMethods - : UnmanagedAccessGrantErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantErrorsCannotCreateRequestedAccessMethods() { } - - public UnmanagedAccessGrantErrorsCannotCreateRequestedAccessMethods( - string createdAt = default, - string errorCode = default, - string message = default, - List? missingDeviceIds = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - MissingDeviceIds = missingDeviceIds; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "cannot_create_requested_access_methods"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// IDs of the devices that did not receive an access code at grant creation. Use these to identify which specific devices failed when the message reports a partial failure. - /// - [DataMember(Name = "missing_device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? MissingDeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessGrantErrorsUnrecognized_model")] - public class UnmanagedAccessGrantErrorsUnrecognized : UnmanagedAccessGrantErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantErrorsUnrecognized() { } - - public UnmanagedAccessGrantErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "mutation_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedAccessGrantPendingMutationsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantPendingMutationsUpdatingAccessTimes), - "updating_access_times" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantPendingMutationsUpdatingSpaces), - "updating_spaces" - )] - public abstract class UnmanagedAccessGrantPendingMutations - { - public abstract string MutationCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedAccessGrantPendingMutationsUpdatingSpaces_model")] - public class UnmanagedAccessGrantPendingMutationsUpdatingSpaces - : UnmanagedAccessGrantPendingMutations - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantPendingMutationsUpdatingSpaces() { } - - public UnmanagedAccessGrantPendingMutationsUpdatingSpaces( - string createdAt = default, - UnmanagedAccessGrantPendingMutationsUpdatingSpacesFrom from = default, - string message = default, - string mutationCode = default, - UnmanagedAccessGrantPendingMutationsUpdatingSpacesTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous location configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessGrantPendingMutationsUpdatingSpacesFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_spaces"; - - /// - /// New location configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessGrantPendingMutationsUpdatingSpacesTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantPendingMutationsUpdatingSpacesFrom_model" - )] - public class UnmanagedAccessGrantPendingMutationsUpdatingSpacesFrom - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantPendingMutationsUpdatingSpacesFrom() { } - - public UnmanagedAccessGrantPendingMutationsUpdatingSpacesFrom( - List deviceIds = default - ) - { - DeviceIds = deviceIds; - } - - /// - /// Previous device IDs where access codes existed. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantPendingMutationsUpdatingSpacesTo_model" - )] - public class UnmanagedAccessGrantPendingMutationsUpdatingSpacesTo - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantPendingMutationsUpdatingSpacesTo() { } - - public UnmanagedAccessGrantPendingMutationsUpdatingSpacesTo( - string? commonCodeKey = default, - List deviceIds = default - ) - { - CommonCodeKey = commonCodeKey; - DeviceIds = deviceIds; - } - - /// - /// Common code key to ensure PIN code reuse across devices. - /// - [DataMember(Name = "common_code_key", IsRequired = false, EmitDefaultValue = false)] - public string? CommonCodeKey { get; set; } - - /// - /// New device IDs where access codes should be created. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantPendingMutationsUpdatingAccessTimes_model" - )] - public class UnmanagedAccessGrantPendingMutationsUpdatingAccessTimes - : UnmanagedAccessGrantPendingMutations - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantPendingMutationsUpdatingAccessTimes() { } - - public UnmanagedAccessGrantPendingMutationsUpdatingAccessTimes( - List accessMethodIds = default, - string createdAt = default, - UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesFrom from = default, - string message = default, - string mutationCode = default, - UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesTo to = default - ) - { - AccessMethodIds = accessMethodIds; - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// IDs of the access methods being updated. - /// - [DataMember(Name = "access_method_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessMethodIds { get; set; } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous access time configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_access_times"; - - /// - /// New access time configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantPendingMutationsUpdatingAccessTimesFrom_model" - )] - public class UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesFrom - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesFrom() { } - - public UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesFrom( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Previous end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Previous start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantPendingMutationsUpdatingAccessTimesTo_model" - )] - public class UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesTo - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesTo() { } - - public UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesTo( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// New end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// New start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessGrantPendingMutationsUnrecognized_model")] - public class UnmanagedAccessGrantPendingMutationsUnrecognized - : UnmanagedAccessGrantPendingMutations - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantPendingMutationsUnrecognized() { } - - public UnmanagedAccessGrantPendingMutationsUnrecognized( - string mutationCode = default, - string createdAt = default, - string message = default - ) - { - MutationCode = mutationCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "unrecognized"; - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedAccessGrantWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated), - "device_time_constraints_violated" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantWarningsDeviceDoesNotSupportAccessCodes), - "device_does_not_support_access_codes" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantWarningsRequestedCodeUnavailable), - "requested_code_unavailable" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantWarningsUpdatingAccessTimes), - "updating_access_times" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantWarningsOverprovisionedAccess), - "overprovisioned_access" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantWarningsUnderprovisionedAccess), - "underprovisioned_access" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessGrantWarningsBeingDeleted), - "being_deleted" - )] - public abstract class UnmanagedAccessGrantWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedAccessGrantWarningsBeingDeleted_model")] - public class UnmanagedAccessGrantWarningsBeingDeleted : UnmanagedAccessGrantWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantWarningsBeingDeleted() { } - - public UnmanagedAccessGrantWarningsBeingDeleted( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessGrantWarningsUnderprovisionedAccess_model")] - public class UnmanagedAccessGrantWarningsUnderprovisionedAccess - : UnmanagedAccessGrantWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantWarningsUnderprovisionedAccess() { } - - public UnmanagedAccessGrantWarningsUnderprovisionedAccess( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "underprovisioned_access"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessGrantWarningsOverprovisionedAccess_model")] - public class UnmanagedAccessGrantWarningsOverprovisionedAccess - : UnmanagedAccessGrantWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantWarningsOverprovisionedAccess() { } - - public UnmanagedAccessGrantWarningsOverprovisionedAccess( - string createdAt = default, - List? failedDevices = - default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - FailedDevices = failedDevices; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Devices whose access codes could not be revoked during reconciliation. Present when the provider does not support revoking an offline access code (e.g. Dormakaba oracode with exhausted override budget). - /// - [DataMember(Name = "failed_devices", IsRequired = false, EmitDefaultValue = false)] - public List? FailedDevices { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "overprovisioned_access"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantWarningsOverprovisionedAccessFailedDevices_model" - )] - public class UnmanagedAccessGrantWarningsOverprovisionedAccessFailedDevices - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantWarningsOverprovisionedAccessFailedDevices() { } - - public UnmanagedAccessGrantWarningsOverprovisionedAccessFailedDevices( - string deviceId = default, - string errorCode = default, - string message = default - ) - { - DeviceId = deviceId; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Device whose access code could not be revoked. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`). - /// - [DataMember(Name = "error_code", IsRequired = false, EmitDefaultValue = false)] - public string ErrorCode { get; set; } - - /// - /// Human-readable description of why revocation failed. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessGrantWarningsUpdatingAccessTimes_model")] - public class UnmanagedAccessGrantWarningsUpdatingAccessTimes : UnmanagedAccessGrantWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantWarningsUpdatingAccessTimes() { } - - public UnmanagedAccessGrantWarningsUpdatingAccessTimes( - List accessMethodIds = default, - string createdAt = default, - string message = default, - string warningCode = default - ) - { - AccessMethodIds = accessMethodIds; - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// IDs of the access methods being updated. - /// - [DataMember(Name = "access_method_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessMethodIds { get; set; } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "updating_access_times"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantWarningsRequestedCodeUnavailable_model" - )] - public class UnmanagedAccessGrantWarningsRequestedCodeUnavailable - : UnmanagedAccessGrantWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantWarningsRequestedCodeUnavailable() { } - - public UnmanagedAccessGrantWarningsRequestedCodeUnavailable( - string createdAt = default, - string deviceId = default, - string message = default, - string newCode = default, - string originalCode = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - DeviceId = deviceId; - Message = message; - NewCode = newCode; - OriginalCode = originalCode; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device where the requested code was unavailable. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// The new PIN code that was assigned instead. - /// - [DataMember(Name = "new_code", IsRequired = false, EmitDefaultValue = false)] - public string NewCode { get; set; } - - /// - /// The originally requested PIN code that was unavailable. - /// - [DataMember(Name = "original_code", IsRequired = false, EmitDefaultValue = false)] - public string OriginalCode { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "requested_code_unavailable"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantWarningsDeviceDoesNotSupportAccessCodes_model" - )] - public class UnmanagedAccessGrantWarningsDeviceDoesNotSupportAccessCodes - : UnmanagedAccessGrantWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantWarningsDeviceDoesNotSupportAccessCodes() { } - - public UnmanagedAccessGrantWarningsDeviceDoesNotSupportAccessCodes( - string createdAt = default, - string deviceId = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - DeviceId = deviceId; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device that does not support access codes. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "device_does_not_support_access_codes"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessGrantWarningsDeviceTimeConstraintsViolated_model" - )] - public class UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated - : UnmanagedAccessGrantWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated() { } - - public UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated( - string createdAt = default, - string deviceId = default, - string message = default, - UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated.ReasonEnum reason = - default, - string warningCode = default - ) - { - CreatedAt = createdAt; - DeviceId = deviceId; - Message = message; - Reason = reason; - WarningCode = warningCode; - } - - /// - /// Specific reason why the grant's times are not programmable on the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ReasonEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "duration_exceeds_max")] - DurationExceedsMax = 1, - - [EnumMember(Value = "times_do_not_match_slots")] - TimesDoNotMatchSlots = 2, - - [EnumMember(Value = "ongoing_not_supported")] - OngoingNotSupported = 3, - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// ID of the device whose time constraints the access grant violates. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// Specific reason why the grant's times are not programmable on the device. - /// - [DataMember(Name = "reason", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated.ReasonEnum Reason { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "device_time_constraints_violated"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessGrantWarningsUnrecognized_model")] - public class UnmanagedAccessGrantWarningsUnrecognized : UnmanagedAccessGrantWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantWarningsUnrecognized() { } - - public UnmanagedAccessGrantWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// ID of the Access Grant. - /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessGrantId { get; set; } - - /// - /// IDs of the access methods created for the Access Grant. - /// - [DataMember(Name = "access_method_ids", IsRequired = false, EmitDefaultValue = false)] - public List AccessMethodIds { get; set; } - - /// - /// Date and time at which the Access Grant was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name of the Access Grant. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Date and time at which the Access Grant ends. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Errors associated with the [access grant](https://docs.seam.co/use-cases/granting-access). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - [Obsolete("Use `space_ids`.")] - [DataMember(Name = "location_ids", IsRequired = false, EmitDefaultValue = false)] - public List LocationIds { get; set; } - - /// - /// Name of the Access Grant. If not provided, the display name will be computed. - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - /// - /// List of pending mutations for the access grant. This shows updates that are in progress. - /// - [DataMember(Name = "pending_mutations", IsRequired = false, EmitDefaultValue = false)] - public List PendingMutations { get; set; } - - /// - /// Access methods that the user requested for the Access Grant. - /// - [DataMember( - Name = "requested_access_methods", - IsRequired = false, - EmitDefaultValue = false - )] - public List RequestedAccessMethods { get; set; } - - /// - /// Reservation key for the access grant. - /// - [DataMember(Name = "reservation_key", IsRequired = false, EmitDefaultValue = false)] - public string? ReservationKey { get; set; } - - /// - /// IDs of the spaces to which the Access Grant gives access. - /// - [DataMember(Name = "space_ids", IsRequired = false, EmitDefaultValue = false)] - public List SpaceIds { get; set; } - - /// - /// Date and time at which the Access Grant starts. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string StartsAt { get; set; } - - /// - /// ID of user identity to which the Access Grant gives access. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } - - /// - /// Warnings associated with the [access grant](https://docs.seam.co/use-cases/granting-access). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the Seam workspace associated with the Access Grant. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessGrantRequestedAccessMethods_model")] - public class UnmanagedAccessGrantRequestedAccessMethods - { - [JsonConstructorAttribute] - protected UnmanagedAccessGrantRequestedAccessMethods() { } - - public UnmanagedAccessGrantRequestedAccessMethods( - string? code = default, - List createdAccessMethodIds = default, - string createdAt = default, - string displayName = default, - int? instantKeyMaxUseCount = default, - UnmanagedAccessGrantRequestedAccessMethods.ModeEnum mode = default - ) - { - Code = code; - CreatedAccessMethodIds = createdAccessMethodIds; - CreatedAt = createdAt; - DisplayName = displayName; - InstantKeyMaxUseCount = instantKeyMaxUseCount; - Mode = mode; - } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - /// - /// Specific PIN code to use for this access method. Only applicable when mode is 'code'. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// IDs of the access methods created for the requested access method. - /// - [DataMember( - Name = "created_access_method_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List CreatedAccessMethodIds { get; set; } - - /// - /// Date and time at which the requested access method was added to the Access Grant. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name of the access method. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Maximum number of times the instant key can be used. Only applicable when mode is 'mobile_key'. Defaults to 1 if not specified. - /// - [DataMember( - Name = "instant_key_max_use_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int? InstantKeyMaxUseCount { get; set; } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "mode", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessGrantRequestedAccessMethods.ModeEnum Mode { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/UnmanagedAccessMethod.cs b/src/Seam/Model/UnmanagedAccessMethod.cs deleted file mode 100644 index e8336f90..00000000 --- a/src/Seam/Model/UnmanagedAccessMethod.cs +++ /dev/null @@ -1,1169 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an unmanaged access method. Unmanaged access methods do not have client sessions, instant keys, customization profiles, or keys. - /// - [DataContract(Name = "seamModel_unmanagedAccessMethod_model")] - public class UnmanagedAccessMethod - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethod() { } - - public UnmanagedAccessMethod( - string accessMethodId = default, - string? code = default, - string createdAt = default, - string displayName = default, - string displayStatus = default, - List errors = default, - bool? isAssignmentRequired = default, - bool? isEncodingRequired = default, - bool isIssued = default, - bool? isReadyForAssignment = default, - bool? isReadyForEncoding = default, - string? issuedAt = default, - UnmanagedAccessMethod.ModeEnum mode = default, - List pendingMutations = default, - List warnings = default, - string workspaceId = default - ) - { - AccessMethodId = accessMethodId; - Code = code; - CreatedAt = createdAt; - DisplayName = displayName; - DisplayStatus = displayStatus; - Errors = errors; - IsAssignmentRequired = isAssignmentRequired; - IsEncodingRequired = isEncodingRequired; - IsIssued = isIssued; - IsReadyForAssignment = isReadyForAssignment; - IsReadyForEncoding = isReadyForEncoding; - IssuedAt = issuedAt; - Mode = mode; - PendingMutations = pendingMutations; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedAccessMethodErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessMethodErrorsFailedToIssue), - "failed_to_issue" - )] - public abstract class UnmanagedAccessMethodErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedAccessMethodErrorsFailedToIssue_model")] - public class UnmanagedAccessMethodErrorsFailedToIssue : UnmanagedAccessMethodErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodErrorsFailedToIssue() { } - - public UnmanagedAccessMethodErrorsFailedToIssue( - string createdAt = default, - string errorCode = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "failed_to_issue"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessMethodErrorsUnrecognized_model")] - public class UnmanagedAccessMethodErrorsUnrecognized : UnmanagedAccessMethodErrors - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodErrorsUnrecognized() { } - - public UnmanagedAccessMethodErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum ModeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "code")] - Code = 1, - - [EnumMember(Value = "card")] - Card = 2, - - [EnumMember(Value = "mobile_key")] - MobileKey = 3, - - [EnumMember(Value = "cloud_key")] - CloudKey = 4, - } - - [JsonConverter(typeof(JsonSubtypes), "mutation_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedAccessMethodPendingMutationsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessMethodPendingMutationsUpdatingAccessTimes), - "updating_access_times" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessMethodPendingMutationsRevokingAccess), - "revoking_access" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessMethodPendingMutationsProvisioningAccess), - "provisioning_access" - )] - public abstract class UnmanagedAccessMethodPendingMutations - { - public abstract string MutationCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract( - Name = "seamModel_unmanagedAccessMethodPendingMutationsProvisioningAccess_model" - )] - public class UnmanagedAccessMethodPendingMutationsProvisioningAccess - : UnmanagedAccessMethodPendingMutations - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsProvisioningAccess() { } - - public UnmanagedAccessMethodPendingMutationsProvisioningAccess( - string createdAt = default, - UnmanagedAccessMethodPendingMutationsProvisioningAccessFrom from = default, - string message = default, - string mutationCode = default, - UnmanagedAccessMethodPendingMutationsProvisioningAccessTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous device configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessMethodPendingMutationsProvisioningAccessFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "provisioning_access"; - - /// - /// New device configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessMethodPendingMutationsProvisioningAccessTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessMethodPendingMutationsProvisioningAccessFrom_model" - )] - public class UnmanagedAccessMethodPendingMutationsProvisioningAccessFrom - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsProvisioningAccessFrom() { } - - public UnmanagedAccessMethodPendingMutationsProvisioningAccessFrom( - List deviceIds = default - ) - { - DeviceIds = deviceIds; - } - - /// - /// Previous device IDs where access was provisioned. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessMethodPendingMutationsProvisioningAccessTo_model" - )] - public class UnmanagedAccessMethodPendingMutationsProvisioningAccessTo - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsProvisioningAccessTo() { } - - public UnmanagedAccessMethodPendingMutationsProvisioningAccessTo( - List deviceIds = default - ) - { - DeviceIds = deviceIds; - } - - /// - /// New device IDs where access is being provisioned. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessMethodPendingMutationsRevokingAccess_model")] - public class UnmanagedAccessMethodPendingMutationsRevokingAccess - : UnmanagedAccessMethodPendingMutations - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsRevokingAccess() { } - - public UnmanagedAccessMethodPendingMutationsRevokingAccess( - string createdAt = default, - UnmanagedAccessMethodPendingMutationsRevokingAccessFrom from = default, - string message = default, - string mutationCode = default, - UnmanagedAccessMethodPendingMutationsRevokingAccessTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous device configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessMethodPendingMutationsRevokingAccessFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "revoking_access"; - - /// - /// New device configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessMethodPendingMutationsRevokingAccessTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessMethodPendingMutationsRevokingAccessFrom_model" - )] - public class UnmanagedAccessMethodPendingMutationsRevokingAccessFrom - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsRevokingAccessFrom() { } - - public UnmanagedAccessMethodPendingMutationsRevokingAccessFrom( - List deviceIds = default - ) - { - DeviceIds = deviceIds; - } - - /// - /// Previous device IDs where access existed. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessMethodPendingMutationsRevokingAccessTo_model" - )] - public class UnmanagedAccessMethodPendingMutationsRevokingAccessTo - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsRevokingAccessTo() { } - - public UnmanagedAccessMethodPendingMutationsRevokingAccessTo( - List deviceIds = default - ) - { - DeviceIds = deviceIds; - } - - /// - /// New device IDs where access should remain. - /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List DeviceIds { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessMethodPendingMutationsUpdatingAccessTimes_model" - )] - public class UnmanagedAccessMethodPendingMutationsUpdatingAccessTimes - : UnmanagedAccessMethodPendingMutations - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsUpdatingAccessTimes() { } - - public UnmanagedAccessMethodPendingMutationsUpdatingAccessTimes( - string createdAt = default, - UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesFrom from = default, - string message = default, - string mutationCode = default, - UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesTo to = default - ) - { - CreatedAt = createdAt; - From = from; - Message = message; - MutationCode = mutationCode; - To = to; - } - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Previous access time configuration. - /// - [DataMember(Name = "from", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesFrom From { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "updating_access_times"; - - /// - /// New access time configuration. - /// - [DataMember(Name = "to", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesTo To { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessMethodPendingMutationsUpdatingAccessTimesFrom_model" - )] - public class UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesFrom - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesFrom() { } - - public UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesFrom( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// Previous end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// Previous start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedAccessMethodPendingMutationsUpdatingAccessTimesTo_model" - )] - public class UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesTo - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesTo() { } - - public UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesTo( - string? endsAt = default, - string? startsAt = default - ) - { - EndsAt = endsAt; - StartsAt = startsAt; - } - - /// - /// New end time for access. - /// - [DataMember(Name = "ends_at", IsRequired = false, EmitDefaultValue = false)] - public string? EndsAt { get; set; } - - /// - /// New start time for access. - /// - [DataMember(Name = "starts_at", IsRequired = false, EmitDefaultValue = false)] - public string? StartsAt { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessMethodPendingMutationsUnrecognized_model")] - public class UnmanagedAccessMethodPendingMutationsUnrecognized - : UnmanagedAccessMethodPendingMutations - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodPendingMutationsUnrecognized() { } - - public UnmanagedAccessMethodPendingMutationsUnrecognized( - string mutationCode = default, - string createdAt = default, - string message = default - ) - { - MutationCode = mutationCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "mutation_code", IsRequired = true, EmitDefaultValue = false)] - public override string MutationCode { get; } = "unrecognized"; - - /// - /// Date and time at which the mutation was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the mutation. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedAccessMethodWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessMethodWarningsDelayInIssuing), - "delay_in_issuing" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessMethodWarningsPulledBackupAccessCode), - "pulled_backup_access_code" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessMethodWarningsUpdatingAccessTimes), - "updating_access_times" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedAccessMethodWarningsBeingDeleted), - "being_deleted" - )] - public abstract class UnmanagedAccessMethodWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedAccessMethodWarningsBeingDeleted_model")] - public class UnmanagedAccessMethodWarningsBeingDeleted : UnmanagedAccessMethodWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodWarningsBeingDeleted() { } - - public UnmanagedAccessMethodWarningsBeingDeleted( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessMethodWarningsUpdatingAccessTimes_model")] - public class UnmanagedAccessMethodWarningsUpdatingAccessTimes - : UnmanagedAccessMethodWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodWarningsUpdatingAccessTimes() { } - - public UnmanagedAccessMethodWarningsUpdatingAccessTimes( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "updating_access_times"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessMethodWarningsPulledBackupAccessCode_model")] - public class UnmanagedAccessMethodWarningsPulledBackupAccessCode - : UnmanagedAccessMethodWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodWarningsPulledBackupAccessCode() { } - - public UnmanagedAccessMethodWarningsPulledBackupAccessCode( - string createdAt = default, - string message = default, - string? originalAccessMethodId = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - OriginalAccessMethodId = originalAccessMethodId; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - /// - /// ID of the original access method from which this backup access method was split, if applicable. - /// - [DataMember( - Name = "original_access_method_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? OriginalAccessMethodId { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "pulled_backup_access_code"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessMethodWarningsDelayInIssuing_model")] - public class UnmanagedAccessMethodWarningsDelayInIssuing : UnmanagedAccessMethodWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodWarningsDelayInIssuing() { } - - public UnmanagedAccessMethodWarningsDelayInIssuing( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "delay_in_issuing"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedAccessMethodWarningsUnrecognized_model")] - public class UnmanagedAccessMethodWarningsUnrecognized : UnmanagedAccessMethodWarnings - { - [JsonConstructorAttribute] - protected UnmanagedAccessMethodWarningsUnrecognized() { } - - public UnmanagedAccessMethodWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// ID of the access method. - /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string AccessMethodId { get; set; } - - /// - /// The actual PIN code for code access methods. - /// - [DataMember(Name = "code", IsRequired = false, EmitDefaultValue = false)] - public string? Code { get; set; } - - /// - /// Date and time at which the access method was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name of the access method. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Human-readable sentence describing where the access method sits in its relationship with the device or access system, for example `Awaiting encoding`. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read `is_issued`, `errors`, and `pending_mutations`. - /// - [DataMember(Name = "display_status", IsRequired = false, EmitDefaultValue = false)] - public string DisplayStatus { get; set; } - - /// - /// Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Indicates whether an existing card credential must be assigned to this access method before it can be issued. Only applies to card-mode access methods on systems that support credential assignment. - /// - [DataMember(Name = "is_assignment_required", IsRequired = false, EmitDefaultValue = false)] - public bool? IsAssignmentRequired { get; set; } - - /// - /// Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method. - /// - [DataMember(Name = "is_encoding_required", IsRequired = false, EmitDefaultValue = false)] - public bool? IsEncodingRequired { get; set; } - - /// - /// Indicates whether the access method has been issued. - /// - [DataMember(Name = "is_issued", IsRequired = false, EmitDefaultValue = false)] - public bool IsIssued { get; set; } - - /// - /// Indicates whether the access method is ready for card assignment. This is true when the access method is in card mode, has not yet been issued, and the system supports credential assignment. - /// - [DataMember(Name = "is_ready_for_assignment", IsRequired = false, EmitDefaultValue = false)] - public bool? IsReadyForAssignment { get; set; } - - /// - /// Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. - /// - [DataMember(Name = "is_ready_for_encoding", IsRequired = false, EmitDefaultValue = false)] - public bool? IsReadyForEncoding { get; set; } - - /// - /// Date and time at which the access method was issued. - /// - [DataMember(Name = "issued_at", IsRequired = false, EmitDefaultValue = false)] - public string? IssuedAt { get; set; } - - /// - /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. - /// - [DataMember(Name = "mode", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedAccessMethod.ModeEnum Mode { get; set; } - - /// - /// Pending mutations for the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). Indicates operations that are in progress. - /// - [DataMember(Name = "pending_mutations", IsRequired = false, EmitDefaultValue = false)] - public List PendingMutations { get; set; } - - /// - /// Warnings associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the Seam workspace associated with the access method. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/UnmanagedDevice.cs b/src/Seam/Model/UnmanagedDevice.cs deleted file mode 100644 index da202db3..00000000 --- a/src/Seam/Model/UnmanagedDevice.cs +++ /dev/null @@ -1,3592 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). - /// - [DataContract(Name = "seamModel_unmanagedDevice_model")] - public class UnmanagedDevice - { - [JsonConstructorAttribute] - protected UnmanagedDevice() { } - - public UnmanagedDevice( - bool? canConfigureAutoLock = default, - bool? canHvacCool = default, - bool? canHvacHeat = default, - bool? canHvacHeatCool = default, - bool? canProgramOfflineAccessCodes = default, - bool? canProgramOnlineAccessCodes = default, - bool? canProgramThermostatProgramsAsDifferentEachDay = default, - bool? canProgramThermostatProgramsAsSameEachDay = default, - bool? canProgramThermostatProgramsAsWeekdayWeekend = default, - bool? canRemotelyLock = default, - bool? canRemotelyUnlock = default, - bool? canRunThermostatPrograms = default, - bool? canSimulateConnection = default, - bool? canSimulateDisconnection = default, - bool? canSimulateHubConnection = default, - bool? canSimulateHubDisconnection = default, - bool? canSimulatePaidSubscription = default, - bool? canSimulateRemoval = default, - bool? canTurnOffHvac = default, - bool? canUnlockWithCode = default, - List capabilitiesSupported = default, - string connectedAccountId = default, - string createdAt = default, - object customMetadata = default, - string deviceId = default, - UnmanagedDevice.DeviceTypeEnum deviceType = default, - string displayName = default, - List errors = default, - bool isManaged = default, - UnmanagedDeviceLocation? location = default, - UnmanagedDeviceProperties properties = default, - List warnings = default, - string workspaceId = default - ) - { - CanConfigureAutoLock = canConfigureAutoLock; - CanHvacCool = canHvacCool; - CanHvacHeat = canHvacHeat; - CanHvacHeatCool = canHvacHeatCool; - CanProgramOfflineAccessCodes = canProgramOfflineAccessCodes; - CanProgramOnlineAccessCodes = canProgramOnlineAccessCodes; - CanProgramThermostatProgramsAsDifferentEachDay = - canProgramThermostatProgramsAsDifferentEachDay; - CanProgramThermostatProgramsAsSameEachDay = canProgramThermostatProgramsAsSameEachDay; - CanProgramThermostatProgramsAsWeekdayWeekend = - canProgramThermostatProgramsAsWeekdayWeekend; - CanRemotelyLock = canRemotelyLock; - CanRemotelyUnlock = canRemotelyUnlock; - CanRunThermostatPrograms = canRunThermostatPrograms; - CanSimulateConnection = canSimulateConnection; - CanSimulateDisconnection = canSimulateDisconnection; - CanSimulateHubConnection = canSimulateHubConnection; - CanSimulateHubDisconnection = canSimulateHubDisconnection; - CanSimulatePaidSubscription = canSimulatePaidSubscription; - CanSimulateRemoval = canSimulateRemoval; - CanTurnOffHvac = canTurnOffHvac; - CanUnlockWithCode = canUnlockWithCode; - CapabilitiesSupported = capabilitiesSupported; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomMetadata = customMetadata; - DeviceId = deviceId; - DeviceType = deviceType; - DisplayName = displayName; - Errors = errors; - IsManaged = isManaged; - Location = location; - Properties = properties; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - /// - /// Collection of capabilities that the device supports when connected to Seam. Values are `access_code`, which indicates that the device can manage and utilize digital PIN codes for secure access; `lock`, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; `noise_detection`, which indicates that the device supports monitoring and responding to ambient noise levels; `thermostat`, which indicates that the device can regulate and adjust indoor temperatures; `battery`, which indicates that the device can manage battery life and health; and `phone`, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum CapabilitiesSupportedEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "access_code")] - AccessCode = 1, - - [EnumMember(Value = "lock")] - Lock = 2, - - [EnumMember(Value = "noise_detection")] - NoiseDetection = 3, - - [EnumMember(Value = "thermostat")] - Thermostat = 4, - - [EnumMember(Value = "battery")] - Battery = 5, - - [EnumMember(Value = "phone")] - Phone = 6, - } - - /// - /// Type of the device. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum DeviceTypeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "akuvox_lock")] - AkuvoxLock = 1, - - [EnumMember(Value = "august_lock")] - AugustLock = 2, - - [EnumMember(Value = "brivo_access_point")] - BrivoAccessPoint = 3, - - [EnumMember(Value = "butterflymx_panel")] - ButterflymxPanel = 4, - - [EnumMember(Value = "avigilon_alta_entry")] - AvigilonAltaEntry = 5, - - [EnumMember(Value = "doorking_lock")] - DoorkingLock = 6, - - [EnumMember(Value = "genie_door")] - GenieDoor = 7, - - [EnumMember(Value = "igloo_lock")] - IglooLock = 8, - - [EnumMember(Value = "linear_lock")] - LinearLock = 9, - - [EnumMember(Value = "lockly_lock")] - LocklyLock = 10, - - [EnumMember(Value = "kwikset_lock")] - KwiksetLock = 11, - - [EnumMember(Value = "nuki_lock")] - NukiLock = 12, - - [EnumMember(Value = "salto_lock")] - SaltoLock = 13, - - [EnumMember(Value = "schlage_lock")] - SchlageLock = 14, - - [EnumMember(Value = "smartthings_lock")] - SmartthingsLock = 15, - - [EnumMember(Value = "wyze_lock")] - WyzeLock = 16, - - [EnumMember(Value = "yale_lock")] - YaleLock = 17, - - [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, - - [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, - - [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, - - [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, - - [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, - - [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, - - [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, - - [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, - - [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, - - [EnumMember(Value = "yacan_lock")] - YacanLock = 27, - - [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, - - [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, - - [EnumMember(Value = "kisi_lock")] - KisiLock = 30, - - [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, - - [EnumMember(Value = "keynest_key")] - KeynestKey = 32, - - [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, - - [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, - - [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, - - [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, - - [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, - - [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, - - [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, - - [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, - - [EnumMember(Value = "ios_phone")] - IosPhone = 41, - - [EnumMember(Value = "android_phone")] - AndroidPhone = 42, - - [EnumMember(Value = "ring_camera")] - RingCamera = 43, - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedDeviceErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsBridgeDisconnected), - "bridge_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsSubscriptionRequired), - "subscription_required" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsAuxiliaryHeatRunning), - "auxiliary_heat_running" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsMissingDeviceCredentials), - "missing_device_credentials" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsAugustLockNotAuthorized), - "august_lock_not_authorized" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsEmptyBackupAccessCodePool), - "empty_backup_access_code_pool" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsDeviceDisconnected), - "device_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsHubDisconnected), - "hub_disconnected" - )] - [JsonSubtypes.KnownSubType(typeof(UnmanagedDeviceErrorsDeviceRemoved), "device_removed")] - [JsonSubtypes.KnownSubType(typeof(UnmanagedDeviceErrorsDeviceOffline), "device_offline")] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsDormakabaSitesDisconnected), - "dormakaba_sites_disconnected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsInsufficientPermissions), - "insufficient_permissions" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsSaltoKsSubscriptionLimitExceeded), - "salto_ks_subscription_limit_exceeded" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceErrorsAccountDisconnected), - "account_disconnected" - )] - public abstract class UnmanagedDeviceErrors - { - public abstract string ErrorCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsAccountDisconnected_model")] - public class UnmanagedDeviceErrorsAccountDisconnected : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsAccountDisconnected() { } - - public UnmanagedDeviceErrorsAccountDisconnected( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "account_disconnected"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedDeviceErrorsSaltoKsSubscriptionLimitExceeded_model" - )] - public class UnmanagedDeviceErrorsSaltoKsSubscriptionLimitExceeded : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsSaltoKsSubscriptionLimitExceeded() { } - - public UnmanagedDeviceErrorsSaltoKsSubscriptionLimitExceeded( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsInsufficientPermissions_model")] - public class UnmanagedDeviceErrorsInsufficientPermissions : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsInsufficientPermissions() { } - - public UnmanagedDeviceErrorsInsufficientPermissions( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "insufficient_permissions"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsDormakabaSitesDisconnected_model")] - public class UnmanagedDeviceErrorsDormakabaSitesDisconnected : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsDormakabaSitesDisconnected() { } - - public UnmanagedDeviceErrorsDormakabaSitesDisconnected( - string createdAt = default, - string errorCode = default, - bool isConnectedAccountError = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsConnectedAccountError = isConnectedAccountError; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; - - /// - /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsConnectedAccountError { get; set; } - - /// - /// Indicates that the error is not a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsDeviceOffline_model")] - public class UnmanagedDeviceErrorsDeviceOffline : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsDeviceOffline() { } - - public UnmanagedDeviceErrorsDeviceOffline( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_offline"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsDeviceRemoved_model")] - public class UnmanagedDeviceErrorsDeviceRemoved : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsDeviceRemoved() { } - - public UnmanagedDeviceErrorsDeviceRemoved( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_removed"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsHubDisconnected_model")] - public class UnmanagedDeviceErrorsHubDisconnected : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsHubDisconnected() { } - - public UnmanagedDeviceErrorsHubDisconnected( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "hub_disconnected"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsDeviceDisconnected_model")] - public class UnmanagedDeviceErrorsDeviceDisconnected : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsDeviceDisconnected() { } - - public UnmanagedDeviceErrorsDeviceDisconnected( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "device_disconnected"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsEmptyBackupAccessCodePool_model")] - public class UnmanagedDeviceErrorsEmptyBackupAccessCodePool : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsEmptyBackupAccessCodePool() { } - - public UnmanagedDeviceErrorsEmptyBackupAccessCodePool( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "empty_backup_access_code_pool"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsAugustLockNotAuthorized_model")] - public class UnmanagedDeviceErrorsAugustLockNotAuthorized : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsAugustLockNotAuthorized() { } - - public UnmanagedDeviceErrorsAugustLockNotAuthorized( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "august_lock_not_authorized"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsMissingDeviceCredentials_model")] - public class UnmanagedDeviceErrorsMissingDeviceCredentials : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsMissingDeviceCredentials() { } - - public UnmanagedDeviceErrorsMissingDeviceCredentials( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "missing_device_credentials"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsAuxiliaryHeatRunning_model")] - public class UnmanagedDeviceErrorsAuxiliaryHeatRunning : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsAuxiliaryHeatRunning() { } - - public UnmanagedDeviceErrorsAuxiliaryHeatRunning( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "auxiliary_heat_running"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsSubscriptionRequired_model")] - public class UnmanagedDeviceErrorsSubscriptionRequired : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsSubscriptionRequired() { } - - public UnmanagedDeviceErrorsSubscriptionRequired( - string createdAt = default, - string errorCode = default, - bool isDeviceError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsDeviceError = isDeviceError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "subscription_required"; - - /// - /// Indicates that the error is a device error. - /// - [DataMember(Name = "is_device_error", IsRequired = false, EmitDefaultValue = false)] - public bool IsDeviceError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsBridgeDisconnected_model")] - public class UnmanagedDeviceErrorsBridgeDisconnected : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsBridgeDisconnected() { } - - public UnmanagedDeviceErrorsBridgeDisconnected( - string createdAt = default, - string errorCode = default, - bool? isBridgeError = default, - bool? isConnectedAccountError = default, - string message = default - ) - { - CreatedAt = createdAt; - ErrorCode = errorCode; - IsBridgeError = isBridgeError; - IsConnectedAccountError = isConnectedAccountError; - Message = message; - } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "bridge_disconnected"; - - /// - /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). - /// - [DataMember(Name = "is_bridge_error", IsRequired = false, EmitDefaultValue = false)] - public bool? IsBridgeError { get; set; } - - /// - /// Indicates whether the error is related specifically to the connected account. - /// - [DataMember( - Name = "is_connected_account_error", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? IsConnectedAccountError { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceErrorsUnrecognized_model")] - public class UnmanagedDeviceErrorsUnrecognized : UnmanagedDeviceErrors - { - [JsonConstructorAttribute] - protected UnmanagedDeviceErrorsUnrecognized() { } - - public UnmanagedDeviceErrorsUnrecognized( - string errorCode = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedDeviceWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsMaxAccessCodesReached), - "max_access_codes_reached" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsUnreliableOnlineStatus), - "unreliable_online_status" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsAccessoryKeypadSetupRequired), - "accessory_keypad_setup_required" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsKeynestUnsupportedLocker), - "keynest_unsupported_locker" - )] - [JsonSubtypes.KnownSubType(typeof(UnmanagedDeviceWarningsProviderIssue), "provider_issue")] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsHubRequiredForAdditionalCapabilities), - "hub_required_for_additional_capabilities" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsTwoNDeviceMissingTimezone), - "two_n_device_missing_timezone" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsTimeZoneMismatch), - "time_zone_mismatch" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsTimeZoneUnknown), - "time_zone_unknown" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsUltraloqTimeZoneUnknown), - "ultraloq_time_zone_unknown" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsLocklyTimeZoneNotConfigured), - "lockly_time_zone_not_configured" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsUnknownIssueWithPhone), - "unknown_issue_with_phone" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsSaltoKsLockAccessCodeSupportRemoved), - "salto_ks_lock_access_code_support_removed" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsSaltoKsSubscriptionLimitAlmostReached), - "salto_ks_subscription_limit_almost_reached" - )] - [JsonSubtypes.KnownSubType(typeof(UnmanagedDeviceWarningsPrivacyMode), "privacy_mode")] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsSaltoKsPrivacyMode), - "salto_ks_privacy_mode" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsSaltoKsOfficeMode), - "salto_ks_office_mode" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsDeviceHasFlakyConnection), - "device_has_flaky_connection" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsScheduledMaintenanceWindow), - "scheduled_maintenance_window" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsDeviceCommunicationDegraded), - "device_communication_degraded" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsTemperatureThresholdExceeded), - "temperature_threshold_exceeded" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsPowerSavingMode), - "power_saving_mode" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsTtlockWeakGatewaySignal), - "ttlock_weak_gateway_signal" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsTtlockLockGatewayUnlockingNotEnabled), - "ttlock_lock_gateway_unlocking_not_enabled" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsThirdPartyIntegrationDetected), - "third_party_integration_detected" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsManyActiveBackupCodes), - "many_active_backup_codes" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedDeviceWarningsPartialBackupAccessCodePool), - "partial_backup_access_code_pool" - )] - public abstract class UnmanagedDeviceWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsPartialBackupAccessCodePool_model")] - public class UnmanagedDeviceWarningsPartialBackupAccessCodePool : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsPartialBackupAccessCodePool() { } - - public UnmanagedDeviceWarningsPartialBackupAccessCodePool( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "partial_backup_access_code_pool"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsManyActiveBackupCodes_model")] - public class UnmanagedDeviceWarningsManyActiveBackupCodes : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsManyActiveBackupCodes() { } - - public UnmanagedDeviceWarningsManyActiveBackupCodes( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "many_active_backup_codes"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedDeviceWarningsThirdPartyIntegrationDetected_model" - )] - public class UnmanagedDeviceWarningsThirdPartyIntegrationDetected : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsThirdPartyIntegrationDetected() { } - - public UnmanagedDeviceWarningsThirdPartyIntegrationDetected( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "third_party_integration_detected"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedDeviceWarningsTtlockLockGatewayUnlockingNotEnabled_model" - )] - public class UnmanagedDeviceWarningsTtlockLockGatewayUnlockingNotEnabled - : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsTtlockLockGatewayUnlockingNotEnabled() { } - - public UnmanagedDeviceWarningsTtlockLockGatewayUnlockingNotEnabled( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "ttlock_lock_gateway_unlocking_not_enabled"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsTtlockWeakGatewaySignal_model")] - public class UnmanagedDeviceWarningsTtlockWeakGatewaySignal : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsTtlockWeakGatewaySignal() { } - - public UnmanagedDeviceWarningsTtlockWeakGatewaySignal( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "ttlock_weak_gateway_signal"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsPowerSavingMode_model")] - public class UnmanagedDeviceWarningsPowerSavingMode : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsPowerSavingMode() { } - - public UnmanagedDeviceWarningsPowerSavingMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "power_saving_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsTemperatureThresholdExceeded_model")] - public class UnmanagedDeviceWarningsTemperatureThresholdExceeded : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsTemperatureThresholdExceeded() { } - - public UnmanagedDeviceWarningsTemperatureThresholdExceeded( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "temperature_threshold_exceeded"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsDeviceCommunicationDegraded_model")] - public class UnmanagedDeviceWarningsDeviceCommunicationDegraded : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsDeviceCommunicationDegraded() { } - - public UnmanagedDeviceWarningsDeviceCommunicationDegraded( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "device_communication_degraded"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsScheduledMaintenanceWindow_model")] - public class UnmanagedDeviceWarningsScheduledMaintenanceWindow : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsScheduledMaintenanceWindow() { } - - public UnmanagedDeviceWarningsScheduledMaintenanceWindow( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "scheduled_maintenance_window"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsDeviceHasFlakyConnection_model")] - public class UnmanagedDeviceWarningsDeviceHasFlakyConnection : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsDeviceHasFlakyConnection() { } - - public UnmanagedDeviceWarningsDeviceHasFlakyConnection( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "device_has_flaky_connection"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsSaltoKsOfficeMode_model")] - public class UnmanagedDeviceWarningsSaltoKsOfficeMode : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsSaltoKsOfficeMode() { } - - public UnmanagedDeviceWarningsSaltoKsOfficeMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "salto_ks_office_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsSaltoKsPrivacyMode_model")] - public class UnmanagedDeviceWarningsSaltoKsPrivacyMode : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsSaltoKsPrivacyMode() { } - - public UnmanagedDeviceWarningsSaltoKsPrivacyMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "salto_ks_privacy_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsPrivacyMode_model")] - public class UnmanagedDeviceWarningsPrivacyMode : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsPrivacyMode() { } - - public UnmanagedDeviceWarningsPrivacyMode( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "privacy_mode"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedDeviceWarningsSaltoKsSubscriptionLimitAlmostReached_model" - )] - public class UnmanagedDeviceWarningsSaltoKsSubscriptionLimitAlmostReached - : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsSaltoKsSubscriptionLimitAlmostReached() { } - - public UnmanagedDeviceWarningsSaltoKsSubscriptionLimitAlmostReached( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "salto_ks_subscription_limit_almost_reached"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedDeviceWarningsSaltoKsLockAccessCodeSupportRemoved_model" - )] - public class UnmanagedDeviceWarningsSaltoKsLockAccessCodeSupportRemoved - : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsSaltoKsLockAccessCodeSupportRemoved() { } - - public UnmanagedDeviceWarningsSaltoKsLockAccessCodeSupportRemoved( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "salto_ks_lock_access_code_support_removed"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsUnknownIssueWithPhone_model")] - public class UnmanagedDeviceWarningsUnknownIssueWithPhone : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsUnknownIssueWithPhone() { } - - public UnmanagedDeviceWarningsUnknownIssueWithPhone( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unknown_issue_with_phone"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsLocklyTimeZoneNotConfigured_model")] - public class UnmanagedDeviceWarningsLocklyTimeZoneNotConfigured : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsLocklyTimeZoneNotConfigured() { } - - public UnmanagedDeviceWarningsLocklyTimeZoneNotConfigured( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "lockly_time_zone_not_configured"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsUltraloqTimeZoneUnknown_model")] - public class UnmanagedDeviceWarningsUltraloqTimeZoneUnknown : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsUltraloqTimeZoneUnknown() { } - - public UnmanagedDeviceWarningsUltraloqTimeZoneUnknown( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "ultraloq_time_zone_unknown"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsTimeZoneUnknown_model")] - public class UnmanagedDeviceWarningsTimeZoneUnknown : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsTimeZoneUnknown() { } - - public UnmanagedDeviceWarningsTimeZoneUnknown( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "time_zone_unknown"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsTimeZoneMismatch_model")] - public class UnmanagedDeviceWarningsTimeZoneMismatch : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsTimeZoneMismatch() { } - - public UnmanagedDeviceWarningsTimeZoneMismatch( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "time_zone_mismatch"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsTwoNDeviceMissingTimezone_model")] - public class UnmanagedDeviceWarningsTwoNDeviceMissingTimezone : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsTwoNDeviceMissingTimezone() { } - - public UnmanagedDeviceWarningsTwoNDeviceMissingTimezone( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "two_n_device_missing_timezone"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedDeviceWarningsHubRequiredForAdditionalCapabilities_model" - )] - public class UnmanagedDeviceWarningsHubRequiredForAdditionalCapabilities - : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsHubRequiredForAdditionalCapabilities() { } - - public UnmanagedDeviceWarningsHubRequiredForAdditionalCapabilities( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "hub_required_for_additional_capabilities"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsProviderIssue_model")] - public class UnmanagedDeviceWarningsProviderIssue : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsProviderIssue() { } - - public UnmanagedDeviceWarningsProviderIssue( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "provider_issue"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsKeynestUnsupportedLocker_model")] - public class UnmanagedDeviceWarningsKeynestUnsupportedLocker : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsKeynestUnsupportedLocker() { } - - public UnmanagedDeviceWarningsKeynestUnsupportedLocker( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "keynest_unsupported_locker"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsAccessoryKeypadSetupRequired_model")] - public class UnmanagedDeviceWarningsAccessoryKeypadSetupRequired : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsAccessoryKeypadSetupRequired() { } - - public UnmanagedDeviceWarningsAccessoryKeypadSetupRequired( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "accessory_keypad_setup_required"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsUnreliableOnlineStatus_model")] - public class UnmanagedDeviceWarningsUnreliableOnlineStatus : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsUnreliableOnlineStatus() { } - - public UnmanagedDeviceWarningsUnreliableOnlineStatus( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unreliable_online_status"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsMaxAccessCodesReached_model")] - public class UnmanagedDeviceWarningsMaxAccessCodesReached : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsMaxAccessCodesReached() { } - - public UnmanagedDeviceWarningsMaxAccessCodesReached( - int activeAccessCodeCount = default, - string createdAt = default, - int maxActiveAccessCodeCount = default, - string message = default, - string warningCode = default - ) - { - ActiveAccessCodeCount = activeAccessCodeCount; - CreatedAt = createdAt; - MaxActiveAccessCodeCount = maxActiveAccessCodeCount; - Message = message; - WarningCode = warningCode; - } - - /// - /// Number of active access codes on the device when the warning was set. - /// - [DataMember( - Name = "active_access_code_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int ActiveAccessCodeCount { get; set; } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Maximum number of active access codes supported by the device. - /// - [DataMember( - Name = "max_active_access_code_count", - IsRequired = false, - EmitDefaultValue = false - )] - public int MaxActiveAccessCodeCount { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "max_access_codes_reached"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceWarningsUnrecognized_model")] - public class UnmanagedDeviceWarningsUnrecognized : UnmanagedDeviceWarnings - { - [JsonConstructorAttribute] - protected UnmanagedDeviceWarningsUnrecognized() { } - - public UnmanagedDeviceWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Indicates whether the lock supports configuring automatic locking. - /// - [DataMember(Name = "can_configure_auto_lock", IsRequired = false, EmitDefaultValue = false)] - public bool? CanConfigureAutoLock { get; set; } - - /// - /// Indicates whether the thermostat supports cooling. - /// - [DataMember(Name = "can_hvac_cool", IsRequired = false, EmitDefaultValue = false)] - public bool? CanHvacCool { get; set; } - - /// - /// Indicates whether the thermostat supports heating. - /// - [DataMember(Name = "can_hvac_heat", IsRequired = false, EmitDefaultValue = false)] - public bool? CanHvacHeat { get; set; } - - /// - /// Indicates whether the thermostat supports simultaneous heating and cooling. - /// - [DataMember(Name = "can_hvac_heat_cool", IsRequired = false, EmitDefaultValue = false)] - public bool? CanHvacHeatCool { get; set; } - - /// - /// Indicates whether the device supports programming offline access codes. - /// - [DataMember( - Name = "can_program_offline_access_codes", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramOfflineAccessCodes { get; set; } - - /// - /// Indicates whether the device supports programming online access codes. - /// - [DataMember( - Name = "can_program_online_access_codes", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramOnlineAccessCodes { get; set; } - - /// - /// Indicates whether the thermostat supports different climate programs for each day of the week. - /// - [DataMember( - Name = "can_program_thermostat_programs_as_different_each_day", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramThermostatProgramsAsDifferentEachDay { get; set; } - - /// - /// Indicates whether the thermostat supports a single climate program applied to every day. - /// - [DataMember( - Name = "can_program_thermostat_programs_as_same_each_day", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramThermostatProgramsAsSameEachDay { get; set; } - - /// - /// Indicates whether the thermostat supports weekday/weekend climate programs. - /// - [DataMember( - Name = "can_program_thermostat_programs_as_weekday_weekend", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramThermostatProgramsAsWeekdayWeekend { get; set; } - - /// - /// Indicates whether the device supports remote locking. - /// - [DataMember(Name = "can_remotely_lock", IsRequired = false, EmitDefaultValue = false)] - public bool? CanRemotelyLock { get; set; } - - /// - /// Indicates whether the device supports remote unlocking. - /// - [DataMember(Name = "can_remotely_unlock", IsRequired = false, EmitDefaultValue = false)] - public bool? CanRemotelyUnlock { get; set; } - - /// - /// Indicates whether the thermostat supports running climate programs. - /// - [DataMember( - Name = "can_run_thermostat_programs", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanRunThermostatPrograms { get; set; } - - /// - /// Indicates whether the device supports simulating connection in a sandbox. - /// - [DataMember(Name = "can_simulate_connection", IsRequired = false, EmitDefaultValue = false)] - public bool? CanSimulateConnection { get; set; } - - /// - /// Indicates whether the device supports simulating disconnection in a sandbox. - /// - [DataMember( - Name = "can_simulate_disconnection", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulateDisconnection { get; set; } - - /// - /// Indicates whether the hub supports simulating connection in a sandbox. - /// - [DataMember( - Name = "can_simulate_hub_connection", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulateHubConnection { get; set; } - - /// - /// Indicates whether the hub supports simulating disconnection in a sandbox. - /// - [DataMember( - Name = "can_simulate_hub_disconnection", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulateHubDisconnection { get; set; } - - /// - /// Indicates whether the device supports simulating a paid subscription in a sandbox. - /// - [DataMember( - Name = "can_simulate_paid_subscription", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulatePaidSubscription { get; set; } - - /// - /// Indicates whether the device supports simulating removal in a sandbox. - /// - [DataMember(Name = "can_simulate_removal", IsRequired = false, EmitDefaultValue = false)] - public bool? CanSimulateRemoval { get; set; } - - /// - /// Indicates whether the thermostat can be turned off. - /// - [DataMember(Name = "can_turn_off_hvac", IsRequired = false, EmitDefaultValue = false)] - public bool? CanTurnOffHvac { get; set; } - - /// - /// Indicates whether the lock supports unlocking with an access code. - /// - [DataMember(Name = "can_unlock_with_code", IsRequired = false, EmitDefaultValue = false)] - public bool? CanUnlockWithCode { get; set; } - - /// - /// Collection of capabilities that the device supports when connected to Seam. Values are `access_code`, which indicates that the device can manage and utilize digital PIN codes for secure access; `lock`, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; `noise_detection`, which indicates that the device supports monitoring and responding to ambient noise levels; `thermostat`, which indicates that the device can regulate and adjust indoor temperatures; `battery`, which indicates that the device can manage battery life and health; and `phone`, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). - /// - [DataMember(Name = "capabilities_supported", IsRequired = false, EmitDefaultValue = false)] - public List CapabilitiesSupported { get; set; } - - /// - /// Unique identifier for the account associated with the device. - /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectedAccountId { get; set; } - - /// - /// Date and time at which the device object was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. - /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object CustomMetadata { get; set; } - - /// - /// ID of the device. - /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string DeviceId { get; set; } - - /// - /// Type of the device. - /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedDevice.DeviceTypeEnum DeviceType { get; set; } - - /// - /// Display name of the device, defaults to nickname (if it is set) or `properties.appearance.name`, otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Array of errors associated with the device. Each error object within the array contains two fields: `error_code` and `message`. `error_code` is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Indicates that Seam does not manage the device. - /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool IsManaged { get; set; } - - /// - /// Location information for the device. - /// - [DataMember(Name = "location", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedDeviceLocation? Location { get; set; } - - /// - /// properties of the device. - /// - [DataMember(Name = "properties", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedDeviceProperties Properties { get; set; } - - /// - /// Array of warnings associated with the device. Each warning object within the array contains two fields: `warning_code` and `message`. `warning_code` is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// Unique identifier for the Seam workspace associated with the device. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceLocation_model")] - public class UnmanagedDeviceLocation - { - [JsonConstructorAttribute] - protected UnmanagedDeviceLocation() { } - - public UnmanagedDeviceLocation( - string? locationName = default, - string? roomName = default, - string? timeZone = default, - string? timezone = default - ) - { - LocationName = locationName; - RoomName = roomName; - TimeZone = timeZone; - Timezone = timezone; - } - - /// - /// Name of the device location. - /// - [DataMember(Name = "location_name", IsRequired = false, EmitDefaultValue = false)] - public string? LocationName { get; set; } - - /// - /// Name of the room within the device location, when the provider reports one. - /// - [DataMember(Name = "room_name", IsRequired = false, EmitDefaultValue = false)] - public string? RoomName { get; set; } - - /// - /// Time zone of the device location. - /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public string? TimeZone { get; set; } - - /// - /// Time zone of the device location. - /// - [Obsolete("Use `time_zone` instead.")] - [DataMember(Name = "timezone", IsRequired = false, EmitDefaultValue = false)] - public string? Timezone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDeviceProperties_model")] - public class UnmanagedDeviceProperties - { - [JsonConstructorAttribute] - protected UnmanagedDeviceProperties() { } - - public UnmanagedDeviceProperties( - UnmanagedDevicePropertiesAccessoryKeypad? accessoryKeypad = default, - UnmanagedDevicePropertiesBattery? battery = default, - float? batteryLevel = default, - string? imageAltText = default, - string? imageUrl = default, - string? manufacturer = default, - UnmanagedDevicePropertiesModel model = default, - string name = default, - bool? offlineAccessCodesEnabled = default, - bool online = default, - bool? onlineAccessCodesEnabled = default - ) - { - AccessoryKeypad = accessoryKeypad; - Battery = battery; - BatteryLevel = batteryLevel; - ImageAltText = imageAltText; - ImageUrl = imageUrl; - Manufacturer = manufacturer; - Model = model; - Name = name; - OfflineAccessCodesEnabled = offlineAccessCodesEnabled; - Online = online; - OnlineAccessCodesEnabled = onlineAccessCodesEnabled; - } - - /// - /// Accessory keypad properties and state. - /// - [DataMember(Name = "accessory_keypad", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedDevicePropertiesAccessoryKeypad? AccessoryKeypad { get; set; } - - /// - /// Represents the current status of the battery charge level. - /// - [DataMember(Name = "battery", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedDevicePropertiesBattery? Battery { get; set; } - - /// - /// Indicates the battery level of the device as a decimal value between 0 and 1, inclusive. - /// - [DataMember(Name = "battery_level", IsRequired = false, EmitDefaultValue = false)] - public float? BatteryLevel { get; set; } - - /// - /// Alt text for the device image. - /// - [DataMember(Name = "image_alt_text", IsRequired = false, EmitDefaultValue = false)] - public string? ImageAltText { get; set; } - - /// - /// Image URL for the device. - /// - [DataMember(Name = "image_url", IsRequired = false, EmitDefaultValue = false)] - public string? ImageUrl { get; set; } - - /// - /// Manufacturer of the device. When a device, such as a smart lock, is connected through a smart hub, the manufacturer of the device might be different from that of the smart hub. - /// - [DataMember(Name = "manufacturer", IsRequired = false, EmitDefaultValue = false)] - public string? Manufacturer { get; set; } - - /// - /// Device model-related properties. - /// - [DataMember(Name = "model", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedDevicePropertiesModel Model { get; set; } - - /// - /// Name of the device. - /// - [Obsolete("use device.display_name instead")] - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// Indicates whether it is currently possible to use offline access codes for the device. - /// - [Obsolete("use device.can_program_offline_access_codes")] - [DataMember( - Name = "offline_access_codes_enabled", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? OfflineAccessCodesEnabled { get; set; } - - /// - /// Indicates whether the device is online. - /// - [DataMember(Name = "online", IsRequired = false, EmitDefaultValue = false)] - public bool Online { get; set; } - - /// - /// Indicates whether it is currently possible to use online access codes for the device. - /// - [Obsolete("use device.can_program_online_access_codes")] - [DataMember( - Name = "online_access_codes_enabled", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? OnlineAccessCodesEnabled { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDevicePropertiesAccessoryKeypad_model")] - public class UnmanagedDevicePropertiesAccessoryKeypad - { - [JsonConstructorAttribute] - protected UnmanagedDevicePropertiesAccessoryKeypad() { } - - public UnmanagedDevicePropertiesAccessoryKeypad( - UnmanagedDevicePropertiesAccessoryKeypadBattery? battery = default, - bool isConnected = default - ) - { - Battery = battery; - IsConnected = isConnected; - } - - /// - /// Keypad battery properties. - /// - [DataMember(Name = "battery", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedDevicePropertiesAccessoryKeypadBattery? Battery { get; set; } - - /// - /// Indicates if an accessory keypad is connected to the device. - /// - [DataMember(Name = "is_connected", IsRequired = false, EmitDefaultValue = false)] - public bool IsConnected { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDevicePropertiesAccessoryKeypadBattery_model")] - public class UnmanagedDevicePropertiesAccessoryKeypadBattery - { - [JsonConstructorAttribute] - protected UnmanagedDevicePropertiesAccessoryKeypadBattery() { } - - public UnmanagedDevicePropertiesAccessoryKeypadBattery(float level = default) - { - Level = level; - } - - [DataMember(Name = "level", IsRequired = false, EmitDefaultValue = false)] - public float Level { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDevicePropertiesBattery_model")] - public class UnmanagedDevicePropertiesBattery - { - [JsonConstructorAttribute] - protected UnmanagedDevicePropertiesBattery() { } - - public UnmanagedDevicePropertiesBattery( - float level = default, - UnmanagedDevicePropertiesBattery.StatusEnum status = default - ) - { - Level = level; - Status = status; - } - - /// - /// Represents the current status of the battery charge level. Values are `critical`, which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; `low`, which signifies that the battery is under the preferred threshold and should be charged soon; `good`, which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and `full`, which represents a battery that is fully charged, providing the maximum duration of usage. - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum StatusEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "critical")] - Critical = 1, - - [EnumMember(Value = "low")] - Low = 2, - - [EnumMember(Value = "good")] - Good = 3, - - [EnumMember(Value = "full")] - Full = 4, - } - - /// - /// Battery charge level as a value between 0 and 1, inclusive. - /// - [DataMember(Name = "level", IsRequired = false, EmitDefaultValue = false)] - public float Level { get; set; } - - /// - /// Represents the current status of the battery charge level. Values are `critical`, which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; `low`, which signifies that the battery is under the preferred threshold and should be charged soon; `good`, which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and `full`, which represents a battery that is fully charged, providing the maximum duration of usage. - /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public UnmanagedDevicePropertiesBattery.StatusEnum Status { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedDevicePropertiesModel_model")] - public class UnmanagedDevicePropertiesModel - { - [JsonConstructorAttribute] - protected UnmanagedDevicePropertiesModel() { } - - public UnmanagedDevicePropertiesModel( - bool? accessoryKeypadSupported = default, - bool? canConnectAccessoryKeypad = default, - string displayName = default, - bool? hasBuiltInKeypad = default, - string manufacturerDisplayName = default, - bool? offlineAccessCodesSupported = default, - bool? onlineAccessCodesSupported = default - ) - { - AccessoryKeypadSupported = accessoryKeypadSupported; - CanConnectAccessoryKeypad = canConnectAccessoryKeypad; - DisplayName = displayName; - HasBuiltInKeypad = hasBuiltInKeypad; - ManufacturerDisplayName = manufacturerDisplayName; - OfflineAccessCodesSupported = offlineAccessCodesSupported; - OnlineAccessCodesSupported = onlineAccessCodesSupported; - } - - [Obsolete("use device.properties.model.can_connect_accessory_keypad")] - [DataMember( - Name = "accessory_keypad_supported", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? AccessoryKeypadSupported { get; set; } - - /// - /// Indicates whether the device can connect a accessory keypad. - /// - [DataMember( - Name = "can_connect_accessory_keypad", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanConnectAccessoryKeypad { get; set; } - - /// - /// Display name of the device model. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Indicates whether the device has a built in accessory keypad. - /// - [DataMember(Name = "has_built_in_keypad", IsRequired = false, EmitDefaultValue = false)] - public bool? HasBuiltInKeypad { get; set; } - - /// - /// Display name that corresponds to the manufacturer-specific terminology for the device. - /// - [DataMember( - Name = "manufacturer_display_name", - IsRequired = false, - EmitDefaultValue = false - )] - public string ManufacturerDisplayName { get; set; } - - [Obsolete("use device.can_program_offline_access_codes.")] - [DataMember( - Name = "offline_access_codes_supported", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? OfflineAccessCodesSupported { get; set; } - - [Obsolete("use device.can_program_online_access_codes.")] - [DataMember( - Name = "online_access_codes_supported", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? OnlineAccessCodesSupported { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/UnmanagedUserIdentity.cs b/src/Seam/Model/UnmanagedUserIdentity.cs deleted file mode 100644 index 4bada5ab..00000000 --- a/src/Seam/Model/UnmanagedUserIdentity.cs +++ /dev/null @@ -1,486 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents an unmanaged user identity. Unmanaged user identities do not have keys. - /// - [DataContract(Name = "seamModel_unmanagedUserIdentity_model")] - public class UnmanagedUserIdentity - { - [JsonConstructorAttribute] - protected UnmanagedUserIdentity() { } - - public UnmanagedUserIdentity( - List acsUserIds = default, - string createdAt = default, - string displayName = default, - string? emailAddress = default, - List errors = default, - string? fullName = default, - List mergedUserIdentityIds = default, - List mergedUserIdentityKeys = default, - string? phoneNumber = default, - string userIdentityId = default, - List warnings = default, - string workspaceId = default - ) - { - AcsUserIds = acsUserIds; - CreatedAt = createdAt; - DisplayName = displayName; - EmailAddress = emailAddress; - Errors = errors; - FullName = fullName; - MergedUserIdentityIds = mergedUserIdentityIds; - MergedUserIdentityKeys = mergedUserIdentityKeys; - PhoneNumber = phoneNumber; - UserIdentityId = userIdentityId; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedUserIdentityErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedUserIdentityErrorsIssueWithAcsUser), - "issue_with_acs_user" - )] - public abstract class UnmanagedUserIdentityErrors - { - public abstract string ErrorCode { get; } - - public abstract string AcsSystemId { get; set; } - - public abstract string AcsUserId { get; set; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedUserIdentityErrorsIssueWithAcsUser_model")] - public class UnmanagedUserIdentityErrorsIssueWithAcsUser : UnmanagedUserIdentityErrors - { - [JsonConstructorAttribute] - protected UnmanagedUserIdentityErrorsIssueWithAcsUser() { } - - public UnmanagedUserIdentityErrorsIssueWithAcsUser( - string acsSystemId = default, - string acsUserId = default, - string createdAt = default, - string errorCode = default, - string message = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// ID of the access system that the user identity is associated with. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public override string AcsSystemId { get; set; } - - /// - /// ID of the access system user that has an issue. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public override string AcsUserId { get; set; } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "issue_with_acs_user"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedUserIdentityErrorsUnrecognized_model")] - public class UnmanagedUserIdentityErrorsUnrecognized : UnmanagedUserIdentityErrors - { - [JsonConstructorAttribute] - protected UnmanagedUserIdentityErrorsUnrecognized() { } - - public UnmanagedUserIdentityErrorsUnrecognized( - string errorCode = default, - string acsSystemId = default, - string acsUserId = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// ID of the access system that the user identity is associated with. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public override string AcsSystemId { get; set; } - - /// - /// ID of the access system user that has an issue. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public override string AcsUserId { get; set; } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(UnmanagedUserIdentityWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedUserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity), - "acs_user_profile_does_not_match_user_identity" - )] - [JsonSubtypes.KnownSubType( - typeof(UnmanagedUserIdentityWarningsBeingDeleted), - "being_deleted" - )] - public abstract class UnmanagedUserIdentityWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_unmanagedUserIdentityWarningsBeingDeleted_model")] - public class UnmanagedUserIdentityWarningsBeingDeleted : UnmanagedUserIdentityWarnings - { - [JsonConstructorAttribute] - protected UnmanagedUserIdentityWarningsBeingDeleted() { } - - public UnmanagedUserIdentityWarningsBeingDeleted( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_unmanagedUserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity_model" - )] - public class UnmanagedUserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity - : UnmanagedUserIdentityWarnings - { - [JsonConstructorAttribute] - protected UnmanagedUserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity() { } - - public UnmanagedUserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "acs_user_profile_does_not_match_user_identity"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_unmanagedUserIdentityWarningsUnrecognized_model")] - public class UnmanagedUserIdentityWarningsUnrecognized : UnmanagedUserIdentityWarnings - { - [JsonConstructorAttribute] - protected UnmanagedUserIdentityWarningsUnrecognized() { } - - public UnmanagedUserIdentityWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Array of access system user IDs associated with the user identity. - /// - [DataMember(Name = "acs_user_ids", IsRequired = false, EmitDefaultValue = false)] - public List AcsUserIds { get; set; } - - /// - /// Date and time at which the user identity was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name for the user identity. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Unique email address for the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Array of errors associated with the user identity. Each error object within the array contains fields like "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Full name of the user associated with the user identity. - /// - [DataMember(Name = "full_name", IsRequired = false, EmitDefaultValue = false)] - public string? FullName { get; set; } - - /// - /// IDs that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. - /// - [DataMember( - Name = "merged_user_identity_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List MergedUserIdentityIds { get; set; } - - /// - /// Keys that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. - /// - [DataMember( - Name = "merged_user_identity_keys", - IsRequired = false, - EmitDefaultValue = false - )] - public List MergedUserIdentityKeys { get; set; } - - /// - /// Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// ID of the user identity. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - /// - /// Array of warnings associated with the user identity. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the user identity. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/UserIdentity.cs b/src/Seam/Model/UserIdentity.cs deleted file mode 100644 index 7a28e98c..00000000 --- a/src/Seam/Model/UserIdentity.cs +++ /dev/null @@ -1,491 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with an application user account. - /// - [DataContract(Name = "seamModel_userIdentity_model")] - public class UserIdentity - { - [JsonConstructorAttribute] - protected UserIdentity() { } - - public UserIdentity( - List acsUserIds = default, - string createdAt = default, - string displayName = default, - string? emailAddress = default, - List errors = default, - string? fullName = default, - List mergedUserIdentityIds = default, - List mergedUserIdentityKeys = default, - string? phoneNumber = default, - string userIdentityId = default, - string? userIdentityKey = default, - List warnings = default, - string workspaceId = default - ) - { - AcsUserIds = acsUserIds; - CreatedAt = createdAt; - DisplayName = displayName; - EmailAddress = emailAddress; - Errors = errors; - FullName = fullName; - MergedUserIdentityIds = mergedUserIdentityIds; - MergedUserIdentityKeys = mergedUserIdentityKeys; - PhoneNumber = phoneNumber; - UserIdentityId = userIdentityId; - UserIdentityKey = userIdentityKey; - Warnings = warnings; - WorkspaceId = workspaceId; - } - - [JsonConverter(typeof(JsonSubtypes), "error_code")] - [JsonSubtypes.FallBackSubType(typeof(UserIdentityErrorsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UserIdentityErrorsIssueWithAcsUser), - "issue_with_acs_user" - )] - public abstract class UserIdentityErrors - { - public abstract string ErrorCode { get; } - - public abstract string AcsSystemId { get; set; } - - public abstract string AcsUserId { get; set; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_userIdentityErrorsIssueWithAcsUser_model")] - public class UserIdentityErrorsIssueWithAcsUser : UserIdentityErrors - { - [JsonConstructorAttribute] - protected UserIdentityErrorsIssueWithAcsUser() { } - - public UserIdentityErrorsIssueWithAcsUser( - string acsSystemId = default, - string acsUserId = default, - string createdAt = default, - string errorCode = default, - string message = default - ) - { - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - CreatedAt = createdAt; - ErrorCode = errorCode; - Message = message; - } - - /// - /// ID of the access system that the user identity is associated with. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public override string AcsSystemId { get; set; } - - /// - /// ID of the access system user that has an issue. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public override string AcsUserId { get; set; } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "issue_with_acs_user"; - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_userIdentityErrorsUnrecognized_model")] - public class UserIdentityErrorsUnrecognized : UserIdentityErrors - { - [JsonConstructorAttribute] - protected UserIdentityErrorsUnrecognized() { } - - public UserIdentityErrorsUnrecognized( - string errorCode = default, - string acsSystemId = default, - string acsUserId = default, - string createdAt = default, - string message = default - ) - { - ErrorCode = errorCode; - AcsSystemId = acsSystemId; - AcsUserId = acsUserId; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "error_code", IsRequired = true, EmitDefaultValue = false)] - public override string ErrorCode { get; } = "unrecognized"; - - /// - /// ID of the access system that the user identity is associated with. - /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public override string AcsSystemId { get; set; } - - /// - /// ID of the access system user that has an issue. - /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public override string AcsUserId { get; set; } - - /// - /// Date and time at which Seam created the error. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [JsonConverter(typeof(JsonSubtypes), "warning_code")] - [JsonSubtypes.FallBackSubType(typeof(UserIdentityWarningsUnrecognized))] - [JsonSubtypes.KnownSubType( - typeof(UserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity), - "acs_user_profile_does_not_match_user_identity" - )] - [JsonSubtypes.KnownSubType(typeof(UserIdentityWarningsBeingDeleted), "being_deleted")] - public abstract class UserIdentityWarnings - { - public abstract string WarningCode { get; } - - public abstract string CreatedAt { get; set; } - - public abstract string Message { get; set; } - - public abstract override string ToString(); - } - - [DataContract(Name = "seamModel_userIdentityWarningsBeingDeleted_model")] - public class UserIdentityWarningsBeingDeleted : UserIdentityWarnings - { - [JsonConstructorAttribute] - protected UserIdentityWarningsBeingDeleted() { } - - public UserIdentityWarningsBeingDeleted( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "being_deleted"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract( - Name = "seamModel_userIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity_model" - )] - public class UserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity - : UserIdentityWarnings - { - [JsonConstructorAttribute] - protected UserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity() { } - - public UserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity( - string createdAt = default, - string message = default, - string warningCode = default - ) - { - CreatedAt = createdAt; - Message = message; - WarningCode = warningCode; - } - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = - "acs_user_profile_does_not_match_user_identity"; - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_userIdentityWarningsUnrecognized_model")] - public class UserIdentityWarningsUnrecognized : UserIdentityWarnings - { - [JsonConstructorAttribute] - protected UserIdentityWarningsUnrecognized() { } - - public UserIdentityWarningsUnrecognized( - string warningCode = default, - string createdAt = default, - string message = default - ) - { - WarningCode = warningCode; - CreatedAt = createdAt; - Message = message; - } - - [DataMember(Name = "warning_code", IsRequired = true, EmitDefaultValue = false)] - public override string WarningCode { get; } = "unrecognized"; - - /// - /// Date and time at which Seam created the warning. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public override string CreatedAt { get; set; } - - /// - /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "message", IsRequired = false, EmitDefaultValue = false)] - public override string Message { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Array of access system user IDs associated with the user identity. - /// - [DataMember(Name = "acs_user_ids", IsRequired = false, EmitDefaultValue = false)] - public List AcsUserIds { get; set; } - - /// - /// Date and time at which the user identity was created. - /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } - - /// - /// Display name for the user identity. - /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } - - /// - /// Unique email address for the user identity. - /// - [DataMember(Name = "email_address", IsRequired = false, EmitDefaultValue = false)] - public string? EmailAddress { get; set; } - - /// - /// Array of errors associated with the user identity. Each error object within the array contains fields like "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "errors", IsRequired = false, EmitDefaultValue = false)] - public List Errors { get; set; } - - /// - /// Full name of the user associated with the user identity. - /// - [DataMember(Name = "full_name", IsRequired = false, EmitDefaultValue = false)] - public string? FullName { get; set; } - - /// - /// IDs that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. - /// - [DataMember( - Name = "merged_user_identity_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List MergedUserIdentityIds { get; set; } - - /// - /// Keys that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. - /// - [DataMember( - Name = "merged_user_identity_keys", - IsRequired = false, - EmitDefaultValue = false - )] - public List MergedUserIdentityKeys { get; set; } - - /// - /// Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). - /// - [DataMember(Name = "phone_number", IsRequired = false, EmitDefaultValue = false)] - public string? PhoneNumber { get; set; } - - /// - /// ID of the user identity. - /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string UserIdentityId { get; set; } - - /// - /// Unique key for the user identity. - /// - [DataMember(Name = "user_identity_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityKey { get; set; } - - /// - /// Array of warnings associated with the user identity. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. - /// - [DataMember(Name = "warnings", IsRequired = false, EmitDefaultValue = false)] - public List Warnings { get; set; } - - /// - /// ID of the workspace that contains the user identity. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/Webhook.cs b/src/Seam/Model/Webhook.cs deleted file mode 100644 index ba425ddb..00000000 --- a/src/Seam/Model/Webhook.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a [webhook](https://docs.seam.co/developer-tools/webhooks) that enables you to receive notifications of events. When you create a webhook, specify the endpoint URL at which you want to receive events and the set of event types that you want to receive. - /// - [DataContract(Name = "seamModel_webhook_model")] - public class Webhook - { - [JsonConstructorAttribute] - protected Webhook() { } - - public Webhook( - List? eventTypes = default, - string? secret = default, - string url = default, - string webhookId = default - ) - { - EventTypes = eventTypes; - Secret = secret; - Url = url; - WebhookId = webhookId; - } - - /// - /// Types of events that the [webhook](https://docs.seam.co/developer-tools/webhooks) should receive. - /// - [DataMember(Name = "event_types", IsRequired = false, EmitDefaultValue = false)] - public List? EventTypes { get; set; } - - /// - /// Secret associated with the [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - [DataMember(Name = "secret", IsRequired = false, EmitDefaultValue = false)] - public string? Secret { get; set; } - - /// - /// URL for the [webhook](https://docs.seam.co/developer-tools/webhooks). - /// - [DataMember(Name = "url", IsRequired = false, EmitDefaultValue = false)] - public string Url { get; set; } - - /// - /// ID of the webhook. - /// - [DataMember(Name = "webhook_id", IsRequired = false, EmitDefaultValue = false)] - public string WebhookId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Model/Workspace.cs b/src/Seam/Model/Workspace.cs deleted file mode 100644 index ed6f1991..00000000 --- a/src/Seam/Model/Workspace.cs +++ /dev/null @@ -1,221 +0,0 @@ -using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model -{ - /// - /// Represents a Seam [workspace](https://docs.seam.co/core-concepts/workspaces). A workspace is a top-level entity that encompasses all other resources below it, such as devices, connected accounts, and Connect Webviews. Seam provides two types of workspaces. A [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) is a special type of workspace designed for testing code. Sandbox workspaces offer test device accounts and virtual devices that you can connect and control. This ability to work with virtual devices is quite handy because it removes the need to own physical devices from multiple brands. To connect real devices and systems to Seam, use a [production workspace](https://docs.seam.co/core-concepts/workspaces#production-workspaces). - /// - [DataContract(Name = "seamModel_workspace_model")] - public class Workspace - { - [JsonConstructorAttribute] - protected Workspace() { } - - public Workspace( - string companyName = default, - string? connectPartnerName = default, - WorkspaceConnectWebviewCustomization connectWebviewCustomization = default, - bool isPublishableKeyAuthEnabled = default, - bool isSandbox = default, - bool isSuspended = default, - string name = default, - string? organizationId = default, - string? publishableKey = default, - string workspaceId = default - ) - { - CompanyName = companyName; - ConnectPartnerName = connectPartnerName; - ConnectWebviewCustomization = connectWebviewCustomization; - IsPublishableKeyAuthEnabled = isPublishableKeyAuthEnabled; - IsSandbox = isSandbox; - IsSuspended = isSuspended; - Name = name; - OrganizationId = organizationId; - PublishableKey = publishableKey; - WorkspaceId = workspaceId; - } - - /// - /// Company name associated with the [workspace](https://docs.seam.co/core-concepts/workspaces). - /// - [Obsolete("Use `connect_partner_name` instead.")] - [DataMember(Name = "company_name", IsRequired = false, EmitDefaultValue = false)] - public string CompanyName { get; set; } - - /// - /// Seam Connect partner name associated with the [workspace](https://docs.seam.co/core-concepts/workspaces). - /// - [DataMember(Name = "connect_partner_name", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectPartnerName { get; set; } - - [DataMember( - Name = "connect_webview_customization", - IsRequired = false, - EmitDefaultValue = false - )] - public WorkspaceConnectWebviewCustomization ConnectWebviewCustomization { get; set; } - - /// - /// Indicates whether publishable key authentication is enabled for this workspace. - /// - [DataMember( - Name = "is_publishable_key_auth_enabled", - IsRequired = false, - EmitDefaultValue = false - )] - public bool IsPublishableKeyAuthEnabled { get; set; } - - /// - /// Indicates whether the workspace is a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). - /// - [DataMember(Name = "is_sandbox", IsRequired = false, EmitDefaultValue = false)] - public bool IsSandbox { get; set; } - - /// - /// Indicates whether the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) is suspended. Seam suspends sandbox workspaces that have not been accessed in 14 days. - /// - [DataMember(Name = "is_suspended", IsRequired = false, EmitDefaultValue = false)] - public bool IsSuspended { get; set; } - - /// - /// Name of the [workspace](https://docs.seam.co/core-concepts/workspaces). - /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// ID of the organization to which the workspace belongs, or `null` if the workspace is not assigned to an organization. - /// - [DataMember(Name = "organization_id", IsRequired = false, EmitDefaultValue = false)] - public string? OrganizationId { get; set; } - - /// - /// Publishable key for the [workspace](https://docs.seam.co/core-concepts/workspaces). This key is used to identify the workspace in client-side applications. - /// - [DataMember(Name = "publishable_key", IsRequired = false, EmitDefaultValue = false)] - public string? PublishableKey { get; set; } - - /// - /// ID of the workspace. - /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - [DataContract(Name = "seamModel_workspaceConnectWebviewCustomization_model")] - public class WorkspaceConnectWebviewCustomization - { - [JsonConstructorAttribute] - protected WorkspaceConnectWebviewCustomization() { } - - public WorkspaceConnectWebviewCustomization( - string? inviterLogoUrl = default, - WorkspaceConnectWebviewCustomization.LogoShapeEnum? logoShape = default, - string? primaryButtonColor = default, - string? primaryButtonTextColor = default, - string? successMessage = default - ) - { - InviterLogoUrl = inviterLogoUrl; - LogoShape = logoShape; - PrimaryButtonColor = primaryButtonColor; - PrimaryButtonTextColor = primaryButtonTextColor; - SuccessMessage = successMessage; - } - - /// - /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [JsonConverter(typeof(SafeStringEnumConverter))] - public enum LogoShapeEnum - { - [EnumMember(Value = "unrecognized")] - Unrecognized = 0, - - [EnumMember(Value = "circle")] - Circle = 1, - - [EnumMember(Value = "square")] - Square = 2, - } - - /// - /// URL of the inviter logo for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember(Name = "inviter_logo_url", IsRequired = false, EmitDefaultValue = false)] - public string? InviterLogoUrl { get; set; } - - /// - /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember(Name = "logo_shape", IsRequired = false, EmitDefaultValue = false)] - public WorkspaceConnectWebviewCustomization.LogoShapeEnum? LogoShape { get; set; } - - /// - /// Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember(Name = "primary_button_color", IsRequired = false, EmitDefaultValue = false)] - public string? PrimaryButtonColor { get; set; } - - /// - /// Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember( - Name = "primary_button_text_color", - IsRequired = false, - EmitDefaultValue = false - )] - public string? PrimaryButtonTextColor { get; set; } - - /// - /// Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). - /// - [DataMember(Name = "success_message", IsRequired = false, EmitDefaultValue = false)] - public string? SuccessMessage { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } -} diff --git a/src/Seam/Models/AccessCode.cs b/src/Seam/Models/AccessCode.cs new file mode 100644 index 00000000..82da3062 --- /dev/null +++ b/src/Seam/Models/AccessCode.cs @@ -0,0 +1,1291 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a smart lock [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + /// An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. Using the Seam Access Code API, you can easily generate access codes on the hundreds of door lock models with which we integrate. + /// + /// Seam supports programming two types of access codes: [ongoing](https://docs.seam.co/low-level-apis/smart-locks/access-codes#ongoing-access-codes) and [time-bound](https://docs.seam.co/low-level-apis/smart-locks/access-codes#time-bound-access-codes). To differentiate between the two, refer to the `type` property of the access code. Ongoing codes display as `ongoing`, whereas time-bound codes are labeled `time_bound`. An ongoing access code is active, until it has been removed from the device. To specify an ongoing access code, leave both `starts_at` and `ends_at` empty. A time-bound access code will be programmed at the `starts_at` time and removed at the `ends_at` time. + /// + /// In addition, for certain devices, Seam also supports [offline access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes#offline-access-codes). Offline access (PIN) codes are designed for door locks that might not always maintain an internet connection. For this type of access code, the device manufacturer uses encryption keys (tokens) to create server-based registries of algorithmically-generated offline PIN codes. Because the tokens remain synchronized with the managed devices, the locks do not require an active internet connection—and you do not need to be near the locks—to create an offline access code. Then, owners or managers can share these offline codes with users through a variety of mechanisms, such as messaging applications. That is, lock users do not need to install a smartphone application to receive an offline access code. + /// + /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. + /// + public sealed record AccessCode + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("provider_issue", typeof(AccessCodeErrorsProviderIssue))] + [SeamUnionVariant("failed_to_set_on_device", typeof(AccessCodeErrorsFailedToSetOnDevice))] + [SeamUnionVariant( + "failed_to_remove_from_device", + typeof(AccessCodeErrorsFailedToRemoveFromDevice) + )] + [SeamUnionVariant( + "duplicate_code_on_device", + typeof(AccessCodeErrorsDuplicateCodeOnDevice) + )] + [SeamUnionVariant( + "no_space_for_access_code_on_device", + typeof(AccessCodeErrorsNoSpaceForAccessCodeOnDevice) + )] + [SeamUnionVariant( + "conflicting_external_modification", + typeof(AccessCodeErrorsConflictingExternalModification) + )] + [SeamUnionVariant("access_code_inactive", typeof(AccessCodeErrorsAccessCodeInactive))] + [SeamUnionVariant( + "code_constraints_violated", + typeof(AccessCodeErrorsCodeConstraintsViolated) + )] + [SeamUnionVariant("failed_to_issue", typeof(AccessCodeErrorsFailedToIssue))] + [SeamUnionVariant( + "failed_to_apply_mutations", + typeof(AccessCodeErrorsFailedToApplyMutations) + )] + [SeamUnionVariant("failed_to_expire", typeof(AccessCodeErrorsFailedToExpire))] + [SeamUnionVariant("account_disconnected", typeof(AccessCodeErrorsAccountDisconnected))] + [SeamUnionVariant( + "salto_ks_subscription_limit_exceeded", + typeof(AccessCodeErrorsSaltoKsSubscriptionLimitExceeded) + )] + [SeamUnionVariant( + "insufficient_permissions", + typeof(AccessCodeErrorsInsufficientPermissions) + )] + [SeamUnionVariant( + "dormakaba_sites_disconnected", + typeof(AccessCodeErrorsDormakabaSitesDisconnected) + )] + [SeamUnionVariant("device_offline", typeof(AccessCodeErrorsDeviceOffline))] + [SeamUnionVariant("device_removed", typeof(AccessCodeErrorsDeviceRemoved))] + [SeamUnionVariant("hub_disconnected", typeof(AccessCodeErrorsHubDisconnected))] + [SeamUnionVariant("device_disconnected", typeof(AccessCodeErrorsDeviceDisconnected))] + [SeamUnionVariant( + "empty_backup_access_code_pool", + typeof(AccessCodeErrorsEmptyBackupAccessCodePool) + )] + [SeamUnionVariant( + "august_lock_not_authorized", + typeof(AccessCodeErrorsAugustLockNotAuthorized) + )] + [SeamUnionVariant( + "missing_device_credentials", + typeof(AccessCodeErrorsMissingDeviceCredentials) + )] + [SeamUnionVariant("auxiliary_heat_running", typeof(AccessCodeErrorsAuxiliaryHeatRunning))] + [SeamUnionVariant("subscription_required", typeof(AccessCodeErrorsSubscriptionRequired))] + [SeamUnionVariant("bridge_disconnected", typeof(AccessCodeErrorsBridgeDisconnected))] + [SeamUnionFallback(typeof(AccessCodeErrorsUnrecognized))] + public abstract record AccessCodeErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessCodeErrorsProviderIssue : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "provider_issue"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsFailedToSetOnDevice : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_set_on_device"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsFailedToRemoveFromDevice : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_remove_from_device"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsDuplicateCodeOnDevice : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "duplicate_code_on_device"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + + /// + /// ID of the managed access code that conflicts with this managed access code, when Seam can identify it. + /// + [JsonPropertyName("managed_access_code_id")] + public string? ManagedAccessCodeId { get; init; } + + /// + /// ID of the unmanaged access code that conflicts with this managed access code, when Seam can identify it. + /// + [JsonPropertyName("unmanaged_access_code_id")] + public string? UnmanagedAccessCodeId { get; init; } + } + + public sealed record AccessCodeErrorsNoSpaceForAccessCodeOnDevice : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "no_space_for_access_code_on_device"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsConflictingExternalModification : AccessCodeErrors + { + /// + /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ChangeTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "modified")] + Modified = 1, + + [EnumMember(Value = "removed")] + Removed = 2, + } + + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "conflicting_external_modification"; + + /// + /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. + /// + [JsonPropertyName("change_type")] + public AccessCodeErrorsConflictingExternalModification.ChangeTypeEnum? ChangeType { get; init; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + + /// + /// List of fields that were changed externally, with their previous and new values. + /// + [JsonPropertyName("modified_fields")] + public List? ModifiedFields { get; init; } + } + + public sealed record AccessCodeErrorsConflictingExternalModificationModifiedFields + { + /// + /// The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). + /// + [JsonPropertyName("field")] + public string Field { get; init; } = default!; + + /// + /// The previous value of the field. + /// + [JsonPropertyName("from")] + public string? From { get; init; } + + /// + /// The new value of the field. + /// + [JsonPropertyName("to")] + public string? To { get; init; } + } + + public sealed record AccessCodeErrorsAccessCodeInactive : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "access_code_inactive"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsCodeConstraintsViolated : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "code_constraints_violated"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsFailedToIssue : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_issue"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsFailedToApplyMutations : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_apply_mutations"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsFailedToExpire : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_expire"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsAccountDisconnected : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "account_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsSaltoKsSubscriptionLimitExceeded : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsInsufficientPermissions : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "insufficient_permissions"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsDormakabaSitesDisconnected : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsDeviceOffline : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_offline"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsDeviceRemoved : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_removed"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsHubDisconnected : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "hub_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsDeviceDisconnected : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsEmptyBackupAccessCodePool : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "empty_backup_access_code_pool"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsAugustLockNotAuthorized : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "august_lock_not_authorized"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsMissingDeviceCredentials : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "missing_device_credentials"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsAuxiliaryHeatRunning : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "auxiliary_heat_running"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsSubscriptionRequired : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "subscription_required"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record AccessCodeErrorsBridgeDisconnected : AccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "bridge_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). + /// + [JsonPropertyName("is_bridge_error")] + public bool? IsBridgeError { get; init; } + + /// + /// Indicates whether the error is related specifically to the connected account. + /// + [JsonPropertyName("is_connected_account_error")] + public bool? IsConnectedAccountError { get; init; } + } + + public sealed record AccessCodeErrorsUnrecognized + : AccessCodeErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("mutation_code")] + [SeamUnionVariant("creating", typeof(AccessCodePendingMutationsCreating))] + [SeamUnionVariant( + "deferring_creation", + typeof(AccessCodePendingMutationsDeferringCreation) + )] + [SeamUnionVariant("deleting", typeof(AccessCodePendingMutationsDeleting))] + [SeamUnionVariant("updating_code", typeof(AccessCodePendingMutationsUpdatingCode))] + [SeamUnionVariant("updating_name", typeof(AccessCodePendingMutationsUpdatingName))] + [SeamUnionVariant( + "updating_time_frame", + typeof(AccessCodePendingMutationsUpdatingTimeFrame) + )] + [SeamUnionFallback(typeof(AccessCodePendingMutationsUnrecognized))] + public abstract record AccessCodePendingMutations + { + /// The value of the mutation_code discriminator. + public abstract string MutationCode { get; } + + /// + /// Date and time at which the mutation was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the mutation. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessCodePendingMutationsCreating : AccessCodePendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "creating"; + } + + public sealed record AccessCodePendingMutationsDeferringCreation + : AccessCodePendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "deferring_creation"; + + /// + /// Date and time at which Seam will attempt to program this access code on the device. + /// + [JsonPropertyName("scheduled_at")] + public string ScheduledAt { get; init; } = default!; + } + + public sealed record AccessCodePendingMutationsDeleting : AccessCodePendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "deleting"; + } + + public sealed record AccessCodePendingMutationsUpdatingCode : AccessCodePendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_code"; + + /// + /// Previous code configuration. + /// + [JsonPropertyName("from")] + public AccessCodePendingMutationsUpdatingCodeFrom From { get; init; } = default!; + + /// + /// New code configuration. + /// + [JsonPropertyName("to")] + public AccessCodePendingMutationsUpdatingCodeTo To { get; init; } = default!; + } + + public sealed record AccessCodePendingMutationsUpdatingCodeFrom + { + /// + /// Previous PIN code. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + } + + public sealed record AccessCodePendingMutationsUpdatingCodeTo + { + /// + /// New PIN code. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + } + + public sealed record AccessCodePendingMutationsUpdatingName : AccessCodePendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_name"; + + /// + /// Previous name configuration. + /// + [JsonPropertyName("from")] + public AccessCodePendingMutationsUpdatingNameFrom From { get; init; } = default!; + + /// + /// New name configuration. + /// + [JsonPropertyName("to")] + public AccessCodePendingMutationsUpdatingNameTo To { get; init; } = default!; + } + + public sealed record AccessCodePendingMutationsUpdatingNameFrom + { + /// + /// Previous access code name. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record AccessCodePendingMutationsUpdatingNameTo + { + /// + /// New access code name. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record AccessCodePendingMutationsUpdatingTimeFrame + : AccessCodePendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_time_frame"; + + /// + /// Previous time frame configuration. + /// + [JsonPropertyName("from")] + public AccessCodePendingMutationsUpdatingTimeFrameFrom From { get; init; } = default!; + + /// + /// New time frame configuration. + /// + [JsonPropertyName("to")] + public AccessCodePendingMutationsUpdatingTimeFrameTo To { get; init; } = default!; + } + + public sealed record AccessCodePendingMutationsUpdatingTimeFrameFrom + { + /// + /// Previous end time for the access code. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Previous start time for the access code. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AccessCodePendingMutationsUpdatingTimeFrameTo + { + /// + /// New end time for the access code. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// New start time for the access code. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AccessCodePendingMutationsUnrecognized + : AccessCodePendingMutations, + ISeamUnrecognizedVariant + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Current status of the access code within the operational lifecycle. Values are `setting`, a transitional phase that indicates that the code is being configured or activated; `set`, which indicates that the code is active and operational; `unset`, which indicates a deactivated or unused state, either before activation or after deliberate deactivation; `removing`, which indicates a transitional period in which the code is being deleted or made inactive; and `unknown`, which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. See also [Lifecycle of Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/lifecycle-of-access-codes). + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum StatusEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "setting")] + Setting = 1, + + [EnumMember(Value = "set")] + Set = 2, + + [EnumMember(Value = "unset")] + Unset = 3, + + [EnumMember(Value = "removing")] + Removing = 4, + + [EnumMember(Value = "unknown")] + Unknown = 5, + } + + /// + /// Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum TypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "time_bound")] + TimeBound = 1, + + [EnumMember(Value = "ongoing")] + Ongoing = 2, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant( + "code_rotates_periodically", + typeof(AccessCodeWarningsCodeRotatesPeriodically) + )] + [SeamUnionVariant( + "time_frame_adjusted_for_unknown_time_zone", + typeof(AccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone) + )] + [SeamUnionVariant( + "external_modification_in_effect", + typeof(AccessCodeWarningsExternalModificationInEffect) + )] + [SeamUnionVariant( + "delay_in_setting_on_device", + typeof(AccessCodeWarningsDelayInSettingOnDevice) + )] + [SeamUnionVariant( + "delay_in_removing_from_device", + typeof(AccessCodeWarningsDelayInRemovingFromDevice) + )] + [SeamUnionVariant("delay_in_issuing", typeof(AccessCodeWarningsDelayInIssuing))] + [SeamUnionVariant( + "delay_in_applying_mutations", + typeof(AccessCodeWarningsDelayInApplyingMutations) + )] + [SeamUnionVariant( + "third_party_integration_detected", + typeof(AccessCodeWarningsThirdPartyIntegrationDetected) + )] + [SeamUnionVariant( + "igloo_algopin_must_be_used_within_24_hours", + typeof(AccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours) + )] + [SeamUnionVariant( + "management_transferred", + typeof(AccessCodeWarningsManagementTransferred) + )] + [SeamUnionVariant( + "using_backup_access_code", + typeof(AccessCodeWarningsUsingBackupAccessCode) + )] + [SeamUnionVariant("being_deleted", typeof(AccessCodeWarningsBeingDeleted))] + [SeamUnionVariant( + "unknown_issue_with_access_code", + typeof(AccessCodeWarningsUnknownIssueWithAccessCode) + )] + [SeamUnionFallback(typeof(AccessCodeWarningsUnrecognized))] + public abstract record AccessCodeWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessCodeWarningsCodeRotatesPeriodically : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "code_rotates_periodically"; + } + + public sealed record AccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone + : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "time_frame_adjusted_for_unknown_time_zone"; + } + + public sealed record AccessCodeWarningsExternalModificationInEffect : AccessCodeWarnings + { + /// + /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ChangeTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "modified")] + Modified = 1, + + [EnumMember(Value = "removed")] + Removed = 2, + } + + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "external_modification_in_effect"; + + /// + /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. + /// + [JsonPropertyName("change_type")] + public AccessCodeWarningsExternalModificationInEffect.ChangeTypeEnum? ChangeType { get; init; } + + /// + /// List of fields that were changed externally, with their previous and new values. + /// + [JsonPropertyName("modified_fields")] + public List? ModifiedFields { get; init; } + } + + public sealed record AccessCodeWarningsExternalModificationInEffectModifiedFields + { + /// + /// The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). + /// + [JsonPropertyName("field")] + public string Field { get; init; } = default!; + + /// + /// The previous value of the field. + /// + [JsonPropertyName("from")] + public string? From { get; init; } + + /// + /// The new value of the field. + /// + [JsonPropertyName("to")] + public string? To { get; init; } + } + + public sealed record AccessCodeWarningsDelayInSettingOnDevice : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_setting_on_device"; + } + + public sealed record AccessCodeWarningsDelayInRemovingFromDevice : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_removing_from_device"; + } + + public sealed record AccessCodeWarningsDelayInIssuing : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_issuing"; + } + + public sealed record AccessCodeWarningsDelayInApplyingMutations : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_applying_mutations"; + } + + public sealed record AccessCodeWarningsThirdPartyIntegrationDetected : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "third_party_integration_detected"; + } + + public sealed record AccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours + : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "igloo_algopin_must_be_used_within_24_hours"; + } + + public sealed record AccessCodeWarningsManagementTransferred : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "management_transferred"; + } + + public sealed record AccessCodeWarningsUsingBackupAccessCode : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "using_backup_access_code"; + } + + public sealed record AccessCodeWarningsBeingDeleted : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record AccessCodeWarningsUnknownIssueWithAccessCode : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unknown_issue_with_access_code"; + } + + public sealed record AccessCodeWarningsUnrecognized + : AccessCodeWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Unique identifier for the access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Code used for access. Typically, a numeric or alphanumeric string. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Unique identifier for a group of access codes that share the same code. + /// + [JsonPropertyName("common_code_key")] + public string? CommonCodeKey { get; init; } + + /// + /// Date and time at which the access code was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier for the device associated with the access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Metadata for a dormakaba Oracode managed access code. Only present for access codes from dormakaba Oracode devices. + /// + [JsonPropertyName("dormakaba_oracode_metadata")] + public AccessCodeDormakabaOracodeMetadata? DormakabaOracodeMetadata { get; init; } + + /// + /// Date and time after which the time-bound access code becomes inactive. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Errors associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Indicates whether the access code is a backup code. + /// + [JsonPropertyName("is_backup")] + public bool? IsBackup { get; init; } + + /// + /// Indicates whether a backup access code is available for use if the primary access code is lost or compromised. + /// + [JsonPropertyName("is_backup_access_code_available")] + public bool IsBackupAccessCodeAvailable { get; init; } = default!; + + /// + /// Indicates whether changes to the access code from external sources are permitted. + /// + [JsonPropertyName("is_external_modification_allowed")] + public bool IsExternalModificationAllowed { get; init; } = default!; + + /// + /// Indicates whether Seam manages the access code. + /// + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Indicates whether the access code is intended for use in offline scenarios. If `true`, this code can be created on a device without a network connection. + /// + [JsonPropertyName("is_offline_access_code")] + public bool IsOfflineAccessCode { get; init; } = default!; + + /// + /// Indicates whether the access code can only be used once. If `true`, the code becomes invalid after the first use. + /// + [JsonPropertyName("is_one_time_use")] + public bool IsOneTimeUse { get; init; } = default!; + + /// + /// Indicates whether the code is set on the device according to a preconfigured schedule. + /// + [JsonPropertyName("is_scheduled_on_device")] + public bool? IsScheduledOnDevice { get; init; } + + /// + /// Indicates whether the access code is waiting for a code assignment. + /// + [JsonPropertyName("is_waiting_for_code_assignment")] + public bool? IsWaitingForCodeAssignment { get; init; } + + /// + /// Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Collection of pending mutations for the access code. Indicates changes that Seam is in the process of pushing to the device. + /// + [JsonPropertyName("pending_mutations")] + public List PendingMutations { get; init; } = default!; + + /// + /// Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code. + /// + [JsonPropertyName("pulled_backup_access_code_id")] + public string? PulledBackupAccessCodeId { get; init; } + + /// + /// Date and time at which the time-bound access code becomes active. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Current status of the access code within the operational lifecycle. Values are `setting`, a transitional phase that indicates that the code is being configured or activated; `set`, which indicates that the code is active and operational; `unset`, which indicates a deactivated or unused state, either before activation or after deliberate deactivation; `removing`, which indicates a transitional period in which the code is being deleted or made inactive; and `unknown`, which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. See also [Lifecycle of Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/lifecycle-of-access-codes). + /// + [JsonPropertyName("status")] + public AccessCode.StatusEnum Status { get; init; } = default!; + + /// + /// Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. + /// + [JsonPropertyName("type")] + public AccessCode.TypeEnum Type { get; init; } = default!; + + /// + /// Warnings associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// Unique identifier for the Seam workspace associated with the access code. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record AccessCodeDormakabaOracodeMetadata + { + /// + /// Indicates whether the stay can be cancelled via the Dormakaba Oracode API. + /// + [JsonPropertyName("is_cancellable")] + public bool? IsCancellable { get; init; } + + /// + /// Indicates whether early check-in is available for this stay. + /// + [JsonPropertyName("is_early_checkin_able")] + public bool? IsEarlyCheckinAble { get; init; } + + /// + /// Indicates whether the stay can be extended via the Dormakaba Oracode API. + /// + [JsonPropertyName("is_extendable")] + public bool? IsExtendable { get; init; } + + /// + /// Indicates whether the access code can be overridden. When false, the maximum number of overrides has been reached. + /// + [JsonPropertyName("is_overridable")] + public bool? IsOverridable { get; init; } + + /// + /// Dormakaba Oracode site name associated with this access code. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + + /// + /// Dormakaba Oracode stay ID associated with this access code. + /// + [JsonPropertyName("stay_id")] + public float? StayId { get; init; } + + /// + /// Dormakaba Oracode user level ID associated with this access code. + /// + [JsonPropertyName("user_level_id")] + public string? UserLevelId { get; init; } + + /// + /// Dormakaba Oracode user level name associated with this access code. + /// + [JsonPropertyName("user_level_name")] + public string? UserLevelName { get; init; } + } +} diff --git a/src/Seam/Models/AccessGrant.cs b/src/Seam/Models/AccessGrant.cs new file mode 100644 index 00000000..6e23d86d --- /dev/null +++ b/src/Seam/Models/AccessGrant.cs @@ -0,0 +1,575 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an Access Grant. Access Grants enable you to grant a user identity access to spaces, entrances, and devices through one or more access methods, such as mobile keys, plastic cards, and PIN codes. You can create an Access Grant for an existing user identity, or you can create a new user identity *while* creating the new Access Grant. + /// + public sealed record AccessGrant + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant( + "cannot_create_requested_access_methods", + typeof(AccessGrantErrorsCannotCreateRequestedAccessMethods) + )] + [SeamUnionFallback(typeof(AccessGrantErrorsUnrecognized))] + public abstract record AccessGrantErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessGrantErrorsCannotCreateRequestedAccessMethods : AccessGrantErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "cannot_create_requested_access_methods"; + + /// + /// IDs of the devices that did not receive an access code at grant creation. Use these to identify which specific devices failed when the message reports a partial failure. + /// + [JsonPropertyName("missing_device_ids")] + public List? MissingDeviceIds { get; init; } + } + + public sealed record AccessGrantErrorsUnrecognized + : AccessGrantErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("mutation_code")] + [SeamUnionVariant("updating_spaces", typeof(AccessGrantPendingMutationsUpdatingSpaces))] + [SeamUnionVariant( + "updating_access_times", + typeof(AccessGrantPendingMutationsUpdatingAccessTimes) + )] + [SeamUnionFallback(typeof(AccessGrantPendingMutationsUnrecognized))] + public abstract record AccessGrantPendingMutations + { + /// The value of the mutation_code discriminator. + public abstract string MutationCode { get; } + + /// + /// Date and time at which the mutation was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the mutation. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessGrantPendingMutationsUpdatingSpaces : AccessGrantPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_spaces"; + + /// + /// Previous location configuration. + /// + [JsonPropertyName("from")] + public AccessGrantPendingMutationsUpdatingSpacesFrom From { get; init; } = default!; + + /// + /// New location configuration. + /// + [JsonPropertyName("to")] + public AccessGrantPendingMutationsUpdatingSpacesTo To { get; init; } = default!; + } + + public sealed record AccessGrantPendingMutationsUpdatingSpacesFrom + { + /// + /// Previous device IDs where access codes existed. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record AccessGrantPendingMutationsUpdatingSpacesTo + { + /// + /// Common code key to ensure PIN code reuse across devices. + /// + [JsonPropertyName("common_code_key")] + public string? CommonCodeKey { get; init; } + + /// + /// New device IDs where access codes should be created. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record AccessGrantPendingMutationsUpdatingAccessTimes + : AccessGrantPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_access_times"; + + /// + /// IDs of the access methods being updated. + /// + [JsonPropertyName("access_method_ids")] + public List AccessMethodIds { get; init; } = default!; + + /// + /// Previous access time configuration. + /// + [JsonPropertyName("from")] + public AccessGrantPendingMutationsUpdatingAccessTimesFrom From { get; init; } = + default!; + + /// + /// New access time configuration. + /// + [JsonPropertyName("to")] + public AccessGrantPendingMutationsUpdatingAccessTimesTo To { get; init; } = default!; + } + + public sealed record AccessGrantPendingMutationsUpdatingAccessTimesFrom + { + /// + /// Previous end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Previous start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AccessGrantPendingMutationsUpdatingAccessTimesTo + { + /// + /// New end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// New start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AccessGrantPendingMutationsUnrecognized + : AccessGrantPendingMutations, + ISeamUnrecognizedVariant + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant("being_deleted", typeof(AccessGrantWarningsBeingDeleted))] + [SeamUnionVariant( + "underprovisioned_access", + typeof(AccessGrantWarningsUnderprovisionedAccess) + )] + [SeamUnionVariant( + "overprovisioned_access", + typeof(AccessGrantWarningsOverprovisionedAccess) + )] + [SeamUnionVariant("updating_access_times", typeof(AccessGrantWarningsUpdatingAccessTimes))] + [SeamUnionVariant( + "requested_code_unavailable", + typeof(AccessGrantWarningsRequestedCodeUnavailable) + )] + [SeamUnionVariant( + "device_does_not_support_access_codes", + typeof(AccessGrantWarningsDeviceDoesNotSupportAccessCodes) + )] + [SeamUnionVariant( + "device_time_constraints_violated", + typeof(AccessGrantWarningsDeviceTimeConstraintsViolated) + )] + [SeamUnionFallback(typeof(AccessGrantWarningsUnrecognized))] + public abstract record AccessGrantWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessGrantWarningsBeingDeleted : AccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record AccessGrantWarningsUnderprovisionedAccess : AccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "underprovisioned_access"; + } + + public sealed record AccessGrantWarningsOverprovisionedAccess : AccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "overprovisioned_access"; + + /// + /// Devices whose access codes could not be revoked during reconciliation. Present when the provider does not support revoking an offline access code (e.g. Dormakaba oracode with exhausted override budget). + /// + [JsonPropertyName("failed_devices")] + public List? FailedDevices { get; init; } + } + + public sealed record AccessGrantWarningsOverprovisionedAccessFailedDevices + { + /// + /// Device whose access code could not be revoked. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`). + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Human-readable description of why revocation failed. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessGrantWarningsUpdatingAccessTimes : AccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "updating_access_times"; + + /// + /// IDs of the access methods being updated. + /// + [JsonPropertyName("access_method_ids")] + public List AccessMethodIds { get; init; } = default!; + } + + public sealed record AccessGrantWarningsRequestedCodeUnavailable : AccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "requested_code_unavailable"; + + /// + /// ID of the device where the requested code was unavailable. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// The new PIN code that was assigned instead. + /// + [JsonPropertyName("new_code")] + public string NewCode { get; init; } = default!; + + /// + /// The originally requested PIN code that was unavailable. + /// + [JsonPropertyName("original_code")] + public string OriginalCode { get; init; } = default!; + } + + public sealed record AccessGrantWarningsDeviceDoesNotSupportAccessCodes + : AccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_does_not_support_access_codes"; + + /// + /// ID of the device that does not support access codes. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + public sealed record AccessGrantWarningsDeviceTimeConstraintsViolated : AccessGrantWarnings + { + /// + /// Specific reason why the grant's times are not programmable on the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ReasonEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "duration_exceeds_max")] + DurationExceedsMax = 1, + + [EnumMember(Value = "times_do_not_match_slots")] + TimesDoNotMatchSlots = 2, + + [EnumMember(Value = "ongoing_not_supported")] + OngoingNotSupported = 3, + } + + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_time_constraints_violated"; + + /// + /// ID of the device whose time constraints the access grant violates. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Specific reason why the grant's times are not programmable on the device. + /// + [JsonPropertyName("reason")] + public AccessGrantWarningsDeviceTimeConstraintsViolated.ReasonEnum Reason { get; init; } = + default!; + } + + public sealed record AccessGrantWarningsUnrecognized + : AccessGrantWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// ID of the Access Grant. + /// + [JsonPropertyName("access_grant_id")] + public string AccessGrantId { get; init; } = default!; + + /// + /// Unique key for the access grant within the workspace. + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + /// + /// IDs of the access methods created for the Access Grant. + /// + [JsonPropertyName("access_method_ids")] + public List AccessMethodIds { get; init; } = default!; + + /// + /// Client Session Token. Only returned if the Access Grant has a mobile_key access method. + /// + [JsonPropertyName("client_session_token")] + public string? ClientSessionToken { get; init; } + + /// + /// Date and time at which the Access Grant was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// ID of the customization profile associated with the Access Grant. + /// + [JsonPropertyName("customization_profile_id")] + public string? CustomizationProfileId { get; init; } + + /// + /// Display name of the Access Grant. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Human-readable sentence answering whether the user can currently get in, for example `Awaiting encoding` on an access method or `Upcoming` here. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read `starts_at`, `ends_at`, `errors`, and the access methods' own fields. + /// + [JsonPropertyName("display_status")] + public string DisplayStatus { get; init; } = default!; + + /// + /// Date and time at which the Access Grant ends. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Errors associated with the [access grant](https://docs.seam.co/use-cases/granting-access). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Instant Key URL. Only returned if the Access Grant has a single mobile_key access_method. + /// + [JsonPropertyName("instant_key_url")] + public string? InstantKeyUrl { get; init; } + + [Obsolete("Use `space_ids`.")] + [JsonPropertyName("location_ids")] + public List LocationIds { get; init; } = default!; + + /// + /// Name of the Access Grant. If not provided, the display name will be computed. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// List of pending mutations for the access grant. This shows updates that are in progress. + /// + [JsonPropertyName("pending_mutations")] + public List PendingMutations { get; init; } = default!; + + /// + /// Access methods that the user requested for the Access Grant. + /// + [JsonPropertyName("requested_access_methods")] + public List RequestedAccessMethods { get; init; } = + default!; + + /// + /// Reservation key for the access grant. + /// + [JsonPropertyName("reservation_key")] + public string? ReservationKey { get; init; } + + /// + /// IDs of the spaces to which the Access Grant gives access. + /// + [JsonPropertyName("space_ids")] + public List SpaceIds { get; init; } = default!; + + /// + /// Date and time at which the Access Grant starts. + /// + [JsonPropertyName("starts_at")] + public string StartsAt { get; init; } = default!; + + /// + /// ID of user identity to which the Access Grant gives access. + /// + [JsonPropertyName("user_identity_id")] + public string UserIdentityId { get; init; } = default!; + + /// + /// Warnings associated with the [access grant](https://docs.seam.co/use-cases/granting-access). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the Seam workspace associated with the Access Grant. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record AccessGrantRequestedAccessMethods + { + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// Specific PIN code to use for this access method. Only applicable when mode is 'code'. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// IDs of the access methods created for the requested access method. + /// + [JsonPropertyName("created_access_method_ids")] + public List CreatedAccessMethodIds { get; init; } = default!; + + /// + /// Date and time at which the requested access method was added to the Access Grant. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name of the access method. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Maximum number of times the instant key can be used. Only applicable when mode is 'mobile_key'. Defaults to 1 if not specified. + /// + [JsonPropertyName("instant_key_max_use_count")] + public int? InstantKeyMaxUseCount { get; init; } + + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("mode")] + public AccessGrantRequestedAccessMethods.ModeEnum Mode { get; init; } = default!; + } +} diff --git a/src/Seam/Models/AccessMethod.cs b/src/Seam/Models/AccessMethod.cs new file mode 100644 index 00000000..31c3cabe --- /dev/null +++ b/src/Seam/Models/AccessMethod.cs @@ -0,0 +1,430 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an access method for an Access Grant. Access methods describe the modes of access, such as PIN codes, plastic cards, and mobile keys. For a mobile key, the access method also stores the URL for the associated Instant Key. + /// + public sealed record AccessMethod + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("failed_to_issue", typeof(AccessMethodErrorsFailedToIssue))] + [SeamUnionFallback(typeof(AccessMethodErrorsUnrecognized))] + public abstract record AccessMethodErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessMethodErrorsFailedToIssue : AccessMethodErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_issue"; + } + + public sealed record AccessMethodErrorsUnrecognized + : AccessMethodErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("mutation_code")] + [SeamUnionVariant( + "provisioning_access", + typeof(AccessMethodPendingMutationsProvisioningAccess) + )] + [SeamUnionVariant("revoking_access", typeof(AccessMethodPendingMutationsRevokingAccess))] + [SeamUnionVariant( + "updating_access_times", + typeof(AccessMethodPendingMutationsUpdatingAccessTimes) + )] + [SeamUnionFallback(typeof(AccessMethodPendingMutationsUnrecognized))] + public abstract record AccessMethodPendingMutations + { + /// The value of the mutation_code discriminator. + public abstract string MutationCode { get; } + + /// + /// Date and time at which the mutation was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the mutation. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessMethodPendingMutationsProvisioningAccess + : AccessMethodPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "provisioning_access"; + + /// + /// Previous device configuration. + /// + [JsonPropertyName("from")] + public AccessMethodPendingMutationsProvisioningAccessFrom From { get; init; } = + default!; + + /// + /// New device configuration. + /// + [JsonPropertyName("to")] + public AccessMethodPendingMutationsProvisioningAccessTo To { get; init; } = default!; + } + + public sealed record AccessMethodPendingMutationsProvisioningAccessFrom + { + /// + /// Previous device IDs where access was provisioned. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record AccessMethodPendingMutationsProvisioningAccessTo + { + /// + /// New device IDs where access is being provisioned. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record AccessMethodPendingMutationsRevokingAccess + : AccessMethodPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "revoking_access"; + + /// + /// Previous device configuration. + /// + [JsonPropertyName("from")] + public AccessMethodPendingMutationsRevokingAccessFrom From { get; init; } = default!; + + /// + /// New device configuration. + /// + [JsonPropertyName("to")] + public AccessMethodPendingMutationsRevokingAccessTo To { get; init; } = default!; + } + + public sealed record AccessMethodPendingMutationsRevokingAccessFrom + { + /// + /// Previous device IDs where access existed. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record AccessMethodPendingMutationsRevokingAccessTo + { + /// + /// New device IDs where access should remain. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record AccessMethodPendingMutationsUpdatingAccessTimes + : AccessMethodPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_access_times"; + + /// + /// Previous access time configuration. + /// + [JsonPropertyName("from")] + public AccessMethodPendingMutationsUpdatingAccessTimesFrom From { get; init; } = + default!; + + /// + /// New access time configuration. + /// + [JsonPropertyName("to")] + public AccessMethodPendingMutationsUpdatingAccessTimesTo To { get; init; } = default!; + } + + public sealed record AccessMethodPendingMutationsUpdatingAccessTimesFrom + { + /// + /// Previous end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Previous start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AccessMethodPendingMutationsUpdatingAccessTimesTo + { + /// + /// New end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// New start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AccessMethodPendingMutationsUnrecognized + : AccessMethodPendingMutations, + ISeamUnrecognizedVariant + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant("being_deleted", typeof(AccessMethodWarningsBeingDeleted))] + [SeamUnionVariant("updating_access_times", typeof(AccessMethodWarningsUpdatingAccessTimes))] + [SeamUnionVariant( + "pulled_backup_access_code", + typeof(AccessMethodWarningsPulledBackupAccessCode) + )] + [SeamUnionVariant("delay_in_issuing", typeof(AccessMethodWarningsDelayInIssuing))] + [SeamUnionFallback(typeof(AccessMethodWarningsUnrecognized))] + public abstract record AccessMethodWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AccessMethodWarningsBeingDeleted : AccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record AccessMethodWarningsUpdatingAccessTimes : AccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "updating_access_times"; + } + + public sealed record AccessMethodWarningsPulledBackupAccessCode : AccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "pulled_backup_access_code"; + + /// + /// ID of the original access method from which this backup access method was split, if applicable. + /// + [JsonPropertyName("original_access_method_id")] + public string? OriginalAccessMethodId { get; init; } + } + + public sealed record AccessMethodWarningsDelayInIssuing : AccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_issuing"; + } + + public sealed record AccessMethodWarningsUnrecognized + : AccessMethodWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// ID of the access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + + /// + /// Token of the client session associated with the access method. + /// + [JsonPropertyName("client_session_token")] + public string? ClientSessionToken { get; init; } + + /// + /// The actual PIN code for code access methods. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Date and time at which the access method was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// ID of the customization profile associated with the access method. + /// + [JsonPropertyName("customization_profile_id")] + public string? CustomizationProfileId { get; init; } + + /// + /// Display name of the access method. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Human-readable sentence describing where the access method sits in its relationship with the device or access system, for example `Awaiting encoding`. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read `is_issued`, `errors`, and `pending_mutations`. + /// + [JsonPropertyName("display_status")] + public string DisplayStatus { get; init; } = default!; + + /// + /// Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// URL of the Instant Key for mobile key access methods. + /// + [JsonPropertyName("instant_key_url")] + public string? InstantKeyUrl { get; init; } + + /// + /// Indicates whether an existing card credential must be assigned to this access method before it can be issued. Only applies to card-mode access methods on systems that support credential assignment. + /// + [JsonPropertyName("is_assignment_required")] + public bool? IsAssignmentRequired { get; init; } + + /// + /// Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method. + /// + [JsonPropertyName("is_encoding_required")] + public bool? IsEncodingRequired { get; init; } + + /// + /// Indicates whether the access method has been issued. + /// + [JsonPropertyName("is_issued")] + public bool IsIssued { get; init; } = default!; + + /// + /// Indicates whether the access method is ready for card assignment. This is true when the access method is in card mode, has not yet been issued, and the system supports credential assignment. + /// + [JsonPropertyName("is_ready_for_assignment")] + public bool? IsReadyForAssignment { get; init; } + + /// + /// Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. + /// + [JsonPropertyName("is_ready_for_encoding")] + public bool? IsReadyForEncoding { get; init; } + + /// + /// Date and time at which the access method was issued. + /// + [JsonPropertyName("issued_at")] + public string? IssuedAt { get; init; } + + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("mode")] + public AccessMethod.ModeEnum Mode { get; init; } = default!; + + /// + /// Pending mutations for the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). Indicates operations that are in progress. + /// + [JsonPropertyName("pending_mutations")] + public List PendingMutations { get; init; } = default!; + + /// + /// Warnings associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the Seam workspace associated with the access method. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } +} diff --git a/src/Seam/Models/AcsAccessGroup.cs b/src/Seam/Models/AcsAccessGroup.cs new file mode 100644 index 00000000..aca6c928 --- /dev/null +++ b/src/Seam/Models/AcsAccessGroup.cs @@ -0,0 +1,567 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Group that defines the entrances to which a set of users has access and, in some cases, the access schedule for these entrances and users. + /// + /// Some access control systems use [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups), which are sets of users, combined with sets of permissions. These permissions include both the set of areas or assets that the users can access and the schedule during which the users can access these areas or assets. Instead of assigning access rights individually to each access control system user, which can be time-consuming and error-prone, administrators can assign users to an access group, thereby ensuring that the users inherit all the permissions associated with the access group. Using access groups streamlines the process of managing large numbers of access control system users, especially in bigger organizations or complexes. + /// + /// To learn whether your access control system supports access groups, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). + /// + public sealed record AcsAccessGroup + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AccessGroupTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pti_unit")] + PtiUnit = 1, + + [EnumMember(Value = "pti_access_level")] + PtiAccessLevel = 2, + + [EnumMember(Value = "salto_ks_access_group")] + SaltoKsAccessGroup = 3, + + [EnumMember(Value = "brivo_group")] + BrivoGroup = 4, + + [EnumMember(Value = "salto_space_group")] + SaltoSpaceGroup = 5, + + [EnumMember(Value = "dormakaba_community_access_group")] + DormakabaCommunityAccessGroup = 6, + + [EnumMember(Value = "dormakaba_ambiance_access_group")] + DormakabaAmbianceAccessGroup = 7, + + [EnumMember(Value = "avigilon_alta_group")] + AvigilonAltaGroup = 8, + + [EnumMember(Value = "kisi_access_group")] + KisiAccessGroup = 9, + + [EnumMember(Value = "akiles_member_group")] + AkilesMemberGroup = 10, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant( + "failed_to_create_on_acs_system", + typeof(AcsAccessGroupErrorsFailedToCreateOnAcsSystem) + )] + [SeamUnionFallback(typeof(AcsAccessGroupErrorsUnrecognized))] + public abstract record AcsAccessGroupErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsAccessGroupErrorsFailedToCreateOnAcsSystem : AcsAccessGroupErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_create_on_acs_system"; + } + + public sealed record AcsAccessGroupErrorsUnrecognized + : AcsAccessGroupErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Brand-specific terminology for the access group type. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExternalTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pti_unit")] + PtiUnit = 1, + + [EnumMember(Value = "pti_access_level")] + PtiAccessLevel = 2, + + [EnumMember(Value = "salto_ks_access_group")] + SaltoKsAccessGroup = 3, + + [EnumMember(Value = "brivo_group")] + BrivoGroup = 4, + + [EnumMember(Value = "salto_space_group")] + SaltoSpaceGroup = 5, + + [EnumMember(Value = "dormakaba_community_access_group")] + DormakabaCommunityAccessGroup = 6, + + [EnumMember(Value = "dormakaba_ambiance_access_group")] + DormakabaAmbianceAccessGroup = 7, + + [EnumMember(Value = "avigilon_alta_group")] + AvigilonAltaGroup = 8, + + [EnumMember(Value = "kisi_access_group")] + KisiAccessGroup = 9, + + [EnumMember(Value = "akiles_member_group")] + AkilesMemberGroup = 10, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("mutation_code")] + [SeamUnionVariant("creating", typeof(AcsAccessGroupPendingMutationsCreating))] + [SeamUnionVariant("deleting", typeof(AcsAccessGroupPendingMutationsDeleting))] + [SeamUnionVariant( + "deferring_deletion", + typeof(AcsAccessGroupPendingMutationsDeferringDeletion) + )] + [SeamUnionVariant( + "updating_group_information", + typeof(AcsAccessGroupPendingMutationsUpdatingGroupInformation) + )] + [SeamUnionVariant( + "updating_access_schedule", + typeof(AcsAccessGroupPendingMutationsUpdatingAccessSchedule) + )] + [SeamUnionVariant( + "updating_user_membership", + typeof(AcsAccessGroupPendingMutationsUpdatingUserMembership) + )] + [SeamUnionVariant( + "updating_entrance_membership", + typeof(AcsAccessGroupPendingMutationsUpdatingEntranceMembership) + )] + [SeamUnionVariant( + "deferring_user_membership_update", + typeof(AcsAccessGroupPendingMutationsDeferringUserMembershipUpdate) + )] + [SeamUnionFallback(typeof(AcsAccessGroupPendingMutationsUnrecognized))] + public abstract record AcsAccessGroupPendingMutations + { + /// The value of the mutation_code discriminator. + public abstract string MutationCode { get; } + + /// + /// Date and time at which the mutation was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the mutation. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsAccessGroupPendingMutationsCreating : AcsAccessGroupPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "creating"; + } + + public sealed record AcsAccessGroupPendingMutationsDeleting : AcsAccessGroupPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "deleting"; + } + + public sealed record AcsAccessGroupPendingMutationsDeferringDeletion + : AcsAccessGroupPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "deferring_deletion"; + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingGroupInformation + : AcsAccessGroupPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_group_information"; + + /// + /// Old access group information. + /// + [JsonPropertyName("from")] + public AcsAccessGroupPendingMutationsUpdatingGroupInformationFrom From { get; init; } = + default!; + + /// + /// New access group information. + /// + [JsonPropertyName("to")] + public AcsAccessGroupPendingMutationsUpdatingGroupInformationTo To { get; init; } = + default!; + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingGroupInformationFrom + { + /// + /// Name of the access group. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingGroupInformationTo + { + /// + /// Name of the access group. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingAccessSchedule + : AcsAccessGroupPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_access_schedule"; + + /// + /// Old access schedule information. + /// + [JsonPropertyName("from")] + public AcsAccessGroupPendingMutationsUpdatingAccessScheduleFrom From { get; init; } = + default!; + + /// + /// New access schedule information. + /// + [JsonPropertyName("to")] + public AcsAccessGroupPendingMutationsUpdatingAccessScheduleTo To { get; init; } = + default!; + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingAccessScheduleFrom + { + /// + /// Ending time for the access schedule. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Starting time for the access schedule. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingAccessScheduleTo + { + /// + /// Ending time for the access schedule. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Starting time for the access schedule. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingUserMembership + : AcsAccessGroupPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_user_membership"; + + /// + /// Old user membership. + /// + [JsonPropertyName("from")] + public AcsAccessGroupPendingMutationsUpdatingUserMembershipFrom From { get; init; } = + default!; + + /// + /// New user membership. + /// + [JsonPropertyName("to")] + public AcsAccessGroupPendingMutationsUpdatingUserMembershipTo To { get; init; } = + default!; + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingUserMembershipFrom + { + /// + /// Old user ID. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingUserMembershipTo + { + /// + /// New user ID. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingEntranceMembership + : AcsAccessGroupPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_entrance_membership"; + + /// + /// Old entrance membership. + /// + [JsonPropertyName("from")] + public AcsAccessGroupPendingMutationsUpdatingEntranceMembershipFrom From { get; init; } = + default!; + + /// + /// New entrance membership. + /// + [JsonPropertyName("to")] + public AcsAccessGroupPendingMutationsUpdatingEntranceMembershipTo To { get; init; } = + default!; + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingEntranceMembershipFrom + { + /// + /// Old entrance ID. + /// + [JsonPropertyName("acs_entrance_id")] + public string? AcsEntranceId { get; init; } + } + + public sealed record AcsAccessGroupPendingMutationsUpdatingEntranceMembershipTo + { + /// + /// New entrance ID. + /// + [JsonPropertyName("acs_entrance_id")] + public string? AcsEntranceId { get; init; } + } + + public sealed record AcsAccessGroupPendingMutationsDeferringUserMembershipUpdate + : AcsAccessGroupPendingMutations + { + /// + /// Whether the user is scheduled to be added to or removed from this access group. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum VariantEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "adding")] + Adding = 1, + + [EnumMember(Value = "removing")] + Removing = 2, + } + + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "deferring_user_membership_update"; + + /// + /// ID of the user involved in the scheduled change. + /// + [JsonPropertyName("acs_user_id")] + public string AcsUserId { get; init; } = default!; + + /// + /// Whether the user is scheduled to be added to or removed from this access group. + /// + [JsonPropertyName("variant")] + public AcsAccessGroupPendingMutationsDeferringUserMembershipUpdate.VariantEnum Variant { get; init; } = + default!; + } + + public sealed record AcsAccessGroupPendingMutationsUnrecognized + : AcsAccessGroupPendingMutations, + ISeamUnrecognizedVariant + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [Obsolete("Use `external_type`.")] + [JsonPropertyName("access_group_type")] + public AcsAccessGroup.AccessGroupTypeEnum AccessGroupType { get; init; } = default!; + + [Obsolete("Use `external_type_display_name`.")] + [JsonPropertyName("access_group_type_display_name")] + public string AccessGroupTypeDisplayName { get; init; } = default!; + + /// + /// `starts_at` and `ends_at` timestamps for the access group's access. + /// + [JsonPropertyName("access_schedule")] + public AcsAccessGroupAccessSchedule? AccessSchedule { get; init; } + + /// + /// ID of the access group. + /// + [JsonPropertyName("acs_access_group_id")] + public string AcsAccessGroupId { get; init; } = default!; + + /// + /// ID of the access control system that contains the access group. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account that contains the access group. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the access group was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name for the access group. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Errors associated with the `acs_access_group`. + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Brand-specific terminology for the access group type. + /// + [JsonPropertyName("external_type")] + public AcsAccessGroup.ExternalTypeEnum ExternalType { get; init; } = default!; + + /// + /// Display name that corresponds to the brand-specific terminology for the access group type. + /// + [JsonPropertyName("external_type_display_name")] + public string ExternalTypeDisplayName { get; init; } = default!; + + /// + /// Indicates whether Seam manages the access group. + /// + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Name of the access group. + /// + [JsonPropertyName("name")] + public string Name { get; init; } = default!; + + /// + /// Collection of pending mutations for the access group. Represents operations that have been requested but not yet completed on the integrated access system. + /// + [JsonPropertyName("pending_mutations")] + public List PendingMutations { get; init; } = default!; + + /// + /// Warnings associated with the `acs_access_group`. + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the workspace that contains the access group. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record AcsAccessGroupAccessSchedule + { + /// + /// Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string StartsAt { get; init; } = default!; + } + + public sealed record AcsAccessGroupWarnings + { + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum WarningCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "unknown_issue_with_acs_access_group")] + UnknownIssueWithAcsAccessGroup = 1, + + [EnumMember(Value = "being_deleted")] + BeingDeleted = 2, + } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public AcsAccessGroupWarnings.WarningCodeEnum WarningCode { get; init; } = default!; + } +} diff --git a/src/Seam/Models/AcsCredential.cs b/src/Seam/Models/AcsCredential.cs new file mode 100644 index 00000000..a1b910bf --- /dev/null +++ b/src/Seam/Models/AcsCredential.cs @@ -0,0 +1,505 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Means by which an [access control system user](https://docs.seam.co/low-level-apis/access-systems/user-management) gains access at an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). The `acs_credential` object represents a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) that provides an ACS user access within an [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + /// An access control system generally uses digital means of access to authorize a user trying to get through a specific entrance. Examples of credentials include plastic key cards, mobile keys, biometric identifiers, and PIN codes. The electronic nature of these credentials, as well as the fact that access is centralized, enables both the rapid provisioning and rescinding of access and the ability to compile access audit logs. + /// + /// For each `acs_credential`, you define the access method. You can also specify additional properties, such as a PIN code, depending on the credential type. + /// + /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach. Use the lower-level ACS credential API directly only when you specifically need to manage individual credentials. + /// + public sealed record AcsCredential + { + /// + /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AccessMethodEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExternalTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pti_card")] + PtiCard = 1, + + [EnumMember(Value = "brivo_credential")] + BrivoCredential = 2, + + [EnumMember(Value = "hid_credential")] + HidCredential = 3, + + [EnumMember(Value = "visionline_card")] + VisionlineCard = 4, + + [EnumMember(Value = "salto_ks_credential")] + SaltoKsCredential = 5, + + [EnumMember(Value = "assa_abloy_vostio_key")] + AssaAbloyVostioKey = 6, + + [EnumMember(Value = "salto_space_key")] + SaltoSpaceKey = 7, + + [EnumMember(Value = "latch_access")] + LatchAccess = 8, + + [EnumMember(Value = "dormakaba_ambiance_credential")] + DormakabaAmbianceCredential = 9, + + [EnumMember(Value = "hotek_card")] + HotekCard = 10, + + [EnumMember(Value = "salto_ks_tag")] + SaltoKsTag = 11, + + [EnumMember(Value = "avigilon_alta_credential")] + AvigilonAltaCredential = 12, + + [EnumMember(Value = "kisi_credential")] + KisiCredential = 13, + + [EnumMember(Value = "akiles_credential")] + AkilesCredential = 14, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant("waiting_to_be_issued", typeof(AcsCredentialWarningsWaitingToBeIssued))] + [SeamUnionVariant( + "schedule_externally_modified", + typeof(AcsCredentialWarningsScheduleExternallyModified) + )] + [SeamUnionVariant("schedule_modified", typeof(AcsCredentialWarningsScheduleModified))] + [SeamUnionVariant("being_deleted", typeof(AcsCredentialWarningsBeingDeleted))] + [SeamUnionVariant( + "unknown_issue_with_acs_credential", + typeof(AcsCredentialWarningsUnknownIssueWithAcsCredential) + )] + [SeamUnionVariant("needs_to_be_reissued", typeof(AcsCredentialWarningsNeedsToBeReissued))] + [SeamUnionVariant( + "requested_code_unavailable", + typeof(AcsCredentialWarningsRequestedCodeUnavailable) + )] + [SeamUnionFallback(typeof(AcsCredentialWarningsUnrecognized))] + public abstract record AcsCredentialWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsCredentialWarningsWaitingToBeIssued : AcsCredentialWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "waiting_to_be_issued"; + } + + public sealed record AcsCredentialWarningsScheduleExternallyModified : AcsCredentialWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "schedule_externally_modified"; + } + + public sealed record AcsCredentialWarningsScheduleModified : AcsCredentialWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "schedule_modified"; + } + + public sealed record AcsCredentialWarningsBeingDeleted : AcsCredentialWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record AcsCredentialWarningsUnknownIssueWithAcsCredential + : AcsCredentialWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unknown_issue_with_acs_credential"; + } + + public sealed record AcsCredentialWarningsNeedsToBeReissued : AcsCredentialWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "needs_to_be_reissued"; + } + + public sealed record AcsCredentialWarningsRequestedCodeUnavailable : AcsCredentialWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "requested_code_unavailable"; + + /// + /// The PIN code that was assigned instead. + /// + [JsonPropertyName("new_code")] + public string NewCode { get; init; } = default!; + + /// + /// The originally requested PIN code that could not be used. + /// + [JsonPropertyName("original_code")] + public string OriginalCode { get; init; } = default!; + } + + public sealed record AcsCredentialWarningsUnrecognized + : AcsCredentialWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("access_method")] + public AcsCredential.AccessMethodEnum AccessMethod { get; init; } = default!; + + /// + /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("acs_credential_id")] + public string AcsCredentialId { get; init; } = default!; + + /// + /// ID of the credential pool to which the credential belongs. + /// + [JsonPropertyName("acs_credential_pool_id")] + public string? AcsCredentialPoolId { get; init; } + + /// + /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// Akiles-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("akiles_metadata")] + public AcsCredentialAkilesMetadata? AkilesMetadata { get; init; } + + /// + /// Vostio-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("assa_abloy_vostio_metadata")] + public AcsCredentialAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; init; } + + /// + /// Number of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("card_number")] + public string? CardNumber { get; init; } + + /// + /// Access (PIN) code for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// ID of the [connected account](https://docs.seam.co/core-concepts/connected-accounts) to which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name that corresponds to the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Errors associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. + /// + [JsonPropertyName("external_type")] + public AcsCredential.ExternalTypeEnum? ExternalType { get; init; } + + /// + /// Display name that corresponds to the brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + /// + [JsonPropertyName("external_type_display_name")] + public string? ExternalTypeDisplayName { get; init; } + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been encoded onto a card. + /// + [JsonPropertyName("is_issued")] + public bool? IsIssued { get; init; } + + /// + /// Indicates whether the latest state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been synced from Seam to the provider. + /// + [JsonPropertyName("is_latest_desired_state_synced_with_provider")] + public bool? IsLatestDesiredStateSyncedWithProvider { get; init; } + + /// + /// Indicates whether Seam manages the credential. + /// + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). + /// + [JsonPropertyName("is_multi_phone_sync_credential")] + public bool? IsMultiPhoneSyncCredential { get; init; } + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) can only be used once. If `true`, the code becomes invalid after the first use. + /// + [JsonPropertyName("is_one_time_use")] + public bool? IsOneTimeUse { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was encoded onto a card. + /// + [JsonPropertyName("issued_at")] + public string? IssuedAt { get; init; } + + /// + /// Date and time at which the state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was most recently synced from Seam to the provider. + /// + [JsonPropertyName("latest_desired_state_synced_with_provider_at")] + public string? LatestDesiredStateSyncedWithProviderAt { get; init; } + + /// + /// ID of the parent [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("parent_acs_credential_id")] + public string? ParentAcsCredentialId { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// ID of the [user identity](https://docs.seam.co/api/user_identities) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("visionline_metadata")] + public AcsCredentialVisionlineMetadata? VisionlineMetadata { get; init; } + + /// + /// Warnings associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the workspace that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record AcsCredentialAkilesMetadata + { + /// + /// ID of the Akiles member PIN. + /// + [JsonPropertyName("member_pin_id")] + public string? MemberPinId { get; init; } + } + + public sealed record AcsCredentialAssaAbloyVostioMetadata + { + /// + /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. + /// + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + /// + /// Names of the doors to which to grant access in the Vostio access system. + /// + [JsonPropertyName("door_names")] + public List? DoorNames { get; init; } + + /// + /// Endpoint ID in the Vostio access system. + /// + [JsonPropertyName("endpoint_id")] + public string? EndpointId { get; init; } + + /// + /// Key ID in the Vostio access system. + /// + [JsonPropertyName("key_id")] + public string? KeyId { get; init; } + + /// + /// Key issuing request ID in the Vostio access system. + /// + [JsonPropertyName("key_issuing_request_id")] + public string? KeyIssuingRequestId { get; init; } + + /// + /// IDs of the guest entrances to override in the Vostio access system. + /// + [JsonPropertyName("override_guest_acs_entrance_ids")] + public List? OverrideGuestAcsEntranceIds { get; init; } + } + + public sealed record AcsCredentialErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsCredentialVisionlineMetadata + { + /// + /// Card function type in the Visionline access system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum CardFunctionTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "guest")] + Guest = 1, + + [EnumMember(Value = "staff")] + Staff = 2, + } + + /// + /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. + /// + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + /// + /// Card function type in the Visionline access system. + /// + [JsonPropertyName("card_function_type")] + public AcsCredentialVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; init; } + + /// + /// ID of the card in the Visionline access system. + /// + [JsonPropertyName("card_id")] + public string? CardId { get; init; } + + /// + /// Common entrance IDs in the Visionline access system. + /// + [JsonPropertyName("common_acs_entrance_ids")] + public List? CommonAcsEntranceIds { get; init; } + + /// + /// ID of the credential in the Visionline access system. + /// + [JsonPropertyName("credential_id")] + public string? CredentialId { get; init; } + + /// + /// Guest entrance IDs in the Visionline access system. + /// + [JsonPropertyName("guest_acs_entrance_ids")] + public List? GuestAcsEntranceIds { get; init; } + + /// + /// Indicates whether the credential is valid. + /// + [JsonPropertyName("is_valid")] + public bool? IsValid { get; init; } + + /// + /// IDs of the credentials to which you want to join. + /// + [JsonPropertyName("joiner_acs_credential_ids")] + public List? JoinerAcsCredentialIds { get; init; } + } +} diff --git a/src/Seam/Models/AcsEncoder.cs b/src/Seam/Models/AcsEncoder.cs new file mode 100644 index 00000000..0fd80fc4 --- /dev/null +++ b/src/Seam/Models/AcsEncoder.cs @@ -0,0 +1,106 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a hardware device that encodes [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) data onto physical cards within an [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + /// Some access control systems require credentials to be encoded onto plastic key cards using a card encoder. This process involves the following two key steps: + /// + /// 1. Credential creation + /// Configure the access parameters for the credential. + /// 2. Card encoding + /// Write the credential data onto the card using a compatible card encoder. + /// + /// Separately, the Seam API also supports card scanning, which enables you to scan and read the encoded data on a card. You can use this action to confirm consistency with access control system records or diagnose discrepancies if needed. + /// + /// See [Working with Card Encoders and Scanners](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + /// To verify if your access control system requires a card encoder, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). + /// + public sealed record AcsEncoder + { + /// + /// ID of the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + [JsonPropertyName("acs_encoder_id")] + public string AcsEncoderId { get; init; } = default!; + + /// + /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account that contains the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name for the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Errors associated with the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// ID of the workspace that contains the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record AcsEncoderErrors + { + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ErrorCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "acs_encoder_removed")] + AcsEncoderRemoved = 1, + } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public AcsEncoderErrors.ErrorCodeEnum ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } +} diff --git a/src/Seam/Models/AcsEntrance.cs b/src/Seam/Models/AcsEntrance.cs new file mode 100644 index 00000000..f1e6bd9e --- /dev/null +++ b/src/Seam/Models/AcsEntrance.cs @@ -0,0 +1,665 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) within an [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + /// In an access control system, an entrance is a secured door, gate, zone, or other method of entry. You can list details for all the `acs_entrance` resources in your workspace or get these details for a specific `acs_entrance`. You can also list all entrances associated with a specific credential, and you can list all credentials associated with a specific entrance. + /// + public sealed record AcsEntrance + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant( + "salto_ks_entrance_access_code_support_removed", + typeof(AcsEntranceWarningsSaltoKsEntranceAccessCodeSupportRemoved) + )] + [SeamUnionVariant("entrance_shares_zone", typeof(AcsEntranceWarningsEntranceSharesZone))] + [SeamUnionVariant( + "entrance_setup_required", + typeof(AcsEntranceWarningsEntranceSetupRequired) + )] + [SeamUnionVariant("salto_ks_privacy_mode", typeof(AcsEntranceWarningsSaltoKsPrivacyMode))] + [SeamUnionVariant("privacy_mode", typeof(AcsEntranceWarningsPrivacyMode))] + [SeamUnionFallback(typeof(AcsEntranceWarningsUnrecognized))] + public abstract record AcsEntranceWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsEntranceWarningsSaltoKsEntranceAccessCodeSupportRemoved + : AcsEntranceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "salto_ks_entrance_access_code_support_removed"; + } + + public sealed record AcsEntranceWarningsEntranceSharesZone : AcsEntranceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "entrance_shares_zone"; + } + + public sealed record AcsEntranceWarningsEntranceSetupRequired : AcsEntranceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "entrance_setup_required"; + } + + public sealed record AcsEntranceWarningsSaltoKsPrivacyMode : AcsEntranceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "salto_ks_privacy_mode"; + } + + public sealed record AcsEntranceWarningsPrivacyMode : AcsEntranceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "privacy_mode"; + } + + public sealed record AcsEntranceWarningsUnrecognized + : AcsEntranceWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// ID of the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("acs_entrance_id")] + public string AcsEntranceId { get; init; } = default!; + + /// + /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// Akiles-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("akiles_metadata")] + public AcsEntranceAkilesMetadata? AkilesMetadata { get; init; } + + /// + /// ASSA ABLOY Vostio-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("assa_abloy_vostio_metadata")] + public AcsEntranceAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; init; } + + /// + /// Avigilon Alta-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("avigilon_alta_metadata")] + public AcsEntranceAvigilonAltaMetadata? AvigilonAltaMetadata { get; init; } + + /// + /// Brivo-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("brivo_metadata")] + public AcsEntranceBrivoMetadata? BrivoMetadata { get; init; } + + /// + /// Indicates whether the ACS entrance can belong to a reservation via an access_grant.reservation_key. + /// + [JsonPropertyName("can_belong_to_reservation")] + public bool? CanBelongToReservation { get; init; } + + /// + /// Indicates whether the ACS entrance can be unlocked with card credentials. + /// + [JsonPropertyName("can_unlock_with_card")] + public bool? CanUnlockWithCard { get; init; } + + /// + /// Indicates whether the ACS entrance can be unlocked with cloud key credentials. + /// + [JsonPropertyName("can_unlock_with_cloud_key")] + public bool? CanUnlockWithCloudKey { get; init; } + + /// + /// Indicates whether the ACS entrance can be unlocked with pin codes. + /// + [JsonPropertyName("can_unlock_with_code")] + public bool? CanUnlockWithCode { get; init; } + + /// + /// Indicates whether the ACS entrance can be unlocked with mobile key credentials. + /// + [JsonPropertyName("can_unlock_with_mobile_key")] + public bool? CanUnlockWithMobileKey { get; init; } + + /// + /// ID of the [connected account](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name for the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// dormakaba Ambiance-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("dormakaba_ambiance_metadata")] + public AcsEntranceDormakabaAmbianceMetadata? DormakabaAmbianceMetadata { get; init; } + + /// + /// dormakaba Community-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("dormakaba_community_metadata")] + public AcsEntranceDormakabaCommunityMetadata? DormakabaCommunityMetadata { get; init; } + + /// + /// Errors associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Hotek-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("hotek_metadata")] + public AcsEntranceHotekMetadata? HotekMetadata { get; init; } + + /// + /// Indicates whether the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) is currently locked. + /// + [JsonPropertyName("is_locked")] + public bool? IsLocked { get; init; } + + /// + /// Latch-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("latch_metadata")] + public AcsEntranceLatchMetadata? LatchMetadata { get; init; } + + /// + /// Salto KS-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("salto_ks_metadata")] + public AcsEntranceSaltoKsMetadata? SaltoKsMetadata { get; init; } + + /// + /// Salto Space-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("salto_space_metadata")] + public AcsEntranceSaltoSpaceMetadata? SaltoSpaceMetadata { get; init; } + + /// + /// IDs of the spaces that the entrance is in. + /// + [JsonPropertyName("space_ids")] + public List SpaceIds { get; init; } = default!; + + /// + /// Visionline-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("visionline_metadata")] + public AcsEntranceVisionlineMetadata? VisionlineMetadata { get; init; } + + /// + /// Warnings associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + } + + public sealed record AcsEntranceAkilesMetadata + { + /// + /// Actions the gadget exposes (for example, open). + /// + [JsonPropertyName("actions")] + public List? Actions { get; init; } + + /// + /// ID of the Akiles gadget. + /// + [JsonPropertyName("gadget_id")] + public string? GadgetId { get; init; } + + /// + /// ID of the Akiles site the gadget belongs to. + /// + [JsonPropertyName("site_id")] + public string? SiteId { get; init; } + + /// + /// Name of the Akiles site the gadget belongs to. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + } + + public sealed record AcsEntranceAkilesMetadataActions + { + /// + /// ID of the gadget action. + /// + [JsonPropertyName("id")] + public string? Id { get; init; } + + /// + /// Name of the gadget action. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record AcsEntranceAssaAbloyVostioMetadata + { + /// + /// Type of the door in the Vostio access system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DoorTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "CommonDoor")] + CommonDoor = 1, + + [EnumMember(Value = "EntranceDoor")] + EntranceDoor = 2, + + [EnumMember(Value = "GuestDoor")] + GuestDoor = 3, + + [EnumMember(Value = "Elevator")] + Elevator = 4, + } + + /// + /// Name of the door in the Vostio access system. + /// + [JsonPropertyName("door_name")] + public string? DoorName { get; init; } + + /// + /// Number of the door in the Vostio access system. + /// + [JsonPropertyName("door_number")] + public float? DoorNumber { get; init; } + + /// + /// Type of the door in the Vostio access system. + /// + [JsonPropertyName("door_type")] + public AcsEntranceAssaAbloyVostioMetadata.DoorTypeEnum? DoorType { get; init; } + + /// + /// PMS ID of the door in the Vostio access system. + /// + [JsonPropertyName("pms_id")] + public string? PmsId { get; init; } + + /// + /// Indicates whether keys are allowed to set the door in stand open mode in the Vostio access system. + /// + [JsonPropertyName("stand_open")] + public bool? StandOpen { get; init; } + } + + public sealed record AcsEntranceAvigilonAltaMetadata + { + /// + /// Entry name for an Avigilon Alta system. + /// + [JsonPropertyName("entry_name")] + public string? EntryName { get; init; } + + /// + /// Total count of entry relays for an Avigilon Alta system. + /// + [JsonPropertyName("entry_relays_total_count")] + public float? EntryRelaysTotalCount { get; init; } + + /// + /// Organization name for an Avigilon Alta system. + /// + [JsonPropertyName("org_name")] + public string? OrgName { get; init; } + + /// + /// Site ID for an Avigilon Alta system. + /// + [JsonPropertyName("site_id")] + public float? SiteId { get; init; } + + /// + /// Site name for an Avigilon Alta system. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + + /// + /// Zone ID for an Avigilon Alta system. + /// + [JsonPropertyName("zone_id")] + public float? ZoneId { get; init; } + + /// + /// Zone name for an Avigilon Alta system. + /// + [JsonPropertyName("zone_name")] + public string? ZoneName { get; init; } + } + + public sealed record AcsEntranceBrivoMetadata + { + /// + /// ID of the access point in the Brivo access system. + /// + [JsonPropertyName("access_point_id")] + public string? AccessPointId { get; init; } + + /// + /// ID of the site that the access point belongs to. + /// + [JsonPropertyName("site_id")] + public float? SiteId { get; init; } + + /// + /// Name of the site that the access point belongs to. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + } + + public sealed record AcsEntranceDormakabaAmbianceMetadata + { + /// + /// Name of the access point in the dormakaba Ambiance access system. + /// + [JsonPropertyName("access_point_name")] + public string? AccessPointName { get; init; } + } + + public sealed record AcsEntranceDormakabaCommunityMetadata + { + /// + /// Type of access point profile in the dormakaba Community access system. + /// + [JsonPropertyName("access_point_profile")] + public string? AccessPointProfile { get; init; } + } + + public sealed record AcsEntranceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsEntranceHotekMetadata + { + /// + /// Display name of the entrance. + /// + [JsonPropertyName("common_area_name")] + public string? CommonAreaName { get; init; } + + /// + /// Display name of the entrance. + /// + [JsonPropertyName("common_area_number")] + public string? CommonAreaNumber { get; init; } + + /// + /// Room number of the entrance. + /// + [JsonPropertyName("room_number")] + public string? RoomNumber { get; init; } + } + + public sealed record AcsEntranceLatchMetadata + { + /// + /// Accessibility type in the Latch access system. + /// + [JsonPropertyName("accessibility_type")] + public string? AccessibilityType { get; init; } + + /// + /// Name of the door in the Latch access system. + /// + [JsonPropertyName("door_name")] + public string? DoorName { get; init; } + + /// + /// Type of the door in the Latch access system. + /// + [JsonPropertyName("door_type")] + public string? DoorType { get; init; } + + /// + /// Indicates whether the entrance is connected. + /// + [JsonPropertyName("is_connected")] + public bool? IsConnected { get; init; } + } + + public sealed record AcsEntranceSaltoKsMetadata + { + /// + /// Battery level of the door access device. + /// + [JsonPropertyName("battery_level")] + public string? BatteryLevel { get; init; } + + /// + /// Name of the door in the Salto KS access system. + /// + [JsonPropertyName("door_name")] + public string? DoorName { get; init; } + + /// + /// Indicates whether an intrusion alarm is active on the door. + /// + [JsonPropertyName("intrusion_alarm")] + public bool? IntrusionAlarm { get; init; } + + /// + /// Indicates whether the door is left open. + /// + [JsonPropertyName("left_open_alarm")] + public bool? LeftOpenAlarm { get; init; } + + /// + /// Type of the lock in the Salto KS access system. + /// + [JsonPropertyName("lock_type")] + public string? LockType { get; init; } + + /// + /// Locked state of the door in the Salto KS access system. + /// + [JsonPropertyName("locked_state")] + public string? LockedState { get; init; } + + /// + /// Indicates whether the door access device is online. + /// + [JsonPropertyName("online")] + public bool? Online { get; init; } + + /// + /// Indicates whether privacy mode is enabled for the lock. + /// + [JsonPropertyName("privacy_mode")] + public bool? PrivacyMode { get; init; } + } + + public sealed record AcsEntranceSaltoSpaceMetadata + { + /// + /// Indicates whether AuditOnKeys is enabled for the door in the Salto Space access system. + /// + [JsonPropertyName("audit_on_keys")] + public bool? AuditOnKeys { get; init; } + + /// + /// Description of the door in the Salto Space access system. + /// + [JsonPropertyName("door_description")] + public string? DoorDescription { get; init; } + + /// + /// Door ID in the Salto Space access system. + /// + [JsonPropertyName("door_id")] + public string? DoorId { get; init; } + + /// + /// Name of the door in the Salto Space access system. + /// + [JsonPropertyName("door_name")] + public string? DoorName { get; init; } + + /// + /// Description of the room in the Salto Space access system. + /// + [JsonPropertyName("room_description")] + public string? RoomDescription { get; init; } + + /// + /// Name of the room in the Salto Space access system. + /// + [JsonPropertyName("room_name")] + public string? RoomName { get; init; } + } + + public sealed record AcsEntranceVisionlineMetadata + { + /// + /// Category of the door in the Visionline access system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DoorCategoryEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "entrance")] + Entrance = 1, + + [EnumMember(Value = "guest")] + Guest = 2, + + [EnumMember(Value = "elevator reader")] + ElevatorReader = 3, + + [EnumMember(Value = "common")] + Common = 4, + + [EnumMember(Value = "common (PMS)")] + CommonPms = 5, + } + + /// + /// Category of the door in the Visionline access system. + /// + [JsonPropertyName("door_category")] + public AcsEntranceVisionlineMetadata.DoorCategoryEnum? DoorCategory { get; init; } + + /// + /// Name of the door in the Visionline access system. + /// + [JsonPropertyName("door_name")] + public string? DoorName { get; init; } + + /// + /// Profile for the door in the Visionline access system. + /// + [JsonPropertyName("profiles")] + public List? Profiles { get; init; } + } + + public sealed record AcsEntranceVisionlineMetadataProfiles + { + /// + /// Door profile type in the Visionline access system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum VisionlineDoorProfileTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "BLE")] + Ble = 1, + + [EnumMember(Value = "commonDoor")] + CommonDoor = 2, + + [EnumMember(Value = "touch")] + Touch = 3, + } + + /// + /// Door profile ID in the Visionline access system. + /// + [JsonPropertyName("visionline_door_profile_id")] + public string? VisionlineDoorProfileId { get; init; } + + /// + /// Door profile type in the Visionline access system. + /// + [JsonPropertyName("visionline_door_profile_type")] + public AcsEntranceVisionlineMetadataProfiles.VisionlineDoorProfileTypeEnum? VisionlineDoorProfileType { get; init; } + } +} diff --git a/src/Seam/Models/AcsSystem.cs b/src/Seam/Models/AcsSystem.cs new file mode 100644 index 00000000..7fff7d5e --- /dev/null +++ b/src/Seam/Models/AcsSystem.cs @@ -0,0 +1,481 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + /// Within an `acs_system`, create [`acs_user`s](https://docs.seam.co/api/acs/users/object) and [`acs_credential`s](https://docs.seam.co/api/acs/credentials/object) to grant access to the `acs_user`s. + /// + /// For details about the resources associated with an access control system, see the [access control systems namespace](https://docs.seam.co/api/acs). + /// + public sealed record AcsSystem + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant( + "seam_bridge_disconnected", + typeof(AcsSystemErrorsSeamBridgeDisconnected) + )] + [SeamUnionVariant("bridge_disconnected", typeof(AcsSystemErrorsBridgeDisconnected))] + [SeamUnionVariant( + "visionline_instance_unreachable", + typeof(AcsSystemErrorsVisionlineInstanceUnreachable) + )] + [SeamUnionVariant( + "salto_ks_subscription_limit_exceeded", + typeof(AcsSystemErrorsSaltoKsSubscriptionLimitExceeded) + )] + [SeamUnionVariant( + "insufficient_permissions", + typeof(AcsSystemErrorsInsufficientPermissions) + )] + [SeamUnionVariant("acs_system_disconnected", typeof(AcsSystemErrorsAcsSystemDisconnected))] + [SeamUnionVariant("account_disconnected", typeof(AcsSystemErrorsAccountDisconnected))] + [SeamUnionVariant( + "salto_ks_certification_expired", + typeof(AcsSystemErrorsSaltoKsCertificationExpired) + )] + [SeamUnionVariant( + "provider_service_unavailable", + typeof(AcsSystemErrorsProviderServiceUnavailable) + )] + [SeamUnionFallback(typeof(AcsSystemErrorsUnrecognized))] + public abstract record AcsSystemErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsSystemErrorsSeamBridgeDisconnected : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "seam_bridge_disconnected"; + } + + public sealed record AcsSystemErrorsBridgeDisconnected : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "bridge_disconnected"; + + /// + /// Indicates whether the error is related to the [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). + /// + [JsonPropertyName("is_bridge_error")] + public bool? IsBridgeError { get; init; } + } + + public sealed record AcsSystemErrorsVisionlineInstanceUnreachable : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "visionline_instance_unreachable"; + } + + public sealed record AcsSystemErrorsSaltoKsSubscriptionLimitExceeded : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; + } + + public sealed record AcsSystemErrorsInsufficientPermissions : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "insufficient_permissions"; + } + + public sealed record AcsSystemErrorsAcsSystemDisconnected : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "acs_system_disconnected"; + } + + public sealed record AcsSystemErrorsAccountDisconnected : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "account_disconnected"; + } + + public sealed record AcsSystemErrorsSaltoKsCertificationExpired : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "salto_ks_certification_expired"; + } + + public sealed record AcsSystemErrorsProviderServiceUnavailable : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "provider_service_unavailable"; + } + + public sealed record AcsSystemErrorsUnrecognized : AcsSystemErrors, ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Brand-specific terminology for the [access control system](https://docs.seam.co/low-level-apis/access-systems) type. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExternalTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pti_site")] + PtiSite = 1, + + [EnumMember(Value = "avigilon_alta_org")] + AvigilonAltaOrg = 2, + + [EnumMember(Value = "salto_ks_site")] + SaltoKsSite = 3, + + [EnumMember(Value = "salto_space_system")] + SaltoSpaceSystem = 4, + + [EnumMember(Value = "brivo_account")] + BrivoAccount = 5, + + [EnumMember(Value = "hid_credential_manager_organization")] + HidCredentialManagerOrganization = 6, + + [EnumMember(Value = "visionline_system")] + VisionlineSystem = 7, + + [EnumMember(Value = "assa_abloy_credential_service")] + AssaAbloyCredentialService = 8, + + [EnumMember(Value = "latch_building")] + LatchBuilding = 9, + + [EnumMember(Value = "dormakaba_community_site")] + DormakabaCommunitySite = 10, + + [EnumMember(Value = "dormakaba_ambiance_site")] + DormakabaAmbianceSite = 11, + + [EnumMember(Value = "legic_connect_credential_service")] + LegicConnectCredentialService = 12, + + [EnumMember(Value = "assa_abloy_vostio")] + AssaAbloyVostio = 13, + + [EnumMember(Value = "assa_abloy_vostio_credential_service")] + AssaAbloyVostioCredentialService = 14, + + [EnumMember(Value = "hotek_site")] + HotekSite = 15, + + [EnumMember(Value = "kisi_organization")] + KisiOrganization = 16, + + [EnumMember(Value = "akiles_organization")] + AkilesOrganization = 17, + } + + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum SystemTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pti_site")] + PtiSite = 1, + + [EnumMember(Value = "avigilon_alta_org")] + AvigilonAltaOrg = 2, + + [EnumMember(Value = "salto_ks_site")] + SaltoKsSite = 3, + + [EnumMember(Value = "salto_space_system")] + SaltoSpaceSystem = 4, + + [EnumMember(Value = "brivo_account")] + BrivoAccount = 5, + + [EnumMember(Value = "hid_credential_manager_organization")] + HidCredentialManagerOrganization = 6, + + [EnumMember(Value = "visionline_system")] + VisionlineSystem = 7, + + [EnumMember(Value = "assa_abloy_credential_service")] + AssaAbloyCredentialService = 8, + + [EnumMember(Value = "latch_building")] + LatchBuilding = 9, + + [EnumMember(Value = "dormakaba_community_site")] + DormakabaCommunitySite = 10, + + [EnumMember(Value = "dormakaba_ambiance_site")] + DormakabaAmbianceSite = 11, + + [EnumMember(Value = "legic_connect_credential_service")] + LegicConnectCredentialService = 12, + + [EnumMember(Value = "assa_abloy_vostio")] + AssaAbloyVostio = 13, + + [EnumMember(Value = "assa_abloy_vostio_credential_service")] + AssaAbloyVostioCredentialService = 14, + + [EnumMember(Value = "hotek_site")] + HotekSite = 15, + + [EnumMember(Value = "kisi_organization")] + KisiOrganization = 16, + + [EnumMember(Value = "akiles_organization")] + AkilesOrganization = 17, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant( + "salto_ks_subscription_limit_almost_reached", + typeof(AcsSystemWarningsSaltoKsSubscriptionLimitAlmostReached) + )] + [SeamUnionVariant( + "time_zone_does_not_match_location", + typeof(AcsSystemWarningsTimeZoneDoesNotMatchLocation) + )] + [SeamUnionVariant("setup_required", typeof(AcsSystemWarningsSetupRequired))] + [SeamUnionVariant( + "unknown_issue_with_acs_system", + typeof(AcsSystemWarningsUnknownIssueWithAcsSystem) + )] + [SeamUnionFallback(typeof(AcsSystemWarningsUnrecognized))] + public abstract record AcsSystemWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsSystemWarningsSaltoKsSubscriptionLimitAlmostReached + : AcsSystemWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "salto_ks_subscription_limit_almost_reached"; + } + + public sealed record AcsSystemWarningsTimeZoneDoesNotMatchLocation : AcsSystemWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "time_zone_does_not_match_location"; + + [Obsolete("this field is deprecated.")] + [JsonPropertyName("misconfigured_acs_entrance_ids")] + public List? MisconfiguredAcsEntranceIds { get; init; } + } + + public sealed record AcsSystemWarningsSetupRequired : AcsSystemWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "setup_required"; + } + + public sealed record AcsSystemWarningsUnknownIssueWithAcsSystem : AcsSystemWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unknown_issue_with_acs_system"; + } + + public sealed record AcsSystemWarningsUnrecognized + : AcsSystemWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Number of access groups in the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("acs_access_group_count")] + public float? AcsAccessGroupCount { get; init; } + + /// + /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// Number of users in the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("acs_user_count")] + public float? AcsUserCount { get; init; } + + /// + /// ID of the connected account associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [Obsolete("Use `connected_account_id`.")] + [JsonPropertyName("connected_account_ids")] + public List ConnectedAccountIds { get; init; } = default!; + + /// + /// Date and time at which the [access control system](https://docs.seam.co/low-level-apis/access-systems) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// ID of the default credential manager `acs_system` for this [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("default_credential_manager_acs_system_id")] + public string? DefaultCredentialManagerAcsSystemId { get; init; } + + /// + /// Errors associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Brand-specific terminology for the [access control system](https://docs.seam.co/low-level-apis/access-systems) type. + /// + [JsonPropertyName("external_type")] + public AcsSystem.ExternalTypeEnum? ExternalType { get; init; } + + /// + /// Display name that corresponds to the brand-specific terminology for the [access control system](https://docs.seam.co/low-level-apis/access-systems) type. + /// + [JsonPropertyName("external_type_display_name")] + public string? ExternalTypeDisplayName { get; init; } + + /// + /// Alternative text for the [access control system](https://docs.seam.co/low-level-apis/access-systems) image. + /// + [JsonPropertyName("image_alt_text")] + public string ImageAltText { get; init; } = default!; + + /// + /// URL for the image that represents the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("image_url")] + public string ImageUrl { get; init; } = default!; + + /// + /// Indicates whether the `acs_system` is a credential manager. + /// + [JsonPropertyName("is_credential_manager")] + public bool IsCredentialManager { get; init; } = default!; + + /// + /// Location information for the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("location")] + public AcsSystemLocation Location { get; init; } = default!; + + /// + /// Name of the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("name")] + public string Name { get; init; } = default!; + + [Obsolete("Use `external_type`.")] + [JsonPropertyName("system_type")] + public AcsSystem.SystemTypeEnum? SystemType { get; init; } + + [Obsolete("Use `external_type_display_name`.")] + [JsonPropertyName("system_type_display_name")] + public string? SystemTypeDisplayName { get; init; } + + /// + /// Visionline-specific metadata for the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("visionline_metadata")] + public AcsSystemVisionlineMetadata? VisionlineMetadata { get; init; } + + /// + /// Warnings associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the workspace that contains the [access control system](https://docs.seam.co/low-level-apis/access-systems). + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record AcsSystemLocation + { + /// + /// Time zone in which the [access control system](https://docs.seam.co/low-level-apis/access-systems) is located. + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + } + + public sealed record AcsSystemVisionlineMetadata + { + /// + /// IP address or hostname of the main Visionline server relative to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge) on the local network. + /// + [JsonPropertyName("lan_address")] + public string? LanAddress { get; init; } + + /// + /// Keyset loaded into a reader. Mobile keys and reader administration tools securely authenticate only with readers programmed with a matching keyset. + /// + [JsonPropertyName("mobile_access_uuid")] + public string? MobileAccessUuid { get; init; } + + /// + /// Unique ID assigned by the ASSA ABLOY licensing team that identifies each hotel in your credential manager. + /// + [JsonPropertyName("system_id")] + public string? SystemId { get; init; } + } +} diff --git a/src/Seam/Models/AcsUser.cs b/src/Seam/Models/AcsUser.cs new file mode 100644 index 00000000..462f739e --- /dev/null +++ b/src/Seam/Models/AcsUser.cs @@ -0,0 +1,744 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a [user](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access system](https://docs.seam.co/low-level-apis/access-systems). + /// + /// An access system user typically refers to an individual who requires access, like an employee or resident. Each user can possess multiple credentials that serve as their keys or identifiers for access. The type of credential can vary widely. For example, in the Salto system, a user can have a PIN code, a mobile app account, and a fob. In other platforms, it is not uncommon for a user to have more than one of the same credential type, such as multiple key cards. Additionally, these credentials can have a schedule or validity period. + /// + /// For details about how to configure users in your access system, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). + /// + public sealed record AcsUser + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("deleted_externally", typeof(AcsUserErrorsDeletedExternally))] + [SeamUnionVariant( + "salto_ks_subscription_limit_exceeded", + typeof(AcsUserErrorsSaltoKsSubscriptionLimitExceeded) + )] + [SeamUnionVariant( + "failed_to_create_on_acs_system", + typeof(AcsUserErrorsFailedToCreateOnAcsSystem) + )] + [SeamUnionVariant( + "failed_to_update_on_acs_system", + typeof(AcsUserErrorsFailedToUpdateOnAcsSystem) + )] + [SeamUnionVariant( + "failed_to_delete_on_acs_system", + typeof(AcsUserErrorsFailedToDeleteOnAcsSystem) + )] + [SeamUnionVariant( + "latch_conflict_with_resident_user", + typeof(AcsUserErrorsLatchConflictWithResidentUser) + )] + [SeamUnionFallback(typeof(AcsUserErrorsUnrecognized))] + public abstract record AcsUserErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsUserErrorsDeletedExternally : AcsUserErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "deleted_externally"; + } + + public sealed record AcsUserErrorsSaltoKsSubscriptionLimitExceeded : AcsUserErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; + } + + public sealed record AcsUserErrorsFailedToCreateOnAcsSystem : AcsUserErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_create_on_acs_system"; + } + + public sealed record AcsUserErrorsFailedToUpdateOnAcsSystem : AcsUserErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_update_on_acs_system"; + } + + public sealed record AcsUserErrorsFailedToDeleteOnAcsSystem : AcsUserErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_delete_on_acs_system"; + } + + public sealed record AcsUserErrorsLatchConflictWithResidentUser : AcsUserErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "latch_conflict_with_resident_user"; + } + + public sealed record AcsUserErrorsUnrecognized : AcsUserErrors, ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Brand-specific terminology for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) type. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExternalTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pti_user")] + PtiUser = 1, + + [EnumMember(Value = "brivo_user")] + BrivoUser = 2, + + [EnumMember(Value = "hid_credential_manager_user")] + HidCredentialManagerUser = 3, + + [EnumMember(Value = "salto_site_user")] + SaltoSiteUser = 4, + + [EnumMember(Value = "latch_user")] + LatchUser = 5, + + [EnumMember(Value = "dormakaba_community_user")] + DormakabaCommunityUser = 6, + + [EnumMember(Value = "salto_space_user")] + SaltoSpaceUser = 7, + + [EnumMember(Value = "avigilon_alta_user")] + AvigilonAltaUser = 8, + + [EnumMember(Value = "kisi_user")] + KisiUser = 9, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("mutation_code")] + [SeamUnionVariant("creating", typeof(AcsUserPendingMutationsCreating))] + [SeamUnionVariant("deleting", typeof(AcsUserPendingMutationsDeleting))] + [SeamUnionVariant("deferring_creation", typeof(AcsUserPendingMutationsDeferringCreation))] + [SeamUnionVariant( + "updating_user_information", + typeof(AcsUserPendingMutationsUpdatingUserInformation) + )] + [SeamUnionVariant( + "updating_access_schedule", + typeof(AcsUserPendingMutationsUpdatingAccessSchedule) + )] + [SeamUnionVariant( + "updating_suspension_state", + typeof(AcsUserPendingMutationsUpdatingSuspensionState) + )] + [SeamUnionVariant( + "updating_group_membership", + typeof(AcsUserPendingMutationsUpdatingGroupMembership) + )] + [SeamUnionVariant( + "deferring_group_membership_update", + typeof(AcsUserPendingMutationsDeferringGroupMembershipUpdate) + )] + [SeamUnionVariant( + "updating_credential_assignment", + typeof(AcsUserPendingMutationsUpdatingCredentialAssignment) + )] + [SeamUnionFallback(typeof(AcsUserPendingMutationsUnrecognized))] + public abstract record AcsUserPendingMutations + { + /// The value of the mutation_code discriminator. + public abstract string MutationCode { get; } + + /// + /// Date and time at which the mutation was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the mutation. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsUserPendingMutationsCreating : AcsUserPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "creating"; + } + + public sealed record AcsUserPendingMutationsDeleting : AcsUserPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "deleting"; + } + + public sealed record AcsUserPendingMutationsDeferringCreation : AcsUserPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "deferring_creation"; + + /// + /// Optional: When the user creation is scheduled to occur. + /// + [JsonPropertyName("scheduled_at")] + public string? ScheduledAt { get; init; } + } + + public sealed record AcsUserPendingMutationsUpdatingUserInformation + : AcsUserPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_user_information"; + + /// + /// Old access system user information. + /// + [JsonPropertyName("from")] + public AcsUserPendingMutationsUpdatingUserInformationFrom From { get; init; } = + default!; + + /// + /// New access system user information. + /// + [JsonPropertyName("to")] + public AcsUserPendingMutationsUpdatingUserInformationTo To { get; init; } = default!; + } + + public sealed record AcsUserPendingMutationsUpdatingUserInformationFrom + { + /// + /// Email address of the access system user. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Full name of the access system user. + /// + [JsonPropertyName("full_name")] + public string? FullName { get; init; } + + /// + /// Phone number of the access system user. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + } + + public sealed record AcsUserPendingMutationsUpdatingUserInformationTo + { + /// + /// Email address of the access system user. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Full name of the access system user. + /// + [JsonPropertyName("full_name")] + public string? FullName { get; init; } + + /// + /// Phone number of the access system user. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + } + + public sealed record AcsUserPendingMutationsUpdatingAccessSchedule : AcsUserPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_access_schedule"; + + /// + /// Old access schedule information. + /// + [JsonPropertyName("from")] + public AcsUserPendingMutationsUpdatingAccessScheduleFrom From { get; init; } = default!; + + /// + /// New access schedule information. + /// + [JsonPropertyName("to")] + public AcsUserPendingMutationsUpdatingAccessScheduleTo To { get; init; } = default!; + } + + public sealed record AcsUserPendingMutationsUpdatingAccessScheduleFrom + { + /// + /// Starting time for the access schedule. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Starting time for the access schedule. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AcsUserPendingMutationsUpdatingAccessScheduleTo + { + /// + /// Starting time for the access schedule. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Starting time for the access schedule. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record AcsUserPendingMutationsUpdatingSuspensionState + : AcsUserPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_suspension_state"; + + /// + /// Old user suspension state information. + /// + [JsonPropertyName("from")] + public AcsUserPendingMutationsUpdatingSuspensionStateFrom From { get; init; } = + default!; + + /// + /// New user suspension state information. + /// + [JsonPropertyName("to")] + public AcsUserPendingMutationsUpdatingSuspensionStateTo To { get; init; } = default!; + } + + public sealed record AcsUserPendingMutationsUpdatingSuspensionStateFrom + { + [JsonPropertyName("is_suspended")] + public bool IsSuspended { get; init; } = default!; + } + + public sealed record AcsUserPendingMutationsUpdatingSuspensionStateTo + { + [JsonPropertyName("is_suspended")] + public bool IsSuspended { get; init; } = default!; + } + + public sealed record AcsUserPendingMutationsUpdatingGroupMembership + : AcsUserPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_group_membership"; + + /// + /// Old access group membership. + /// + [JsonPropertyName("from")] + public AcsUserPendingMutationsUpdatingGroupMembershipFrom From { get; init; } = + default!; + + /// + /// New access group membership. + /// + [JsonPropertyName("to")] + public AcsUserPendingMutationsUpdatingGroupMembershipTo To { get; init; } = default!; + } + + public sealed record AcsUserPendingMutationsUpdatingGroupMembershipFrom + { + /// + /// Old access group ID. + /// + [JsonPropertyName("acs_access_group_id")] + public string? AcsAccessGroupId { get; init; } + } + + public sealed record AcsUserPendingMutationsUpdatingGroupMembershipTo + { + /// + /// New access group ID. + /// + [JsonPropertyName("acs_access_group_id")] + public string? AcsAccessGroupId { get; init; } + } + + public sealed record AcsUserPendingMutationsDeferringGroupMembershipUpdate + : AcsUserPendingMutations + { + /// + /// Whether the user is scheduled to be added to or removed from the access group. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum VariantEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "adding")] + Adding = 1, + + [EnumMember(Value = "removing")] + Removing = 2, + } + + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "deferring_group_membership_update"; + + /// + /// ID of the access group involved in the scheduled change. + /// + [JsonPropertyName("acs_access_group_id")] + public string AcsAccessGroupId { get; init; } = default!; + + /// + /// Whether the user is scheduled to be added to or removed from the access group. + /// + [JsonPropertyName("variant")] + public AcsUserPendingMutationsDeferringGroupMembershipUpdate.VariantEnum Variant { get; init; } = + default!; + } + + public sealed record AcsUserPendingMutationsUpdatingCredentialAssignment + : AcsUserPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_credential_assignment"; + + /// + /// Previous credential assignment. + /// + [JsonPropertyName("from")] + public AcsUserPendingMutationsUpdatingCredentialAssignmentFrom From { get; init; } = + default!; + + /// + /// New credential assignment. + /// + [JsonPropertyName("to")] + public AcsUserPendingMutationsUpdatingCredentialAssignmentTo To { get; init; } = + default!; + } + + public sealed record AcsUserPendingMutationsUpdatingCredentialAssignmentFrom + { + /// + /// Previous credential ID. + /// + [JsonPropertyName("acs_credential_id")] + public string? AcsCredentialId { get; init; } + } + + public sealed record AcsUserPendingMutationsUpdatingCredentialAssignmentTo + { + /// + /// New credential ID. + /// + [JsonPropertyName("acs_credential_id")] + public string? AcsCredentialId { get; init; } + } + + public sealed record AcsUserPendingMutationsUnrecognized + : AcsUserPendingMutations, + ISeamUnrecognizedVariant + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant("being_deleted", typeof(AcsUserWarningsBeingDeleted))] + [SeamUnionVariant( + "salto_ks_user_not_subscribed", + typeof(AcsUserWarningsSaltoKsUserNotSubscribed) + )] + [SeamUnionVariant("acs_user_inactive", typeof(AcsUserWarningsAcsUserInactive))] + [SeamUnionVariant( + "unknown_issue_with_acs_user", + typeof(AcsUserWarningsUnknownIssueWithAcsUser) + )] + [SeamUnionVariant("latch_resident_user", typeof(AcsUserWarningsLatchResidentUser))] + [SeamUnionFallback(typeof(AcsUserWarningsUnrecognized))] + public abstract record AcsUserWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record AcsUserWarningsBeingDeleted : AcsUserWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record AcsUserWarningsSaltoKsUserNotSubscribed : AcsUserWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "salto_ks_user_not_subscribed"; + } + + public sealed record AcsUserWarningsAcsUserInactive : AcsUserWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "acs_user_inactive"; + } + + public sealed record AcsUserWarningsUnknownIssueWithAcsUser : AcsUserWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unknown_issue_with_acs_user"; + } + + public sealed record AcsUserWarningsLatchResidentUser : AcsUserWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "latch_resident_user"; + } + + public sealed record AcsUserWarningsUnrecognized : AcsUserWarnings, ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// `starts_at` and `ends_at` timestamps for the [access system user's](https://docs.seam.co/low-level-apis/access-systems/user-management) access. + /// + [JsonPropertyName("access_schedule")] + public AcsUserAccessSchedule? AccessSchedule { get; init; } + + /// + /// ID of the [access system](https://docs.seam.co/low-level-apis/access-systems) that contains the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("acs_user_id")] + public string AcsUserId { get; init; } = default!; + + /// + /// The ID of the connected account that is associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + [Obsolete("use email_address.")] + [JsonPropertyName("email")] + public string? Email { get; init; } + + /// + /// Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Errors associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Brand-specific terminology for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) type. + /// + [JsonPropertyName("external_type")] + public AcsUser.ExternalTypeEnum? ExternalType { get; init; } + + /// + /// Display name that corresponds to the brand-specific terminology for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) type. + /// + [JsonPropertyName("external_type_display_name")] + public string? ExternalTypeDisplayName { get; init; } + + /// + /// Full name of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("full_name")] + public string? FullName { get; init; } + + /// + /// ID of the HID access control system associated with the user. + /// + [JsonPropertyName("hid_acs_system_id")] + public string? HidAcsSystemId { get; init; } + + /// + /// Indicates whether Seam manages the access system user. + /// + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Indicates whether the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) is currently [suspended](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users). + /// + [JsonPropertyName("is_suspended")] + public bool? IsSuspended { get; init; } + + /// + /// Pending mutations associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Seam is in the process of pushing these mutations to the integrated access system. + /// + [JsonPropertyName("pending_mutations")] + public List? PendingMutations { get; init; } + + /// + /// Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// Salto KS-specific metadata associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("salto_ks_metadata")] + public AcsUserSaltoKsMetadata? SaltoKsMetadata { get; init; } + + /// + /// Salto Space-specific metadata associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("salto_space_metadata")] + public AcsUserSaltoSpaceMetadata? SaltoSpaceMetadata { get; init; } + + /// + /// Email address of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("user_identity_email_address")] + public string? UserIdentityEmailAddress { get; init; } + + /// + /// Full name of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("user_identity_full_name")] + public string? UserIdentityFullName { get; init; } + + /// + /// ID of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Phone number of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). + /// + [JsonPropertyName("user_identity_phone_number")] + public string? UserIdentityPhoneNumber { get; init; } + + /// + /// Warnings associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the workspace that contains the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record AcsUserAccessSchedule + { + /// + /// Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string StartsAt { get; init; } = default!; + } + + public sealed record AcsUserSaltoKsMetadata + { + /// + /// Indicates whether the user holds an active subscription slot on the Salto KS site. Only subscribed users can unlock doors and count against the site's user-subscription limit. A user may not be subscribed because their access schedule has not started or has ended, the site has reached its subscription limit, or they were manually unsubscribed. This is distinct from `is_suspended`, which reflects whether the user has been explicitly blocked. + /// + [JsonPropertyName("is_subscribed")] + public bool? IsSubscribed { get; init; } + } + + public sealed record AcsUserSaltoSpaceMetadata + { + /// + /// Indicates whether AuditOpenings is enabled for the user in the Salto Space access system. + /// + [JsonPropertyName("audit_openings")] + public bool? AuditOpenings { get; init; } + + /// + /// User ID in the Salto Space access system. + /// + [JsonPropertyName("user_id")] + public string? UserId { get; init; } + } +} diff --git a/src/Seam/Models/ActionAttempt.cs b/src/Seam/Models/ActionAttempt.cs new file mode 100644 index 00000000..0a7bbca2 --- /dev/null +++ b/src/Seam/Models/ActionAttempt.cs @@ -0,0 +1,2273 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("action_type")] + [SeamUnionVariant("LOCK_DOOR", typeof(ActionAttemptLockDoor))] + [SeamUnionVariant("UNLOCK_DOOR", typeof(ActionAttemptUnlockDoor))] + [SeamUnionVariant("SCAN_CREDENTIAL", typeof(ActionAttemptScanCredential))] + [SeamUnionVariant("ENCODE_CREDENTIAL", typeof(ActionAttemptEncodeCredential))] + [SeamUnionVariant("SCAN_TO_ASSIGN_CREDENTIAL", typeof(ActionAttemptScanToAssignCredential))] + [SeamUnionVariant("ASSIGN_CREDENTIAL", typeof(ActionAttemptAssignCredential))] + [SeamUnionVariant("RESET_SANDBOX_WORKSPACE", typeof(ActionAttemptResetSandboxWorkspace))] + [SeamUnionVariant("SET_FAN_MODE", typeof(ActionAttemptSetFanMode))] + [SeamUnionVariant("SET_HVAC_MODE", typeof(ActionAttemptSetHvacMode))] + [SeamUnionVariant("ACTIVATE_CLIMATE_PRESET", typeof(ActionAttemptActivateClimatePreset))] + [SeamUnionVariant("SIMULATE_KEYPAD_CODE_ENTRY", typeof(ActionAttemptSimulateKeypadCodeEntry))] + [SeamUnionVariant( + "SIMULATE_MANUAL_LOCK_VIA_KEYPAD", + typeof(ActionAttemptSimulateManualLockViaKeypad) + )] + [SeamUnionVariant("PUSH_THERMOSTAT_PROGRAMS", typeof(ActionAttemptPushThermostatPrograms))] + [SeamUnionVariant("CONFIGURE_AUTO_LOCK", typeof(ActionAttemptConfigureAutoLock))] + [SeamUnionVariant("SYNC_ACCESS_CODES", typeof(ActionAttemptSyncAccessCodes))] + [SeamUnionVariant("CREATE_ACCESS_CODE", typeof(ActionAttemptCreateAccessCode))] + [SeamUnionVariant("DELETE_ACCESS_CODE", typeof(ActionAttemptDeleteAccessCode))] + [SeamUnionVariant("UPDATE_ACCESS_CODE", typeof(ActionAttemptUpdateAccessCode))] + [SeamUnionVariant("CREATE_NOISE_THRESHOLD", typeof(ActionAttemptCreateNoiseThreshold))] + [SeamUnionVariant("DELETE_NOISE_THRESHOLD", typeof(ActionAttemptDeleteNoiseThreshold))] + [SeamUnionVariant("UPDATE_NOISE_THRESHOLD", typeof(ActionAttemptUpdateNoiseThreshold))] + [SeamUnionFallback(typeof(ActionAttemptUnrecognized))] + public abstract record ActionAttempt + { + /// The value of the action_type discriminator. + public abstract string ActionType { get; } + + /// + /// ID of the action attempt. + /// + [JsonPropertyName("action_attempt_id")] + public string ActionAttemptId { get; init; } = default!; + + /// + /// The status of the action attempt. + /// + [JsonPropertyName("status")] + public ActionAttemptStatus Status { get; init; } + + /// + /// The error of a failed action attempt, or null. + /// + [JsonPropertyName("error")] + public ActionAttemptError? Error { get; init; } + } + + /// + /// Locking a door is pending. + /// + public sealed record ActionAttemptLockDoor : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "LOCK_DOOR"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptLockDoorResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptLockDoorResult + { + /// + /// Indicates whether the device confirmed that the lock action occurred. + /// + [JsonPropertyName("was_confirmed_by_device")] + public bool? WasConfirmedByDevice { get; init; } + } + + /// + /// Unlocking a door is pending. + /// + public sealed record ActionAttemptUnlockDoor : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "UNLOCK_DOOR"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptUnlockDoorResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptUnlockDoorResult + { + /// + /// Indicates whether the device confirmed that the unlock action occurred. + /// + [JsonPropertyName("was_confirmed_by_device")] + public bool? WasConfirmedByDevice { get; init; } + } + + /// + /// Reading credential data from the physical encoder is pending. + /// + public sealed record ActionAttemptScanCredential : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "SCAN_CREDENTIAL"; + + /// + /// Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. + /// + [JsonPropertyName("result")] + public ActionAttemptScanCredentialResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptScanCredentialResult + { + /// + /// Snapshot of credential data read from the physical encoder. + /// + [JsonPropertyName("acs_credential_on_encoder")] + public ActionAttemptScanCredentialResultAcsCredentialOnEncoder? AcsCredentialOnEncoder { get; init; } + + /// + /// Corresponding credential data as stored on Seam and the access system. + /// + [JsonPropertyName("acs_credential_on_seam")] + public ActionAttemptScanCredentialResultAcsCredentialOnSeam? AcsCredentialOnSeam { get; init; } + + /// + /// Warnings related to scanning the credential, such as mismatches between the credential data currently encoded on the card and the corresponding data stored on Seam and the access system. + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + } + + public sealed record ActionAttemptScanCredentialResultAcsCredentialOnEncoder + { + /// + /// A number or string that physically identifies the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("card_number")] + public string? CardNumber { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) will stop being usable. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Indicates whether the credential has been issued (encoded onto a card). + /// + [JsonPropertyName("is_issued")] + public bool? IsIssued { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) becomes usable. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("visionline_metadata")] + public ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata? VisionlineMetadata { get; init; } + } + + public sealed record ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata + { + /// + /// Format of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum CardFormatEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "TLCode")] + TlCode = 1, + + [EnumMember(Value = "rfid48")] + Rfid48 = 2, + } + + /// + /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is cancelled. + /// + [JsonPropertyName("cancelled")] + public bool? Cancelled { get; init; } + + /// + /// Format of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("card_format")] + public ActionAttemptScanCredentialResultAcsCredentialOnEncoderVisionlineMetadata.CardFormatEnum? CardFormat { get; init; } + + /// + /// Holder of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("card_holder")] + public string? CardHolder { get; init; } + + /// + /// Card ID for the Visionline card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("card_id")] + public string? CardId { get; init; } + + /// + /// IDs of the common [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("common_acs_entrance_ids")] + public List? CommonAcsEntranceIds { get; init; } + + /// + /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is discarded. + /// + [JsonPropertyName("discarded")] + public bool? Discarded { get; init; } + + /// + /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is expired. + /// + [JsonPropertyName("expired")] + public bool? Expired { get; init; } + + /// + /// IDs of the guest [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("guest_acs_entrance_ids")] + public List? GuestAcsEntranceIds { get; init; } + + /// + /// Number of issued cards associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("number_of_issued_cards")] + public float? NumberOfIssuedCards { get; init; } + + /// + /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is overridden. + /// + [JsonPropertyName("overridden")] + public bool? Overridden { get; init; } + + /// + /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is overwritten. + /// + [JsonPropertyName("overwritten")] + public bool? Overwritten { get; init; } + + /// + /// Indicates whether the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is pending auto-update. + /// + [JsonPropertyName("pending_auto_update")] + public bool? PendingAutoUpdate { get; init; } + } + + public sealed record ActionAttemptScanCredentialResultAcsCredentialOnSeam + { + /// + /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AccessMethodEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExternalTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pti_card")] + PtiCard = 1, + + [EnumMember(Value = "brivo_credential")] + BrivoCredential = 2, + + [EnumMember(Value = "hid_credential")] + HidCredential = 3, + + [EnumMember(Value = "visionline_card")] + VisionlineCard = 4, + + [EnumMember(Value = "salto_ks_credential")] + SaltoKsCredential = 5, + + [EnumMember(Value = "assa_abloy_vostio_key")] + AssaAbloyVostioKey = 6, + + [EnumMember(Value = "salto_space_key")] + SaltoSpaceKey = 7, + + [EnumMember(Value = "latch_access")] + LatchAccess = 8, + + [EnumMember(Value = "dormakaba_ambiance_credential")] + DormakabaAmbianceCredential = 9, + + [EnumMember(Value = "hotek_card")] + HotekCard = 10, + + [EnumMember(Value = "salto_ks_tag")] + SaltoKsTag = 11, + + [EnumMember(Value = "avigilon_alta_credential")] + AvigilonAltaCredential = 12, + + [EnumMember(Value = "kisi_credential")] + KisiCredential = 13, + + [EnumMember(Value = "akiles_credential")] + AkilesCredential = 14, + } + + /// + /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("access_method")] + public ActionAttemptScanCredentialResultAcsCredentialOnSeam.AccessMethodEnum AccessMethod { get; init; } = + default!; + + /// + /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("acs_credential_id")] + public string AcsCredentialId { get; init; } = default!; + + /// + /// ID of the credential pool to which the credential belongs. + /// + [JsonPropertyName("acs_credential_pool_id")] + public string? AcsCredentialPoolId { get; init; } + + /// + /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// Akiles-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("akiles_metadata")] + public ActionAttemptScanCredentialResultAcsCredentialOnSeamAkilesMetadata? AkilesMetadata { get; init; } + + /// + /// Vostio-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("assa_abloy_vostio_metadata")] + public ActionAttemptScanCredentialResultAcsCredentialOnSeamAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; init; } + + /// + /// Number of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("card_number")] + public string? CardNumber { get; init; } + + /// + /// Access (PIN) code for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// ID of the [connected account](https://docs.seam.co/core-concepts/connected-accounts) to which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name that corresponds to the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Errors associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = + default!; + + /// + /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. + /// + [JsonPropertyName("external_type")] + public ActionAttemptScanCredentialResultAcsCredentialOnSeam.ExternalTypeEnum? ExternalType { get; init; } + + /// + /// Display name that corresponds to the brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + /// + [JsonPropertyName("external_type_display_name")] + public string? ExternalTypeDisplayName { get; init; } + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been encoded onto a card. + /// + [JsonPropertyName("is_issued")] + public bool? IsIssued { get; init; } + + /// + /// Indicates whether the latest state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been synced from Seam to the provider. + /// + [JsonPropertyName("is_latest_desired_state_synced_with_provider")] + public bool? IsLatestDesiredStateSyncedWithProvider { get; init; } + + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). + /// + [JsonPropertyName("is_multi_phone_sync_credential")] + public bool? IsMultiPhoneSyncCredential { get; init; } + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) can only be used once. If `true`, the code becomes invalid after the first use. + /// + [JsonPropertyName("is_one_time_use")] + public bool? IsOneTimeUse { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was encoded onto a card. + /// + [JsonPropertyName("issued_at")] + public string? IssuedAt { get; init; } + + /// + /// Date and time at which the state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was most recently synced from Seam to the provider. + /// + [JsonPropertyName("latest_desired_state_synced_with_provider_at")] + public string? LatestDesiredStateSyncedWithProviderAt { get; init; } + + /// + /// ID of the parent [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("parent_acs_credential_id")] + public string? ParentAcsCredentialId { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// ID of the [user identity](https://docs.seam.co/api/user_identities) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("visionline_metadata")] + public ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata? VisionlineMetadata { get; init; } + + /// + /// Warnings associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = + default!; + + /// + /// ID of the workspace that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record ActionAttemptScanCredentialResultAcsCredentialOnSeamAkilesMetadata + { + /// + /// ID of the Akiles member PIN. + /// + [JsonPropertyName("member_pin_id")] + public string? MemberPinId { get; init; } + } + + public sealed record ActionAttemptScanCredentialResultAcsCredentialOnSeamAssaAbloyVostioMetadata + { + /// + /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. + /// + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + /// + /// Names of the doors to which to grant access in the Vostio access system. + /// + [JsonPropertyName("door_names")] + public List? DoorNames { get; init; } + + /// + /// Endpoint ID in the Vostio access system. + /// + [JsonPropertyName("endpoint_id")] + public string? EndpointId { get; init; } + + /// + /// Key ID in the Vostio access system. + /// + [JsonPropertyName("key_id")] + public string? KeyId { get; init; } + + /// + /// Key issuing request ID in the Vostio access system. + /// + [JsonPropertyName("key_issuing_request_id")] + public string? KeyIssuingRequestId { get; init; } + + /// + /// IDs of the guest entrances to override in the Vostio access system. + /// + [JsonPropertyName("override_guest_acs_entrance_ids")] + public List? OverrideGuestAcsEntranceIds { get; init; } + } + + public sealed record ActionAttemptScanCredentialResultAcsCredentialOnSeamErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata + { + /// + /// Card function type in the Visionline access system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum CardFunctionTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "guest")] + Guest = 1, + + [EnumMember(Value = "staff")] + Staff = 2, + } + + /// + /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. + /// + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + /// + /// Card function type in the Visionline access system. + /// + [JsonPropertyName("card_function_type")] + public ActionAttemptScanCredentialResultAcsCredentialOnSeamVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; init; } + + /// + /// ID of the card in the Visionline access system. + /// + [JsonPropertyName("card_id")] + public string? CardId { get; init; } + + /// + /// Common entrance IDs in the Visionline access system. + /// + [JsonPropertyName("common_acs_entrance_ids")] + public List? CommonAcsEntranceIds { get; init; } + + /// + /// ID of the credential in the Visionline access system. + /// + [JsonPropertyName("credential_id")] + public string? CredentialId { get; init; } + + /// + /// Guest entrance IDs in the Visionline access system. + /// + [JsonPropertyName("guest_acs_entrance_ids")] + public List? GuestAcsEntranceIds { get; init; } + + /// + /// Indicates whether the credential is valid. + /// + [JsonPropertyName("is_valid")] + public bool? IsValid { get; init; } + + /// + /// IDs of the credentials to which you want to join. + /// + [JsonPropertyName("joiner_acs_credential_ids")] + public List? JoinerAcsCredentialIds { get; init; } + } + + public sealed record ActionAttemptScanCredentialResultAcsCredentialOnSeamWarnings + { + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum WarningCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "waiting_to_be_issued")] + WaitingToBeIssued = 1, + + [EnumMember(Value = "schedule_externally_modified")] + ScheduleExternallyModified = 2, + + [EnumMember(Value = "schedule_modified")] + ScheduleModified = 3, + + [EnumMember(Value = "being_deleted")] + BeingDeleted = 4, + + [EnumMember(Value = "unknown_issue_with_acs_credential")] + UnknownIssueWithAcsCredential = 5, + + [EnumMember(Value = "needs_to_be_reissued")] + NeedsToBeReissued = 6, + + [EnumMember(Value = "requested_code_unavailable")] + RequestedCodeUnavailable = 7, + } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public ActionAttemptScanCredentialResultAcsCredentialOnSeamWarnings.WarningCodeEnum WarningCode { get; init; } = + default!; + + /// + /// The PIN code that was assigned instead. + /// + [JsonPropertyName("new_code")] + public string? NewCode { get; init; } + + /// + /// The originally requested PIN code that could not be used. + /// + [JsonPropertyName("original_code")] + public string? OriginalCode { get; init; } + } + + public sealed record ActionAttemptScanCredentialResultWarnings + { + /// + /// Indicates a warning related to scanning a credential. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum WarningCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "acs_credential_on_encoder_out_of_sync")] + AcsCredentialOnEncoderOutOfSync = 1, + + [EnumMember(Value = "acs_credential_on_seam_not_found")] + AcsCredentialOnSeamNotFound = 2, + } + + /// + /// Indicates a warning related to scanning a credential. + /// + [JsonPropertyName("warning_code")] + public ActionAttemptScanCredentialResultWarnings.WarningCodeEnum WarningCode { get; init; } = + default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("warning_message")] + public string WarningMessage { get; init; } = default!; + } + + /// + /// Encoding credential data from the physical encoder onto a card is pending. + /// + public sealed record ActionAttemptEncodeCredential : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "ENCODE_CREDENTIAL"; + + /// + /// Result of an encoding attempt. If the attempt was successful, includes the credential data that was encoded onto the card. + /// + [JsonPropertyName("result")] + public ActionAttemptEncodeCredentialResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptEncodeCredentialResult + { + /// + /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AccessMethodEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExternalTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pti_card")] + PtiCard = 1, + + [EnumMember(Value = "brivo_credential")] + BrivoCredential = 2, + + [EnumMember(Value = "hid_credential")] + HidCredential = 3, + + [EnumMember(Value = "visionline_card")] + VisionlineCard = 4, + + [EnumMember(Value = "salto_ks_credential")] + SaltoKsCredential = 5, + + [EnumMember(Value = "assa_abloy_vostio_key")] + AssaAbloyVostioKey = 6, + + [EnumMember(Value = "salto_space_key")] + SaltoSpaceKey = 7, + + [EnumMember(Value = "latch_access")] + LatchAccess = 8, + + [EnumMember(Value = "dormakaba_ambiance_credential")] + DormakabaAmbianceCredential = 9, + + [EnumMember(Value = "hotek_card")] + HotekCard = 10, + + [EnumMember(Value = "salto_ks_tag")] + SaltoKsTag = 11, + + [EnumMember(Value = "avigilon_alta_credential")] + AvigilonAltaCredential = 12, + + [EnumMember(Value = "kisi_credential")] + KisiCredential = 13, + + [EnumMember(Value = "akiles_credential")] + AkilesCredential = 14, + } + + /// + /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("access_method")] + public ActionAttemptEncodeCredentialResult.AccessMethodEnum AccessMethod { get; init; } = + default!; + + /// + /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("acs_credential_id")] + public string AcsCredentialId { get; init; } = default!; + + /// + /// ID of the credential pool to which the credential belongs. + /// + [JsonPropertyName("acs_credential_pool_id")] + public string? AcsCredentialPoolId { get; init; } + + /// + /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// Akiles-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("akiles_metadata")] + public ActionAttemptEncodeCredentialResultAkilesMetadata? AkilesMetadata { get; init; } + + /// + /// Vostio-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("assa_abloy_vostio_metadata")] + public ActionAttemptEncodeCredentialResultAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; init; } + + /// + /// Number of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("card_number")] + public string? CardNumber { get; init; } + + /// + /// Access (PIN) code for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// ID of the [connected account](https://docs.seam.co/core-concepts/connected-accounts) to which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name that corresponds to the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Errors associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. + /// + [JsonPropertyName("external_type")] + public ActionAttemptEncodeCredentialResult.ExternalTypeEnum? ExternalType { get; init; } + + /// + /// Display name that corresponds to the brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + /// + [JsonPropertyName("external_type_display_name")] + public string? ExternalTypeDisplayName { get; init; } + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been encoded onto a card. + /// + [JsonPropertyName("is_issued")] + public bool? IsIssued { get; init; } + + /// + /// Indicates whether the latest state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been synced from Seam to the provider. + /// + [JsonPropertyName("is_latest_desired_state_synced_with_provider")] + public bool? IsLatestDesiredStateSyncedWithProvider { get; init; } + + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). + /// + [JsonPropertyName("is_multi_phone_sync_credential")] + public bool? IsMultiPhoneSyncCredential { get; init; } + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) can only be used once. If `true`, the code becomes invalid after the first use. + /// + [JsonPropertyName("is_one_time_use")] + public bool? IsOneTimeUse { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was encoded onto a card. + /// + [JsonPropertyName("issued_at")] + public string? IssuedAt { get; init; } + + /// + /// Date and time at which the state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was most recently synced from Seam to the provider. + /// + [JsonPropertyName("latest_desired_state_synced_with_provider_at")] + public string? LatestDesiredStateSyncedWithProviderAt { get; init; } + + /// + /// ID of the parent [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("parent_acs_credential_id")] + public string? ParentAcsCredentialId { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// ID of the [user identity](https://docs.seam.co/api/user_identities) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("visionline_metadata")] + public ActionAttemptEncodeCredentialResultVisionlineMetadata? VisionlineMetadata { get; init; } + + /// + /// Warnings associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the workspace that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record ActionAttemptEncodeCredentialResultAkilesMetadata + { + /// + /// ID of the Akiles member PIN. + /// + [JsonPropertyName("member_pin_id")] + public string? MemberPinId { get; init; } + } + + public sealed record ActionAttemptEncodeCredentialResultAssaAbloyVostioMetadata + { + /// + /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. + /// + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + /// + /// Names of the doors to which to grant access in the Vostio access system. + /// + [JsonPropertyName("door_names")] + public List? DoorNames { get; init; } + + /// + /// Endpoint ID in the Vostio access system. + /// + [JsonPropertyName("endpoint_id")] + public string? EndpointId { get; init; } + + /// + /// Key ID in the Vostio access system. + /// + [JsonPropertyName("key_id")] + public string? KeyId { get; init; } + + /// + /// Key issuing request ID in the Vostio access system. + /// + [JsonPropertyName("key_issuing_request_id")] + public string? KeyIssuingRequestId { get; init; } + + /// + /// IDs of the guest entrances to override in the Vostio access system. + /// + [JsonPropertyName("override_guest_acs_entrance_ids")] + public List? OverrideGuestAcsEntranceIds { get; init; } + } + + public sealed record ActionAttemptEncodeCredentialResultErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record ActionAttemptEncodeCredentialResultVisionlineMetadata + { + /// + /// Card function type in the Visionline access system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum CardFunctionTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "guest")] + Guest = 1, + + [EnumMember(Value = "staff")] + Staff = 2, + } + + /// + /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. + /// + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + /// + /// Card function type in the Visionline access system. + /// + [JsonPropertyName("card_function_type")] + public ActionAttemptEncodeCredentialResultVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; init; } + + /// + /// ID of the card in the Visionline access system. + /// + [JsonPropertyName("card_id")] + public string? CardId { get; init; } + + /// + /// Common entrance IDs in the Visionline access system. + /// + [JsonPropertyName("common_acs_entrance_ids")] + public List? CommonAcsEntranceIds { get; init; } + + /// + /// ID of the credential in the Visionline access system. + /// + [JsonPropertyName("credential_id")] + public string? CredentialId { get; init; } + + /// + /// Guest entrance IDs in the Visionline access system. + /// + [JsonPropertyName("guest_acs_entrance_ids")] + public List? GuestAcsEntranceIds { get; init; } + + /// + /// Indicates whether the credential is valid. + /// + [JsonPropertyName("is_valid")] + public bool? IsValid { get; init; } + + /// + /// IDs of the credentials to which you want to join. + /// + [JsonPropertyName("joiner_acs_credential_ids")] + public List? JoinerAcsCredentialIds { get; init; } + } + + public sealed record ActionAttemptEncodeCredentialResultWarnings + { + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum WarningCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "waiting_to_be_issued")] + WaitingToBeIssued = 1, + + [EnumMember(Value = "schedule_externally_modified")] + ScheduleExternallyModified = 2, + + [EnumMember(Value = "schedule_modified")] + ScheduleModified = 3, + + [EnumMember(Value = "being_deleted")] + BeingDeleted = 4, + + [EnumMember(Value = "unknown_issue_with_acs_credential")] + UnknownIssueWithAcsCredential = 5, + + [EnumMember(Value = "needs_to_be_reissued")] + NeedsToBeReissued = 6, + + [EnumMember(Value = "requested_code_unavailable")] + RequestedCodeUnavailable = 7, + } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public ActionAttemptEncodeCredentialResultWarnings.WarningCodeEnum WarningCode { get; init; } = + default!; + + /// + /// The PIN code that was assigned instead. + /// + [JsonPropertyName("new_code")] + public string? NewCode { get; init; } + + /// + /// The originally requested PIN code that could not be used. + /// + [JsonPropertyName("original_code")] + public string? OriginalCode { get; init; } + } + + /// + /// Scanning a physical card and assigning the credential is pending. + /// + public sealed record ActionAttemptScanToAssignCredential : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "SCAN_TO_ASSIGN_CREDENTIAL"; + + /// + /// Result of a scan to assign attempt. If the attempt was successful, includes the credential data that was scanned and assigned. + /// + [JsonPropertyName("result")] + public ActionAttemptScanToAssignCredentialResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptScanToAssignCredentialResult + { + /// + /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AccessMethodEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExternalTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "pti_card")] + PtiCard = 1, + + [EnumMember(Value = "brivo_credential")] + BrivoCredential = 2, + + [EnumMember(Value = "hid_credential")] + HidCredential = 3, + + [EnumMember(Value = "visionline_card")] + VisionlineCard = 4, + + [EnumMember(Value = "salto_ks_credential")] + SaltoKsCredential = 5, + + [EnumMember(Value = "assa_abloy_vostio_key")] + AssaAbloyVostioKey = 6, + + [EnumMember(Value = "salto_space_key")] + SaltoSpaceKey = 7, + + [EnumMember(Value = "latch_access")] + LatchAccess = 8, + + [EnumMember(Value = "dormakaba_ambiance_credential")] + DormakabaAmbianceCredential = 9, + + [EnumMember(Value = "hotek_card")] + HotekCard = 10, + + [EnumMember(Value = "salto_ks_tag")] + SaltoKsTag = 11, + + [EnumMember(Value = "avigilon_alta_credential")] + AvigilonAltaCredential = 12, + + [EnumMember(Value = "kisi_credential")] + KisiCredential = 13, + + [EnumMember(Value = "akiles_credential")] + AkilesCredential = 14, + } + + /// + /// Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("access_method")] + public ActionAttemptScanToAssignCredentialResult.AccessMethodEnum AccessMethod { get; init; } = + default!; + + /// + /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("acs_credential_id")] + public string AcsCredentialId { get; init; } = default!; + + /// + /// ID of the credential pool to which the credential belongs. + /// + [JsonPropertyName("acs_credential_pool_id")] + public string? AcsCredentialPoolId { get; init; } + + /// + /// ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// Akiles-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("akiles_metadata")] + public ActionAttemptScanToAssignCredentialResultAkilesMetadata? AkilesMetadata { get; init; } + + /// + /// Vostio-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("assa_abloy_vostio_metadata")] + public ActionAttemptScanToAssignCredentialResultAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; init; } + + /// + /// Number of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("card_number")] + public string? CardNumber { get; init; } + + /// + /// Access (PIN) code for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// ID of the [connected account](https://docs.seam.co/core-concepts/connected-accounts) to which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name that corresponds to the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Errors associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = + default!; + + /// + /// Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. + /// + [JsonPropertyName("external_type")] + public ActionAttemptScanToAssignCredentialResult.ExternalTypeEnum? ExternalType { get; init; } + + /// + /// Display name that corresponds to the brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + /// + [JsonPropertyName("external_type_display_name")] + public string? ExternalTypeDisplayName { get; init; } + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been encoded onto a card. + /// + [JsonPropertyName("is_issued")] + public bool? IsIssued { get; init; } + + /// + /// Indicates whether the latest state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been synced from Seam to the provider. + /// + [JsonPropertyName("is_latest_desired_state_synced_with_provider")] + public bool? IsLatestDesiredStateSyncedWithProvider { get; init; } + + /// + /// Indicates whether Seam manages the credential. + /// + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). + /// + [JsonPropertyName("is_multi_phone_sync_credential")] + public bool? IsMultiPhoneSyncCredential { get; init; } + + /// + /// Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) can only be used once. If `true`, the code becomes invalid after the first use. + /// + [JsonPropertyName("is_one_time_use")] + public bool? IsOneTimeUse { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was encoded onto a card. + /// + [JsonPropertyName("issued_at")] + public string? IssuedAt { get; init; } + + /// + /// Date and time at which the state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was most recently synced from Seam to the provider. + /// + [JsonPropertyName("latest_desired_state_synced_with_provider_at")] + public string? LatestDesiredStateSyncedWithProviderAt { get; init; } + + /// + /// ID of the parent [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("parent_acs_credential_id")] + public string? ParentAcsCredentialId { get; init; } + + /// + /// Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// ID of the [user identity](https://docs.seam.co/api/user_identities) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("visionline_metadata")] + public ActionAttemptScanToAssignCredentialResultVisionlineMetadata? VisionlineMetadata { get; init; } + + /// + /// Warnings associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = + default!; + + /// + /// ID of the workspace that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record ActionAttemptScanToAssignCredentialResultAkilesMetadata + { + /// + /// ID of the Akiles member PIN. + /// + [JsonPropertyName("member_pin_id")] + public string? MemberPinId { get; init; } + } + + public sealed record ActionAttemptScanToAssignCredentialResultAssaAbloyVostioMetadata + { + /// + /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. + /// + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + /// + /// Names of the doors to which to grant access in the Vostio access system. + /// + [JsonPropertyName("door_names")] + public List? DoorNames { get; init; } + + /// + /// Endpoint ID in the Vostio access system. + /// + [JsonPropertyName("endpoint_id")] + public string? EndpointId { get; init; } + + /// + /// Key ID in the Vostio access system. + /// + [JsonPropertyName("key_id")] + public string? KeyId { get; init; } + + /// + /// Key issuing request ID in the Vostio access system. + /// + [JsonPropertyName("key_issuing_request_id")] + public string? KeyIssuingRequestId { get; init; } + + /// + /// IDs of the guest entrances to override in the Vostio access system. + /// + [JsonPropertyName("override_guest_acs_entrance_ids")] + public List? OverrideGuestAcsEntranceIds { get; init; } + } + + public sealed record ActionAttemptScanToAssignCredentialResultErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record ActionAttemptScanToAssignCredentialResultVisionlineMetadata + { + /// + /// Card function type in the Visionline access system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum CardFunctionTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "guest")] + Guest = 1, + + [EnumMember(Value = "staff")] + Staff = 2, + } + + /// + /// Indicates whether the credential should auto-join. For an auto-join credential, Seam automatically issues an override card if there are no other cards and a joiner card if there are existing cards on the doors. + /// + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + /// + /// Card function type in the Visionline access system. + /// + [JsonPropertyName("card_function_type")] + public ActionAttemptScanToAssignCredentialResultVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; init; } + + /// + /// ID of the card in the Visionline access system. + /// + [JsonPropertyName("card_id")] + public string? CardId { get; init; } + + /// + /// Common entrance IDs in the Visionline access system. + /// + [JsonPropertyName("common_acs_entrance_ids")] + public List? CommonAcsEntranceIds { get; init; } + + /// + /// ID of the credential in the Visionline access system. + /// + [JsonPropertyName("credential_id")] + public string? CredentialId { get; init; } + + /// + /// Guest entrance IDs in the Visionline access system. + /// + [JsonPropertyName("guest_acs_entrance_ids")] + public List? GuestAcsEntranceIds { get; init; } + + /// + /// Indicates whether the credential is valid. + /// + [JsonPropertyName("is_valid")] + public bool? IsValid { get; init; } + + /// + /// IDs of the credentials to which you want to join. + /// + [JsonPropertyName("joiner_acs_credential_ids")] + public List? JoinerAcsCredentialIds { get; init; } + } + + public sealed record ActionAttemptScanToAssignCredentialResultWarnings + { + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum WarningCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "waiting_to_be_issued")] + WaitingToBeIssued = 1, + + [EnumMember(Value = "schedule_externally_modified")] + ScheduleExternallyModified = 2, + + [EnumMember(Value = "schedule_modified")] + ScheduleModified = 3, + + [EnumMember(Value = "being_deleted")] + BeingDeleted = 4, + + [EnumMember(Value = "unknown_issue_with_acs_credential")] + UnknownIssueWithAcsCredential = 5, + + [EnumMember(Value = "needs_to_be_reissued")] + NeedsToBeReissued = 6, + + [EnumMember(Value = "requested_code_unavailable")] + RequestedCodeUnavailable = 7, + } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public ActionAttemptScanToAssignCredentialResultWarnings.WarningCodeEnum WarningCode { get; init; } = + default!; + + /// + /// The PIN code that was assigned instead. + /// + [JsonPropertyName("new_code")] + public string? NewCode { get; init; } + + /// + /// The originally requested PIN code that could not be used. + /// + [JsonPropertyName("original_code")] + public string? OriginalCode { get; init; } + } + + /// + /// Assigning a credential to an access method is pending. + /// + public sealed record ActionAttemptAssignCredential : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "ASSIGN_CREDENTIAL"; + + /// + /// Result of assigning a credential. If successful, includes the updated access method with the assigned credential. + /// + [JsonPropertyName("result")] + public ActionAttemptAssignCredentialResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptAssignCredentialResult + { + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// ID of the access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + + /// + /// Token of the client session associated with the access method. + /// + [JsonPropertyName("client_session_token")] + public string? ClientSessionToken { get; init; } + + /// + /// The actual PIN code for code access methods. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Date and time at which the access method was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// ID of the customization profile associated with the access method. + /// + [JsonPropertyName("customization_profile_id")] + public string? CustomizationProfileId { get; init; } + + /// + /// Display name of the access method. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Human-readable sentence describing where the access method sits in its relationship with the device or access system, for example `Awaiting encoding`. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read `is_issued`, `errors`, and `pending_mutations`. + /// + [JsonPropertyName("display_status")] + public string DisplayStatus { get; init; } = default!; + + /// + /// Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// URL of the Instant Key for mobile key access methods. + /// + [JsonPropertyName("instant_key_url")] + public string? InstantKeyUrl { get; init; } + + /// + /// Indicates whether an existing card credential must be assigned to this access method before it can be issued. Only applies to card-mode access methods on systems that support credential assignment. + /// + [JsonPropertyName("is_assignment_required")] + public bool? IsAssignmentRequired { get; init; } + + /// + /// Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method. + /// + [JsonPropertyName("is_encoding_required")] + public bool? IsEncodingRequired { get; init; } + + /// + /// Indicates whether the access method has been issued. + /// + [JsonPropertyName("is_issued")] + public bool IsIssued { get; init; } = default!; + + /// + /// Indicates whether the access method is ready for card assignment. This is true when the access method is in card mode, has not yet been issued, and the system supports credential assignment. + /// + [JsonPropertyName("is_ready_for_assignment")] + public bool? IsReadyForAssignment { get; init; } + + /// + /// Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. + /// + [JsonPropertyName("is_ready_for_encoding")] + public bool? IsReadyForEncoding { get; init; } + + /// + /// Date and time at which the access method was issued. + /// + [JsonPropertyName("issued_at")] + public string? IssuedAt { get; init; } + + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("mode")] + public ActionAttemptAssignCredentialResult.ModeEnum Mode { get; init; } = default!; + + /// + /// Pending mutations for the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). Indicates operations that are in progress. + /// + [JsonPropertyName("pending_mutations")] + public List PendingMutations { get; init; } = + default!; + + /// + /// Warnings associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the Seam workspace associated with the access method. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record ActionAttemptAssignCredentialResultErrors + { + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ErrorCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "failed_to_issue")] + FailedToIssue = 1, + } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public ActionAttemptAssignCredentialResultErrors.ErrorCodeEnum ErrorCode { get; init; } = + default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record ActionAttemptAssignCredentialResultPendingMutations + { + /// + /// Mutation code to indicate that Seam is in the process of updating the access times for this access method. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum MutationCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "provisioning_access")] + ProvisioningAccess = 1, + + [EnumMember(Value = "revoking_access")] + RevokingAccess = 2, + + [EnumMember(Value = "updating_access_times")] + UpdatingAccessTimes = 3, + } + + /// + /// Date and time at which the mutation was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Previous access time configuration. + /// + [JsonPropertyName("from")] + public ActionAttemptAssignCredentialResultPendingMutationsFrom From { get; init; } = + default!; + + /// + /// Detailed description of the mutation. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Mutation code to indicate that Seam is in the process of updating the access times for this access method. + /// + [JsonPropertyName("mutation_code")] + public ActionAttemptAssignCredentialResultPendingMutations.MutationCodeEnum MutationCode { get; init; } = + default!; + + /// + /// New access time configuration. + /// + [JsonPropertyName("to")] + public ActionAttemptAssignCredentialResultPendingMutationsTo To { get; init; } = default!; + } + + public sealed record ActionAttemptAssignCredentialResultPendingMutationsFrom + { + /// + /// Previous end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Previous start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record ActionAttemptAssignCredentialResultPendingMutationsTo + { + /// + /// New end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// New start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record ActionAttemptAssignCredentialResultWarnings + { + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum WarningCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "being_deleted")] + BeingDeleted = 1, + + [EnumMember(Value = "updating_access_times")] + UpdatingAccessTimes = 2, + + [EnumMember(Value = "pulled_backup_access_code")] + PulledBackupAccessCode = 3, + + [EnumMember(Value = "delay_in_issuing")] + DelayInIssuing = 4, + } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public ActionAttemptAssignCredentialResultWarnings.WarningCodeEnum WarningCode { get; init; } = + default!; + + /// + /// ID of the original access method from which this backup access method was split, if applicable. + /// + [JsonPropertyName("original_access_method_id")] + public string? OriginalAccessMethodId { get; init; } + } + + /// + /// Resetting a sandbox workspace is pending. + /// + public sealed record ActionAttemptResetSandboxWorkspace : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "RESET_SANDBOX_WORKSPACE"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptResetSandboxWorkspaceResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptResetSandboxWorkspaceResult { } + + /// + /// Setting the fan mode is pending. + /// + public sealed record ActionAttemptSetFanMode : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "SET_FAN_MODE"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptSetFanModeResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptSetFanModeResult { } + + /// + /// Setting the HVAC mode is pending. + /// + public sealed record ActionAttemptSetHvacMode : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "SET_HVAC_MODE"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptSetHvacModeResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptSetHvacModeResult { } + + /// + /// Activating a climate preset is pending. + /// + public sealed record ActionAttemptActivateClimatePreset : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "ACTIVATE_CLIMATE_PRESET"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptActivateClimatePresetResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptActivateClimatePresetResult { } + + /// + /// Simulating a keypad code entry is pending. + /// + public sealed record ActionAttemptSimulateKeypadCodeEntry : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "SIMULATE_KEYPAD_CODE_ENTRY"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptSimulateKeypadCodeEntryResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptSimulateKeypadCodeEntryResult { } + + /// + /// Simulating a manual lock action using a keypad is pending. + /// + public sealed record ActionAttemptSimulateManualLockViaKeypad : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "SIMULATE_MANUAL_LOCK_VIA_KEYPAD"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptSimulateManualLockViaKeypadResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptSimulateManualLockViaKeypadResult { } + + /// + /// Pushing thermostat weekly programs is pending. + /// + public sealed record ActionAttemptPushThermostatPrograms : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "PUSH_THERMOSTAT_PROGRAMS"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptPushThermostatProgramsResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptPushThermostatProgramsResult { } + + /// + /// Configuring the auto-lock is pending. + /// + public sealed record ActionAttemptConfigureAutoLock : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "CONFIGURE_AUTO_LOCK"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptConfigureAutoLockResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptConfigureAutoLockResult { } + + public sealed record ActionAttemptSyncAccessCodes : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "SYNC_ACCESS_CODES"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptSyncAccessCodesResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptSyncAccessCodesResult { } + + public sealed record ActionAttemptCreateAccessCode : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "CREATE_ACCESS_CODE"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptCreateAccessCodeResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptCreateAccessCodeResult + { + /// + /// Created access code. + /// + [JsonPropertyName("access_code")] + public object AccessCode { get; init; } = default!; + } + + public sealed record ActionAttemptDeleteAccessCode : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "DELETE_ACCESS_CODE"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptDeleteAccessCodeResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptDeleteAccessCodeResult { } + + public sealed record ActionAttemptUpdateAccessCode : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "UPDATE_ACCESS_CODE"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptUpdateAccessCodeResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptUpdateAccessCodeResult + { + /// + /// Updated access code. + /// + [JsonPropertyName("access_code")] + public object? AccessCode { get; init; } + } + + public sealed record ActionAttemptCreateNoiseThreshold : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "CREATE_NOISE_THRESHOLD"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptCreateNoiseThresholdResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptCreateNoiseThresholdResult + { + /// + /// Created noise threshold. + /// + [JsonPropertyName("noise_threshold")] + public object NoiseThreshold { get; init; } = default!; + } + + public sealed record ActionAttemptDeleteNoiseThreshold : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "DELETE_NOISE_THRESHOLD"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptDeleteNoiseThresholdResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptDeleteNoiseThresholdResult { } + + public sealed record ActionAttemptUpdateNoiseThreshold : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "UPDATE_NOISE_THRESHOLD"; + + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptUpdateNoiseThresholdResult Result { get; init; } = default!; + } + + public sealed record ActionAttemptUpdateNoiseThresholdResult + { + /// + /// Updated noise threshold. + /// + [JsonPropertyName("noise_threshold")] + public object NoiseThreshold { get; init; } = default!; + } + + public sealed record ActionAttemptUnrecognized : ActionAttempt, ISeamUnrecognizedVariant + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } +} diff --git a/src/Seam/Model/Batch.cs b/src/Seam/Models/Batch.cs similarity index 74% rename from src/Seam/Model/Batch.cs rename to src/Seam/Models/Batch.cs index c50ae8cf..597a5d8d 100644 --- a/src/Seam/Model/Batch.cs +++ b/src/Seam/Models/Batch.cs @@ -1,75 +1,19 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; +using System.Text.Json; +using System.Text.Json.Serialization; -namespace Seam.Model +namespace Seam.Models { /// /// A batch of workspace resources. /// - [DataContract(Name = "seamModel_batch_model")] - public class Batch + public sealed record Batch { - [JsonConstructorAttribute] - protected Batch() { } - - public Batch( - object? accessCodes = default, - object? accessGrants = default, - object? accessMethods = default, - object? acsAccessGroups = default, - object? acsCredentials = default, - object? acsEncoders = default, - object? acsEntrances = default, - object? acsSystems = default, - object? acsUsers = default, - object? actionAttempts = default, - object? clientSessions = default, - object? connectWebviews = default, - object? connectedAccounts = default, - object? devices = default, - object? events = default, - object? instantKeys = default, - object? noiseThresholds = default, - object? spaces = default, - object? thermostatDailyPrograms = default, - object? thermostatSchedules = default, - object? unmanagedAccessCodes = default, - object? unmanagedDevices = default, - object? userIdentities = default, - object? workspaces = default - ) - { - AccessCodes = accessCodes; - AccessGrants = accessGrants; - AccessMethods = accessMethods; - AcsAccessGroups = acsAccessGroups; - AcsCredentials = acsCredentials; - AcsEncoders = acsEncoders; - AcsEntrances = acsEntrances; - AcsSystems = acsSystems; - AcsUsers = acsUsers; - ActionAttempts = actionAttempts; - ClientSessions = clientSessions; - ConnectWebviews = connectWebviews; - ConnectedAccounts = connectedAccounts; - Devices = devices; - Events = events; - InstantKeys = instantKeys; - NoiseThresholds = noiseThresholds; - Spaces = spaces; - ThermostatDailyPrograms = thermostatDailyPrograms; - ThermostatSchedules = thermostatSchedules; - UnmanagedAccessCodes = unmanagedAccessCodes; - UnmanagedDevices = unmanagedDevices; - UserIdentities = userIdentities; - Workspaces = workspaces; - } - /// /// Represents a smart lock [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). /// @@ -81,20 +25,20 @@ public Batch( /// /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. /// - [DataMember(Name = "access_codes", IsRequired = false, EmitDefaultValue = false)] - public object? AccessCodes { get; set; } + [JsonPropertyName("access_codes")] + public object? AccessCodes { get; init; } /// /// Represents an Access Grant. Access Grants enable you to grant a user identity access to spaces, entrances, and devices through one or more access methods, such as mobile keys, plastic cards, and PIN codes. You can create an Access Grant for an existing user identity, or you can create a new user identity *while* creating the new Access Grant. /// - [DataMember(Name = "access_grants", IsRequired = false, EmitDefaultValue = false)] - public object? AccessGrants { get; set; } + [JsonPropertyName("access_grants")] + public object? AccessGrants { get; init; } /// /// Represents an access method for an Access Grant. Access methods describe the modes of access, such as PIN codes, plastic cards, and mobile keys. For a mobile key, the access method also stores the URL for the associated Instant Key. /// - [DataMember(Name = "access_methods", IsRequired = false, EmitDefaultValue = false)] - public object? AccessMethods { get; set; } + [JsonPropertyName("access_methods")] + public object? AccessMethods { get; init; } /// /// Group that defines the entrances to which a set of users has access and, in some cases, the access schedule for these entrances and users. @@ -103,8 +47,8 @@ public Batch( /// /// To learn whether your access control system supports access groups, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). /// - [DataMember(Name = "acs_access_groups", IsRequired = false, EmitDefaultValue = false)] - public object? AcsAccessGroups { get; set; } + [JsonPropertyName("acs_access_groups")] + public object? AcsAccessGroups { get; init; } /// /// Means by which an [access control system user](https://docs.seam.co/low-level-apis/access-systems/user-management) gains access at an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). The `acs_credential` object represents a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) that provides an ACS user access within an [access control system](https://docs.seam.co/low-level-apis/access-systems). @@ -115,8 +59,8 @@ public Batch( /// /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach. Use the lower-level ACS credential API directly only when you specifically need to manage individual credentials. /// - [DataMember(Name = "acs_credentials", IsRequired = false, EmitDefaultValue = false)] - public object? AcsCredentials { get; set; } + [JsonPropertyName("acs_credentials")] + public object? AcsCredentials { get; init; } /// /// Represents a hardware device that encodes [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) data onto physical cards within an [access control system](https://docs.seam.co/low-level-apis/access-systems). @@ -134,16 +78,16 @@ public Batch( /// /// To verify if your access control system requires a card encoder, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). /// - [DataMember(Name = "acs_encoders", IsRequired = false, EmitDefaultValue = false)] - public object? AcsEncoders { get; set; } + [JsonPropertyName("acs_encoders")] + public object? AcsEncoders { get; init; } /// /// Represents an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) within an [access control system](https://docs.seam.co/low-level-apis/access-systems). /// /// In an access control system, an entrance is a secured door, gate, zone, or other method of entry. You can list details for all the `acs_entrance` resources in your workspace or get these details for a specific `acs_entrance`. You can also list all entrances associated with a specific credential, and you can list all credentials associated with a specific entrance. /// - [DataMember(Name = "acs_entrances", IsRequired = false, EmitDefaultValue = false)] - public object? AcsEntrances { get; set; } + [JsonPropertyName("acs_entrances")] + public object? AcsEntrances { get; init; } /// /// Represents an [access control system](https://docs.seam.co/low-level-apis/access-systems). @@ -152,8 +96,8 @@ public Batch( /// /// For details about the resources associated with an access control system, see the [access control systems namespace](https://docs.seam.co/api/acs). /// - [DataMember(Name = "acs_systems", IsRequired = false, EmitDefaultValue = false)] - public object? AcsSystems { get; set; } + [JsonPropertyName("acs_systems")] + public object? AcsSystems { get; init; } /// /// Represents a [user](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access system](https://docs.seam.co/low-level-apis/access-systems). @@ -162,8 +106,8 @@ public Batch( /// /// For details about how to configure users in your access system, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). /// - [DataMember(Name = "acs_users", IsRequired = false, EmitDefaultValue = false)] - public object? AcsUsers { get; set; } + [JsonPropertyName("acs_users")] + public object? AcsUsers { get; init; } /// /// Represents an action attempt that enables you to keep track of the progress of your action that affects a physical device or system.actions against a device. Action attempts are useful because the physical world is intrinsically asynchronous. @@ -172,8 +116,8 @@ public Batch( /// /// See also [Action Attempts](https://docs.seam.co/core-concepts/action-attempts). /// - [DataMember(Name = "action_attempts", IsRequired = false, EmitDefaultValue = false)] - public object? ActionAttempts { get; set; } + [JsonPropertyName("action_attempts")] + public object? ActionAttempts { get; init; } /// /// Represents a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). If you want to restrict your users' access to their own devices, use client sessions. @@ -186,8 +130,8 @@ public Batch( /// /// See also [Get Started with React](https://docs.seam.co/ui-components/overview/getting-started-with-seam-components/get-started-with-react-components-and-client-session-tokens). /// - [DataMember(Name = "client_sessions", IsRequired = false, EmitDefaultValue = false)] - public object? ClientSessions { get; set; } + [JsonPropertyName("client_sessions")] + public object? ClientSessions { get; init; } /// /// Represents a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). @@ -202,64 +146,60 @@ public Batch( /// /// To list all providers within a category, use `/devices/list_device_providers` with the desired `provider_category` filter. To list all provider keys, use `/devices/list_device_providers` with no filters. /// - [DataMember(Name = "connect_webviews", IsRequired = false, EmitDefaultValue = false)] - public object? ConnectWebviews { get; set; } + [JsonPropertyName("connect_webviews")] + public object? ConnectWebviews { get; init; } /// /// Represents a [connected account](https://docs.seam.co/core-concepts/connected-accounts). A connected account is an external third-party account to which your user has authorized Seam to get access, for example, an August account with a list of door locks. /// - [DataMember(Name = "connected_accounts", IsRequired = false, EmitDefaultValue = false)] - public object? ConnectedAccounts { get; set; } + [JsonPropertyName("connected_accounts")] + public object? ConnectedAccounts { get; init; } /// /// Represents a [device](https://docs.seam.co/core-concepts/devices) that has been connected to Seam. /// - [DataMember(Name = "devices", IsRequired = false, EmitDefaultValue = false)] - public object? Devices { get; set; } + [JsonPropertyName("devices")] + public object? Devices { get; init; } /// /// Represents an event. Events let you know when something interesting happens in your workspace. For example, when a lock is unlocked, Seam creates a `lock.unlocked` event. When a device's battery level is low, Seam creates a `device.battery_low` event. /// /// As with other API resources, you can retrieve an individual event or a list of events. Seam also provides a separate webhook system for sending the event objects directly to an endpoint on your sever. Manage webhooks through [Seam Console](https://console.seam.co). You can also use the webhooks sandbox in Seam Console to see the different payloads for each event and test them against your own endpoints. /// - [DataMember(Name = "events", IsRequired = false, EmitDefaultValue = false)] - public object? Events { get; set; } + [JsonPropertyName("events")] + public object? Events { get; init; } /// /// Represents a Seam Instant Key. For issuing Bluetooth mobile keys, Instant Keys are the fastest way to share access. With a single API call, you can create a mobile key and send it through text or email or embed it in your own app. /// /// There’s no app to install, nor account to create. Your user just taps a link and gets a lightweight, native-feeling experience using iOS App Clip or Instant Apps on Android. Further, Instant Keys work offline, so even in areas with poor cellular or Wi-Fi, like elevator banks or concrete-walled hallways, the Instant Keys still work. /// - [DataMember(Name = "instant_keys", IsRequired = false, EmitDefaultValue = false)] - public object? InstantKeys { get; set; } + [JsonPropertyName("instant_keys")] + public object? InstantKeys { get; init; } /// /// Represents a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. /// - [DataMember(Name = "noise_thresholds", IsRequired = false, EmitDefaultValue = false)] - public object? NoiseThresholds { get; set; } + [JsonPropertyName("noise_thresholds")] + public object? NoiseThresholds { get; init; } /// /// Represents a space that is a logical grouping of devices and entrances. You can assign access to an entire space, thereby making granting access more efficient. /// - [DataMember(Name = "spaces", IsRequired = false, EmitDefaultValue = false)] - public object? Spaces { get; set; } + [JsonPropertyName("spaces")] + public object? Spaces { get; init; } /// /// Represents a thermostat daily program, consisting of a set of periods, each of which has a starting time and the key that identifies the climate preset to apply at the starting time. /// - [DataMember( - Name = "thermostat_daily_programs", - IsRequired = false, - EmitDefaultValue = false - )] - public object? ThermostatDailyPrograms { get; set; } + [JsonPropertyName("thermostat_daily_programs")] + public object? ThermostatDailyPrograms { get; init; } /// /// Represents a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) that activates a configured [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) on a [thermostat](https://docs.seam.co/capability-guides/thermostats) at a specified starting time and deactivates the climate preset at a specified ending time. /// - [DataMember(Name = "thermostat_schedules", IsRequired = false, EmitDefaultValue = false)] - public object? ThermostatSchedules { get; set; } + [JsonPropertyName("thermostat_schedules")] + public object? ThermostatSchedules { get; init; } /// /// Represents an [unmanaged smart lock access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). @@ -274,44 +214,25 @@ public Batch( /// /// - [Kwikset](https://docs.seam.co/device-and-system-integration-guides/kwikset-locks) /// - [DataMember(Name = "unmanaged_access_codes", IsRequired = false, EmitDefaultValue = false)] - public object? UnmanagedAccessCodes { get; set; } + [JsonPropertyName("unmanaged_access_codes")] + public object? UnmanagedAccessCodes { get; init; } /// /// Represents an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). /// - [DataMember(Name = "unmanaged_devices", IsRequired = false, EmitDefaultValue = false)] - public object? UnmanagedDevices { get; set; } + [JsonPropertyName("unmanaged_devices")] + public object? UnmanagedDevices { get; init; } /// /// Represents a [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with an application user account. /// - [DataMember(Name = "user_identities", IsRequired = false, EmitDefaultValue = false)] - public object? UserIdentities { get; set; } + [JsonPropertyName("user_identities")] + public object? UserIdentities { get; init; } /// /// Represents a Seam [workspace](https://docs.seam.co/core-concepts/workspaces). A workspace is a top-level entity that encompasses all other resources below it, such as devices, connected accounts, and Connect Webviews. Seam provides two types of workspaces. A [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) is a special type of workspace designed for testing code. Sandbox workspaces offer test device accounts and virtual devices that you can connect and control. This ability to work with virtual devices is quite handy because it removes the need to own physical devices from multiple brands. To connect real devices and systems to Seam, use a [production workspace](https://docs.seam.co/core-concepts/workspaces#production-workspaces). /// - [DataMember(Name = "workspaces", IsRequired = false, EmitDefaultValue = false)] - public object? Workspaces { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("workspaces")] + public object? Workspaces { get; init; } } } diff --git a/src/Seam/Models/ClientSession.cs b/src/Seam/Models/ClientSession.cs new file mode 100644 index 00000000..47d152d6 --- /dev/null +++ b/src/Seam/Models/ClientSession.cs @@ -0,0 +1,98 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). If you want to restrict your users' access to their own devices, use client sessions. + /// + /// You create each client session with a custom `user_identifier_key`. Normally, the `user_identifier_key` is a user ID that your application provides. + /// + /// When calling the Seam API from your backend using an API key, you can pass the `user_identifier_key` as a parameter to limit results to the associated client session. For example, `/devices/list?user_identifier_key=123` only returns devices associated with the client session created with the `user_identifier_key` `123`. + /// + /// A client session has a token that you can use with the Seam JavaScript SDK to make requests from the client (browser) directly to the Seam API. The token restricts the user's access to only the devices that they own. + /// + /// See also [Get Started with React](https://docs.seam.co/ui-components/overview/getting-started-with-seam-components/get-started-with-react-components-and-client-session-tokens). + /// + public sealed record ClientSession + { + /// + /// ID of the client session. + /// + [JsonPropertyName("client_session_id")] + public string ClientSessionId { get; init; } = default!; + + /// + /// IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + [JsonPropertyName("connect_webview_ids")] + public List ConnectWebviewIds { get; init; } = default!; + + /// + /// IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + [JsonPropertyName("connected_account_ids")] + public List ConnectedAccountIds { get; init; } = default!; + + /// + /// Date and time at which the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Customer key associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Number of devices associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + [JsonPropertyName("device_count")] + public float DeviceCount { get; init; } = default!; + + /// + /// Date and time at which the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) expires. + /// + [JsonPropertyName("expires_at")] + public string ExpiresAt { get; init; } = default!; + + /// + /// Client session token associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + [JsonPropertyName("token")] + public string Token { get; init; } = default!; + + /// + /// Your user ID for the user associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + + /// + /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with the client session. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with the client session. + /// + [Obsolete("Use `user_identity_id` instead.")] + [JsonPropertyName("user_identity_ids")] + public List UserIdentityIds { get; init; } = default!; + + /// + /// ID of the workspace associated with the client session. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } +} diff --git a/src/Seam/Model/ConnectWebview.cs b/src/Seam/Models/ConnectWebview.cs similarity index 58% rename from src/Seam/Model/ConnectWebview.cs rename to src/Seam/Models/ConnectWebview.cs index 06bfd28f..55b8f306 100644 --- a/src/Seam/Model/ConnectWebview.cs +++ b/src/Seam/Models/ConnectWebview.cs @@ -1,12 +1,13 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models { /// /// Represents a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). @@ -21,59 +22,12 @@ namespace Seam.Model /// /// To list all providers within a category, use `/devices/list_device_providers` with the desired `provider_category` filter. To list all provider keys, use `/devices/list_device_providers` with no filters. /// - [DataContract(Name = "seamModel_connectWebview_model")] - public class ConnectWebview + public sealed record ConnectWebview { - [JsonConstructorAttribute] - protected ConnectWebview() { } - - public ConnectWebview( - List acceptedCapabilities = default, - List acceptedProviders = default, - bool anyProviderAllowed = default, - string? authorizedAt = default, - bool automaticallyManageNewDevices = default, - string connectWebviewId = default, - string? connectedAccountId = default, - string createdAt = default, - object customMetadata = default, - string? customRedirectFailureUrl = default, - string? customRedirectUrl = default, - string? customerKey = default, - ConnectWebview.DeviceSelectionModeEnum deviceSelectionMode = default, - bool loginSuccessful = default, - string? selectedProvider = default, - ConnectWebview.StatusEnum status = default, - string url = default, - bool waitForDeviceCreation = default, - string workspaceId = default - ) - { - AcceptedCapabilities = acceptedCapabilities; - AcceptedProviders = acceptedProviders; - AnyProviderAllowed = anyProviderAllowed; - AuthorizedAt = authorizedAt; - AutomaticallyManageNewDevices = automaticallyManageNewDevices; - ConnectWebviewId = connectWebviewId; - ConnectedAccountId = connectedAccountId; - CreatedAt = createdAt; - CustomMetadata = customMetadata; - CustomRedirectFailureUrl = customRedirectFailureUrl; - CustomRedirectUrl = customRedirectUrl; - CustomerKey = customerKey; - DeviceSelectionMode = deviceSelectionMode; - LoginSuccessful = loginSuccessful; - SelectedProvider = selectedProvider; - Status = status; - Url = url; - WaitForDeviceCreation = waitForDeviceCreation; - WorkspaceId = workspaceId; - } - /// /// High-level device capabilities that the Connect Webview can accept. When creating a Connect Webview, you can specify the types of devices that it can connect to Seam. If you do not set custom `accepted_capabilities`, Seam uses a default set of `accepted_capabilities` for each provider. For example, if you create a Connect Webview that accepts SmartThing devices, without specifying `accepted_capabilities`, Seam accepts only SmartThings locks. To connect SmartThings thermostats and locks to Seam, create a Connect Webview and include both `thermostat` and `lock` in the `accepted_capabilities`. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum AcceptedCapabilitiesEnum { [EnumMember(Value = "unrecognized")] @@ -98,7 +52,7 @@ public enum AcceptedCapabilitiesEnum /// /// Device selection mode of the Connect Webview. Supported values: `none`, `single`, `multiple`. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum DeviceSelectionModeEnum { [EnumMember(Value = "unrecognized")] @@ -117,7 +71,7 @@ public enum DeviceSelectionModeEnum /// /// Status of the Connect Webview. `authorized` indicates that the user has successfully logged into their device or system account, thereby completing the Connect Webview. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum StatusEnum { [EnumMember(Value = "unrecognized")] @@ -136,146 +90,116 @@ public enum StatusEnum /// /// High-level device capabilities that the Connect Webview can accept. When creating a Connect Webview, you can specify the types of devices that it can connect to Seam. If you do not set custom `accepted_capabilities`, Seam uses a default set of `accepted_capabilities` for each provider. For example, if you create a Connect Webview that accepts SmartThing devices, without specifying `accepted_capabilities`, Seam accepts only SmartThings locks. To connect SmartThings thermostats and locks to Seam, create a Connect Webview and include both `thermostat` and `lock` in the `accepted_capabilities`. /// - [DataMember(Name = "accepted_capabilities", IsRequired = false, EmitDefaultValue = false)] - public List AcceptedCapabilities { get; set; } + [JsonPropertyName("accepted_capabilities")] + public List AcceptedCapabilities { get; init; } = + default!; /// /// List of accepted [provider keys](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). /// - [DataMember(Name = "accepted_providers", IsRequired = false, EmitDefaultValue = false)] - public List AcceptedProviders { get; set; } + [JsonPropertyName("accepted_providers")] + public List AcceptedProviders { get; init; } = default!; /// /// Indicates whether any provider is allowed. /// - [DataMember(Name = "any_provider_allowed", IsRequired = false, EmitDefaultValue = false)] - public bool AnyProviderAllowed { get; set; } + [JsonPropertyName("any_provider_allowed")] + public bool AnyProviderAllowed { get; init; } = default!; /// /// Date and time at which the user authorized (through the Connect Webview) the management of their devices. /// - [DataMember(Name = "authorized_at", IsRequired = false, EmitDefaultValue = false)] - public string? AuthorizedAt { get; set; } + [JsonPropertyName("authorized_at")] + public string? AuthorizedAt { get; init; } /// /// Indicates whether Seam should [import all new devices](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#automatically_manage_new_devices) for the connected account to make these devices available for use and management by the Seam API. /// - [DataMember( - Name = "automatically_manage_new_devices", - IsRequired = false, - EmitDefaultValue = false - )] - public bool AutomaticallyManageNewDevices { get; set; } + [JsonPropertyName("automatically_manage_new_devices")] + public bool AutomaticallyManageNewDevices { get; init; } = default!; /// /// ID of the Connect Webview. /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string ConnectWebviewId { get; set; } + [JsonPropertyName("connect_webview_id")] + public string ConnectWebviewId { get; init; } = default!; /// /// ID of the connected account associated with the Connect Webview. /// - [DataMember(Name = "connected_account_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectedAccountId { get; set; } + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } /// /// Date and time at which the Connect Webview was created. /// - [DataMember(Name = "created_at", IsRequired = false, EmitDefaultValue = false)] - public string CreatedAt { get; set; } + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; /// /// Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object CustomMetadata { get; set; } + [JsonPropertyName("custom_metadata")] + public object CustomMetadata { get; init; } = default!; /// /// URL to which the Connect Webview should redirect when an unexpected error occurs. /// - [DataMember( - Name = "custom_redirect_failure_url", - IsRequired = false, - EmitDefaultValue = false - )] - public string? CustomRedirectFailureUrl { get; set; } + [JsonPropertyName("custom_redirect_failure_url")] + public string? CustomRedirectFailureUrl { get; init; } /// /// URL to which the Connect Webview should redirect when the user successfully pairs a device or system. If you do not set the `custom_redirect_failure_url`, the Connect Webview redirects to the `custom_redirect_url` when an unexpected error occurs. /// - [DataMember(Name = "custom_redirect_url", IsRequired = false, EmitDefaultValue = false)] - public string? CustomRedirectUrl { get; set; } + [JsonPropertyName("custom_redirect_url")] + public string? CustomRedirectUrl { get; init; } /// /// The customer key associated with this webview, if any. /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } /// /// Device selection mode of the Connect Webview. Supported values: `none`, `single`, `multiple`. /// - [DataMember(Name = "device_selection_mode", IsRequired = false, EmitDefaultValue = false)] - public ConnectWebview.DeviceSelectionModeEnum DeviceSelectionMode { get; set; } + [JsonPropertyName("device_selection_mode")] + public ConnectWebview.DeviceSelectionModeEnum DeviceSelectionMode { get; init; } = default!; /// /// Indicates whether the user logged in successfully using the Connect Webview. /// - [DataMember(Name = "login_successful", IsRequired = false, EmitDefaultValue = false)] - public bool LoginSuccessful { get; set; } + [JsonPropertyName("login_successful")] + public bool LoginSuccessful { get; init; } = default!; /// /// Selected provider of the Connect Webview, one of the [provider keys](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). /// - [DataMember(Name = "selected_provider", IsRequired = false, EmitDefaultValue = false)] - public string? SelectedProvider { get; set; } + [JsonPropertyName("selected_provider")] + public string? SelectedProvider { get; init; } /// /// Status of the Connect Webview. `authorized` indicates that the user has successfully logged into their device or system account, thereby completing the Connect Webview. /// - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public ConnectWebview.StatusEnum Status { get; set; } + [JsonPropertyName("status")] + public ConnectWebview.StatusEnum Status { get; init; } = default!; /// /// URL for the Connect Webview. You use the URL to display the Connect Webview flow to your user. /// - [DataMember(Name = "url", IsRequired = false, EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get; init; } = default!; /// /// Indicates whether Seam should [finish syncing all devices](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#wait_for_device_creation) in a newly-connected account before completing the associated Connect Webview. /// - [DataMember( - Name = "wait_for_device_creation", - IsRequired = false, - EmitDefaultValue = false - )] - public bool WaitForDeviceCreation { get; set; } + [JsonPropertyName("wait_for_device_creation")] + public bool WaitForDeviceCreation { get; init; } = default!; /// /// ID of the workspace that contains the Connect Webview. /// - [DataMember(Name = "workspace_id", IsRequired = false, EmitDefaultValue = false)] - public string WorkspaceId { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; } } diff --git a/src/Seam/Models/ConnectedAccount.cs b/src/Seam/Models/ConnectedAccount.cs new file mode 100644 index 00000000..8bc54518 --- /dev/null +++ b/src/Seam/Models/ConnectedAccount.cs @@ -0,0 +1,469 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a [connected account](https://docs.seam.co/core-concepts/connected-accounts). A connected account is an external third-party account to which your user has authorized Seam to get access, for example, an August account with a list of door locks. + /// + public sealed record ConnectedAccount + { + /// + /// List of capabilities that were accepted during the account connection process. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AcceptedCapabilitiesEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "lock")] + Lock = 1, + + [EnumMember(Value = "thermostat")] + Thermostat = 2, + + [EnumMember(Value = "noise_sensor")] + NoiseSensor = 3, + + [EnumMember(Value = "access_control")] + AccessControl = 4, + + [EnumMember(Value = "camera")] + Camera = 5, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant( + "account_disconnected", + typeof(ConnectedAccountErrorsAccountDisconnected) + )] + [SeamUnionVariant("bridge_disconnected", typeof(ConnectedAccountErrorsBridgeDisconnected))] + [SeamUnionVariant( + "salto_ks_subscription_limit_exceeded", + typeof(ConnectedAccountErrorsSaltoKsSubscriptionLimitExceeded) + )] + [SeamUnionVariant( + "dormakaba_sites_disconnected", + typeof(ConnectedAccountErrorsDormakabaSitesDisconnected) + )] + [SeamUnionFallback(typeof(ConnectedAccountErrorsUnrecognized))] + public abstract record ConnectedAccountErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). + /// + [JsonPropertyName("is_bridge_error")] + public bool? IsBridgeError { get; init; } + + /// + /// Indicates whether the error is related specifically to the connected account. + /// + [JsonPropertyName("is_connected_account_error")] + public bool? IsConnectedAccountError { get; init; } + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record ConnectedAccountErrorsAccountDisconnected : ConnectedAccountErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "account_disconnected"; + } + + public sealed record ConnectedAccountErrorsBridgeDisconnected : ConnectedAccountErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "bridge_disconnected"; + } + + public sealed record ConnectedAccountErrorsSaltoKsSubscriptionLimitExceeded + : ConnectedAccountErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; + + /// + /// Salto KS metadata associated with the connected account that has an error. + /// + [JsonPropertyName("salto_ks_metadata")] + public ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadata SaltoKsMetadata { get; init; } = + default!; + } + + public sealed record ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadata + { + /// + /// Salto sites associated with the connected account that has an error. + /// + [JsonPropertyName("sites")] + public List? Sites { get; init; } + } + + public sealed record ConnectedAccountErrorsSaltoKsSubscriptionLimitExceededSaltoKsMetadataSites + { + /// + /// ID of a Salto site associated with the connected account that has an error. + /// + [JsonPropertyName("site_id")] + public string? SiteId { get; init; } + + /// + /// Name of a Salto site associated with the connected account that has an error. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + + /// + /// Subscription limit of site users for a Salto site associated with the connected account that has an error. + /// + [JsonPropertyName("site_user_subscription_limit")] + public int? SiteUserSubscriptionLimit { get; init; } + + /// + /// Count of subscribed site users for a Salto site associated with the connected account that has an error. + /// + [JsonPropertyName("subscribed_site_user_count")] + public int? SubscribedSiteUserCount { get; init; } + } + + public sealed record ConnectedAccountErrorsDormakabaSitesDisconnected + : ConnectedAccountErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; + } + + public sealed record ConnectedAccountErrorsUnrecognized + : ConnectedAccountErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant( + "scheduled_maintenance_window", + typeof(ConnectedAccountWarningsScheduledMaintenanceWindow) + )] + [SeamUnionVariant( + "unknown_issue_with_connected_account", + typeof(ConnectedAccountWarningsUnknownIssueWithConnectedAccount) + )] + [SeamUnionVariant( + "salto_ks_subscription_limit_almost_reached", + typeof(ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReached) + )] + [SeamUnionVariant( + "account_reauthorization_requested", + typeof(ConnectedAccountWarningsAccountReauthorizationRequested) + )] + [SeamUnionVariant("being_deleted", typeof(ConnectedAccountWarningsBeingDeleted))] + [SeamUnionVariant( + "provider_service_unavailable", + typeof(ConnectedAccountWarningsProviderServiceUnavailable) + )] + [SeamUnionVariant("setup_required", typeof(ConnectedAccountWarningsSetupRequired))] + [SeamUnionVariant( + "dormakaba_sites_unapproved", + typeof(ConnectedAccountWarningsDormakabaSitesUnapproved) + )] + [SeamUnionFallback(typeof(ConnectedAccountWarningsUnrecognized))] + public abstract record ConnectedAccountWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record ConnectedAccountWarningsScheduledMaintenanceWindow + : ConnectedAccountWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "scheduled_maintenance_window"; + } + + public sealed record ConnectedAccountWarningsUnknownIssueWithConnectedAccount + : ConnectedAccountWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unknown_issue_with_connected_account"; + } + + public sealed record ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReached + : ConnectedAccountWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "salto_ks_subscription_limit_almost_reached"; + + /// + /// Salto KS metadata associated with the connected account that has a warning. + /// + [JsonPropertyName("salto_ks_metadata")] + public ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadata SaltoKsMetadata { get; init; } = + default!; + } + + public sealed record ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadata + { + /// + /// Salto sites associated with the connected account that has a warning. + /// + [JsonPropertyName("sites")] + public List? Sites { get; init; } + } + + public sealed record ConnectedAccountWarningsSaltoKsSubscriptionLimitAlmostReachedSaltoKsMetadataSites + { + /// + /// ID of a Salto site associated with the connected account that has a warning. + /// + [JsonPropertyName("site_id")] + public string? SiteId { get; init; } + + /// + /// Name of a Salto site associated with the connected account that has a warning. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + + /// + /// Subscription limit of site users for a Salto site associated with the connected account that has a warning. + /// + [JsonPropertyName("site_user_subscription_limit")] + public int? SiteUserSubscriptionLimit { get; init; } + + /// + /// Count of subscribed site users for a Salto site associated with the connected account that has a warning. + /// + [JsonPropertyName("subscribed_site_user_count")] + public int? SubscribedSiteUserCount { get; init; } + } + + public sealed record ConnectedAccountWarningsAccountReauthorizationRequested + : ConnectedAccountWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "account_reauthorization_requested"; + } + + public sealed record ConnectedAccountWarningsBeingDeleted : ConnectedAccountWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record ConnectedAccountWarningsProviderServiceUnavailable + : ConnectedAccountWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "provider_service_unavailable"; + } + + public sealed record ConnectedAccountWarningsSetupRequired : ConnectedAccountWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "setup_required"; + } + + public sealed record ConnectedAccountWarningsDormakabaSitesUnapproved + : ConnectedAccountWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "dormakaba_sites_unapproved"; + } + + public sealed record ConnectedAccountWarningsUnrecognized + : ConnectedAccountWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// List of capabilities that were accepted during the account connection process. + /// + [JsonPropertyName("accepted_capabilities")] + public List AcceptedCapabilities { get; init; } = + default!; + + /// + /// Type of connected account. + /// + [JsonPropertyName("account_type")] + public string? AccountType { get; init; } + + /// + /// Display name for the connected account type. + /// + [JsonPropertyName("account_type_display_name")] + public string AccountTypeDisplayName { get; init; } = default!; + + /// + /// Indicates whether Seam should [import all new devices](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#automatically_manage_new_devices) for the connected account to make these devices available for management by the Seam API. + /// + [JsonPropertyName("automatically_manage_new_devices")] + public bool AutomaticallyManageNewDevices { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the connected account was created. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. + /// + [JsonPropertyName("custom_metadata")] + public object CustomMetadata { get; init; } = default!; + + /// + /// Your unique key for the customer associated with this connected account. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Default reservation check-in time for this connected account, as `HH:mm` (24-hour). Sourced from the connector configuration — set during the connect_webview for providers like Lodgify whose API does not expose check-in times. + /// + [JsonPropertyName("default_checkin_time")] + public string? DefaultCheckinTime { get; init; } + + /// + /// Default reservation check-out time for this connected account, as `HH:mm` (24-hour). Sourced from the connector configuration. + /// + [JsonPropertyName("default_checkout_time")] + public string? DefaultCheckoutTime { get; init; } + + /// + /// Display name for the connected account. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// For iCal connected accounts, the platform that produced the feed (for example, `airbnb`, `vrbo`, or `booking`), or `unknown` when it could not be determined. Intended for rendering the source platform's logo. + /// + [JsonPropertyName("ical_feed_origin")] + public string? IcalFeedOrigin { get; init; } + + /// + /// For iCal connected accounts, the feed URL for the connection. Sourced from the connector configuration. + /// + [JsonPropertyName("ical_url")] + public string? IcalUrl { get; init; } + + /// + /// Logo URL for the connected account provider. + /// + [JsonPropertyName("image_url")] + public string? ImageUrl { get; init; } + + /// + /// IANA time zone (e.g. America/Los_Angeles) for this connected account. Sourced from the connector configuration. + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + + /// + /// User identifier associated with the connected account. + /// + [Obsolete("Use `display_name` instead.")] + [JsonPropertyName("user_identifier")] + public ConnectedAccountUserIdentifier? UserIdentifier { get; init; } + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + } + + public sealed record ConnectedAccountUserIdentifier + { + /// + /// API URL for the user identifier associated with the connected account. + /// + [JsonPropertyName("api_url")] + public string? ApiUrl { get; init; } + + /// + /// Email address of the user identifier associated with the connected account. + /// + [JsonPropertyName("email")] + public string? Email { get; init; } + + /// + /// Indicates whether the user identifier associated with the connected account is exclusive. + /// + [JsonPropertyName("exclusive")] + public bool? Exclusive { get; init; } + + /// + /// Phone number of the user identifier associated with the connected account. + /// + [JsonPropertyName("phone")] + public string? Phone { get; init; } + + /// + /// Username of the user identifier associated with the connected account. + /// + [JsonPropertyName("username")] + public string? Username { get; init; } + } +} diff --git a/src/Seam/Models/CustomerPortal.cs b/src/Seam/Models/CustomerPortal.cs new file mode 100644 index 00000000..e121ed3b --- /dev/null +++ b/src/Seam/Models/CustomerPortal.cs @@ -0,0 +1,51 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a Customer Portal. Customer Portal is a hosted, customizable interface for managing device access. It enables you to embed secure, pre-authenticated access flows into your product—either by sharing a link with users or embedding a view in an iframe. + /// + /// With Customer Portal, you no longer need to build out frontend experiences for physical access, thermostats, and sensors. Instead, you can ship enterprise-grade access control experiences in a fraction of the time, while maintaining your product's branding and user experience. + /// + /// Seam hosts these flows, handling everything from account connection and device mapping to full-featured device control. + /// + public sealed record CustomerPortal + { + /// + /// Date and time at which the customer portal link was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Customer key for the customer portal. + /// + [JsonPropertyName("customer_key")] + public string CustomerKey { get; init; } = default!; + + /// + /// Date and time at which the customer portal link expires. + /// + [JsonPropertyName("expires_at")] + public string ExpiresAt { get; init; } = default!; + + /// + /// URL for the customer portal. + /// + [JsonPropertyName("url")] + public string Url { get; init; } = default!; + + /// + /// ID of the workspace associated with the customer portal. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } +} diff --git a/src/Seam/Models/Device.cs b/src/Seam/Models/Device.cs new file mode 100644 index 00000000..3a02b92f --- /dev/null +++ b/src/Seam/Models/Device.cs @@ -0,0 +1,4473 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a [device](https://docs.seam.co/core-concepts/devices) that has been connected to Seam. + /// + public sealed record Device + { + /// + /// Collection of capabilities that the device supports when connected to Seam. Values are `access_code`, which indicates that the device can manage and utilize digital PIN codes for secure access; `lock`, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; `noise_detection`, which indicates that the device supports monitoring and responding to ambient noise levels; `thermostat`, which indicates that the device can regulate and adjust indoor temperatures; `battery`, which indicates that the device can manage battery life and health; and `phone`, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum CapabilitiesSupportedEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "access_code")] + AccessCode = 1, + + [EnumMember(Value = "lock")] + Lock = 2, + + [EnumMember(Value = "noise_detection")] + NoiseDetection = 3, + + [EnumMember(Value = "thermostat")] + Thermostat = 4, + + [EnumMember(Value = "battery")] + Battery = 5, + + [EnumMember(Value = "phone")] + Phone = 6, + } + + /// + /// Type of the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "akuvox_lock")] + AkuvoxLock = 1, + + [EnumMember(Value = "august_lock")] + AugustLock = 2, + + [EnumMember(Value = "brivo_access_point")] + BrivoAccessPoint = 3, + + [EnumMember(Value = "butterflymx_panel")] + ButterflymxPanel = 4, + + [EnumMember(Value = "avigilon_alta_entry")] + AvigilonAltaEntry = 5, + + [EnumMember(Value = "doorking_lock")] + DoorkingLock = 6, + + [EnumMember(Value = "genie_door")] + GenieDoor = 7, + + [EnumMember(Value = "igloo_lock")] + IglooLock = 8, + + [EnumMember(Value = "linear_lock")] + LinearLock = 9, + + [EnumMember(Value = "lockly_lock")] + LocklyLock = 10, + + [EnumMember(Value = "kwikset_lock")] + KwiksetLock = 11, + + [EnumMember(Value = "nuki_lock")] + NukiLock = 12, + + [EnumMember(Value = "salto_lock")] + SaltoLock = 13, + + [EnumMember(Value = "schlage_lock")] + SchlageLock = 14, + + [EnumMember(Value = "smartthings_lock")] + SmartthingsLock = 15, + + [EnumMember(Value = "wyze_lock")] + WyzeLock = 16, + + [EnumMember(Value = "yale_lock")] + YaleLock = 17, + + [EnumMember(Value = "two_n_intercom")] + TwoNIntercom = 18, + + [EnumMember(Value = "controlbyweb_device")] + ControlbywebDevice = 19, + + [EnumMember(Value = "ttlock_lock")] + TtlockLock = 20, + + [EnumMember(Value = "igloohome_lock")] + IgloohomeLock = 21, + + [EnumMember(Value = "four_suites_door")] + FourSuitesDoor = 22, + + [EnumMember(Value = "dormakaba_oracode_door")] + DormakabaOracodeDoor = 23, + + [EnumMember(Value = "tedee_lock")] + TedeeLock = 24, + + [EnumMember(Value = "akiles_lock")] + AkilesLock = 25, + + [EnumMember(Value = "ultraloq_lock")] + UltraloqLock = 26, + + [EnumMember(Value = "yacan_lock")] + YacanLock = 27, + + [EnumMember(Value = "keyincode_lock")] + KeyincodeLock = 28, + + [EnumMember(Value = "omnitec_lock")] + OmnitecLock = 29, + + [EnumMember(Value = "kisi_lock")] + KisiLock = 30, + + [EnumMember(Value = "aqara_lock")] + AqaraLock = 31, + + [EnumMember(Value = "keynest_key")] + KeynestKey = 32, + + [EnumMember(Value = "noiseaware_activity_zone")] + NoiseawareActivityZone = 33, + + [EnumMember(Value = "minut_sensor")] + MinutSensor = 34, + + [EnumMember(Value = "ecobee_thermostat")] + EcobeeThermostat = 35, + + [EnumMember(Value = "nest_thermostat")] + NestThermostat = 36, + + [EnumMember(Value = "honeywell_resideo_thermostat")] + HoneywellResideoThermostat = 37, + + [EnumMember(Value = "tado_thermostat")] + TadoThermostat = 38, + + [EnumMember(Value = "sensi_thermostat")] + SensiThermostat = 39, + + [EnumMember(Value = "smartthings_thermostat")] + SmartthingsThermostat = 40, + + [EnumMember(Value = "ios_phone")] + IosPhone = 41, + + [EnumMember(Value = "android_phone")] + AndroidPhone = 42, + + [EnumMember(Value = "ring_camera")] + RingCamera = 43, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("account_disconnected", typeof(DeviceErrorsAccountDisconnected))] + [SeamUnionVariant( + "salto_ks_subscription_limit_exceeded", + typeof(DeviceErrorsSaltoKsSubscriptionLimitExceeded) + )] + [SeamUnionVariant("insufficient_permissions", typeof(DeviceErrorsInsufficientPermissions))] + [SeamUnionVariant( + "dormakaba_sites_disconnected", + typeof(DeviceErrorsDormakabaSitesDisconnected) + )] + [SeamUnionVariant("device_offline", typeof(DeviceErrorsDeviceOffline))] + [SeamUnionVariant("device_removed", typeof(DeviceErrorsDeviceRemoved))] + [SeamUnionVariant("hub_disconnected", typeof(DeviceErrorsHubDisconnected))] + [SeamUnionVariant("device_disconnected", typeof(DeviceErrorsDeviceDisconnected))] + [SeamUnionVariant( + "empty_backup_access_code_pool", + typeof(DeviceErrorsEmptyBackupAccessCodePool) + )] + [SeamUnionVariant( + "august_lock_not_authorized", + typeof(DeviceErrorsAugustLockNotAuthorized) + )] + [SeamUnionVariant( + "missing_device_credentials", + typeof(DeviceErrorsMissingDeviceCredentials) + )] + [SeamUnionVariant("auxiliary_heat_running", typeof(DeviceErrorsAuxiliaryHeatRunning))] + [SeamUnionVariant("subscription_required", typeof(DeviceErrorsSubscriptionRequired))] + [SeamUnionVariant("bridge_disconnected", typeof(DeviceErrorsBridgeDisconnected))] + [SeamUnionFallback(typeof(DeviceErrorsUnrecognized))] + public abstract record DeviceErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record DeviceErrorsAccountDisconnected : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "account_disconnected"; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsSaltoKsSubscriptionLimitExceeded : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsInsufficientPermissions : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "insufficient_permissions"; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsDormakabaSitesDisconnected : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsDeviceOffline : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_offline"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsDeviceRemoved : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_removed"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsHubDisconnected : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "hub_disconnected"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsDeviceDisconnected : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_disconnected"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsEmptyBackupAccessCodePool : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "empty_backup_access_code_pool"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsAugustLockNotAuthorized : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "august_lock_not_authorized"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsMissingDeviceCredentials : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "missing_device_credentials"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsAuxiliaryHeatRunning : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "auxiliary_heat_running"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsSubscriptionRequired : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "subscription_required"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record DeviceErrorsBridgeDisconnected : DeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "bridge_disconnected"; + + /// + /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). + /// + [JsonPropertyName("is_bridge_error")] + public bool? IsBridgeError { get; init; } + + /// + /// Indicates whether the error is related specifically to the connected account. + /// + [JsonPropertyName("is_connected_account_error")] + public bool? IsConnectedAccountError { get; init; } + } + + public sealed record DeviceErrorsUnrecognized : DeviceErrors, ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant( + "partial_backup_access_code_pool", + typeof(DeviceWarningsPartialBackupAccessCodePool) + )] + [SeamUnionVariant("many_active_backup_codes", typeof(DeviceWarningsManyActiveBackupCodes))] + [SeamUnionVariant( + "third_party_integration_detected", + typeof(DeviceWarningsThirdPartyIntegrationDetected) + )] + [SeamUnionVariant( + "ttlock_lock_gateway_unlocking_not_enabled", + typeof(DeviceWarningsTtlockLockGatewayUnlockingNotEnabled) + )] + [SeamUnionVariant( + "ttlock_weak_gateway_signal", + typeof(DeviceWarningsTtlockWeakGatewaySignal) + )] + [SeamUnionVariant("power_saving_mode", typeof(DeviceWarningsPowerSavingMode))] + [SeamUnionVariant( + "temperature_threshold_exceeded", + typeof(DeviceWarningsTemperatureThresholdExceeded) + )] + [SeamUnionVariant( + "device_communication_degraded", + typeof(DeviceWarningsDeviceCommunicationDegraded) + )] + [SeamUnionVariant( + "scheduled_maintenance_window", + typeof(DeviceWarningsScheduledMaintenanceWindow) + )] + [SeamUnionVariant( + "device_has_flaky_connection", + typeof(DeviceWarningsDeviceHasFlakyConnection) + )] + [SeamUnionVariant("salto_ks_office_mode", typeof(DeviceWarningsSaltoKsOfficeMode))] + [SeamUnionVariant("salto_ks_privacy_mode", typeof(DeviceWarningsSaltoKsPrivacyMode))] + [SeamUnionVariant("privacy_mode", typeof(DeviceWarningsPrivacyMode))] + [SeamUnionVariant( + "salto_ks_subscription_limit_almost_reached", + typeof(DeviceWarningsSaltoKsSubscriptionLimitAlmostReached) + )] + [SeamUnionVariant( + "salto_ks_lock_access_code_support_removed", + typeof(DeviceWarningsSaltoKsLockAccessCodeSupportRemoved) + )] + [SeamUnionVariant("unknown_issue_with_phone", typeof(DeviceWarningsUnknownIssueWithPhone))] + [SeamUnionVariant( + "lockly_time_zone_not_configured", + typeof(DeviceWarningsLocklyTimeZoneNotConfigured) + )] + [SeamUnionVariant( + "ultraloq_time_zone_unknown", + typeof(DeviceWarningsUltraloqTimeZoneUnknown) + )] + [SeamUnionVariant("time_zone_unknown", typeof(DeviceWarningsTimeZoneUnknown))] + [SeamUnionVariant("time_zone_mismatch", typeof(DeviceWarningsTimeZoneMismatch))] + [SeamUnionVariant( + "two_n_device_missing_timezone", + typeof(DeviceWarningsTwoNDeviceMissingTimezone) + )] + [SeamUnionVariant( + "hub_required_for_additional_capabilities", + typeof(DeviceWarningsHubRequiredForAdditionalCapabilities) + )] + [SeamUnionVariant("provider_issue", typeof(DeviceWarningsProviderIssue))] + [SeamUnionVariant( + "keynest_unsupported_locker", + typeof(DeviceWarningsKeynestUnsupportedLocker) + )] + [SeamUnionVariant( + "accessory_keypad_setup_required", + typeof(DeviceWarningsAccessoryKeypadSetupRequired) + )] + [SeamUnionVariant( + "accessory_keypad_low_battery", + typeof(DeviceWarningsAccessoryKeypadLowBattery) + )] + [SeamUnionVariant("unreliable_online_status", typeof(DeviceWarningsUnreliableOnlineStatus))] + [SeamUnionVariant("max_access_codes_reached", typeof(DeviceWarningsMaxAccessCodesReached))] + [SeamUnionFallback(typeof(DeviceWarningsUnrecognized))] + public abstract record DeviceWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record DeviceWarningsPartialBackupAccessCodePool : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "partial_backup_access_code_pool"; + } + + public sealed record DeviceWarningsManyActiveBackupCodes : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "many_active_backup_codes"; + } + + public sealed record DeviceWarningsThirdPartyIntegrationDetected : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "third_party_integration_detected"; + } + + public sealed record DeviceWarningsTtlockLockGatewayUnlockingNotEnabled : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "ttlock_lock_gateway_unlocking_not_enabled"; + } + + public sealed record DeviceWarningsTtlockWeakGatewaySignal : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "ttlock_weak_gateway_signal"; + } + + public sealed record DeviceWarningsPowerSavingMode : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "power_saving_mode"; + } + + public sealed record DeviceWarningsTemperatureThresholdExceeded : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "temperature_threshold_exceeded"; + } + + public sealed record DeviceWarningsDeviceCommunicationDegraded : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_communication_degraded"; + } + + public sealed record DeviceWarningsScheduledMaintenanceWindow : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "scheduled_maintenance_window"; + } + + public sealed record DeviceWarningsDeviceHasFlakyConnection : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_has_flaky_connection"; + } + + public sealed record DeviceWarningsSaltoKsOfficeMode : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "salto_ks_office_mode"; + } + + public sealed record DeviceWarningsSaltoKsPrivacyMode : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "salto_ks_privacy_mode"; + } + + public sealed record DeviceWarningsPrivacyMode : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "privacy_mode"; + } + + public sealed record DeviceWarningsSaltoKsSubscriptionLimitAlmostReached : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "salto_ks_subscription_limit_almost_reached"; + } + + public sealed record DeviceWarningsSaltoKsLockAccessCodeSupportRemoved : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "salto_ks_lock_access_code_support_removed"; + } + + public sealed record DeviceWarningsUnknownIssueWithPhone : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unknown_issue_with_phone"; + } + + public sealed record DeviceWarningsLocklyTimeZoneNotConfigured : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "lockly_time_zone_not_configured"; + } + + public sealed record DeviceWarningsUltraloqTimeZoneUnknown : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "ultraloq_time_zone_unknown"; + } + + public sealed record DeviceWarningsTimeZoneUnknown : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "time_zone_unknown"; + } + + public sealed record DeviceWarningsTimeZoneMismatch : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "time_zone_mismatch"; + } + + public sealed record DeviceWarningsTwoNDeviceMissingTimezone : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "two_n_device_missing_timezone"; + } + + public sealed record DeviceWarningsHubRequiredForAdditionalCapabilities : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "hub_required_for_additional_capabilities"; + } + + public sealed record DeviceWarningsProviderIssue : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "provider_issue"; + } + + public sealed record DeviceWarningsKeynestUnsupportedLocker : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "keynest_unsupported_locker"; + } + + public sealed record DeviceWarningsAccessoryKeypadSetupRequired : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "accessory_keypad_setup_required"; + } + + public sealed record DeviceWarningsAccessoryKeypadLowBattery : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "accessory_keypad_low_battery"; + } + + public sealed record DeviceWarningsUnreliableOnlineStatus : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unreliable_online_status"; + } + + public sealed record DeviceWarningsMaxAccessCodesReached : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "max_access_codes_reached"; + + /// + /// Number of active access codes on the device when the warning was set. + /// + [JsonPropertyName("active_access_code_count")] + public int ActiveAccessCodeCount { get; init; } = default!; + + /// + /// Maximum number of active access codes supported by the device. + /// + [JsonPropertyName("max_active_access_code_count")] + public int MaxActiveAccessCodeCount { get; init; } = default!; + } + + public sealed record DeviceWarningsUnrecognized : DeviceWarnings, ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Indicates whether the lock supports configuring automatic locking. + /// + [JsonPropertyName("can_configure_auto_lock")] + public bool? CanConfigureAutoLock { get; init; } + + /// + /// Indicates whether the thermostat supports cooling. + /// + [JsonPropertyName("can_hvac_cool")] + public bool? CanHvacCool { get; init; } + + /// + /// Indicates whether the thermostat supports heating. + /// + [JsonPropertyName("can_hvac_heat")] + public bool? CanHvacHeat { get; init; } + + /// + /// Indicates whether the thermostat supports simultaneous heating and cooling. + /// + [JsonPropertyName("can_hvac_heat_cool")] + public bool? CanHvacHeatCool { get; init; } + + /// + /// Indicates whether the device supports programming offline access codes. + /// + [JsonPropertyName("can_program_offline_access_codes")] + public bool? CanProgramOfflineAccessCodes { get; init; } + + /// + /// Indicates whether the device supports programming online access codes. + /// + [JsonPropertyName("can_program_online_access_codes")] + public bool? CanProgramOnlineAccessCodes { get; init; } + + /// + /// Indicates whether the thermostat supports different climate programs for each day of the week. + /// + [JsonPropertyName("can_program_thermostat_programs_as_different_each_day")] + public bool? CanProgramThermostatProgramsAsDifferentEachDay { get; init; } + + /// + /// Indicates whether the thermostat supports a single climate program applied to every day. + /// + [JsonPropertyName("can_program_thermostat_programs_as_same_each_day")] + public bool? CanProgramThermostatProgramsAsSameEachDay { get; init; } + + /// + /// Indicates whether the thermostat supports weekday/weekend climate programs. + /// + [JsonPropertyName("can_program_thermostat_programs_as_weekday_weekend")] + public bool? CanProgramThermostatProgramsAsWeekdayWeekend { get; init; } + + /// + /// Indicates whether the device supports remote locking. + /// + [JsonPropertyName("can_remotely_lock")] + public bool? CanRemotelyLock { get; init; } + + /// + /// Indicates whether the device supports remote unlocking. + /// + [JsonPropertyName("can_remotely_unlock")] + public bool? CanRemotelyUnlock { get; init; } + + /// + /// Indicates whether the thermostat supports running climate programs. + /// + [JsonPropertyName("can_run_thermostat_programs")] + public bool? CanRunThermostatPrograms { get; init; } + + /// + /// Indicates whether the device supports simulating connection in a sandbox. + /// + [JsonPropertyName("can_simulate_connection")] + public bool? CanSimulateConnection { get; init; } + + /// + /// Indicates whether the device supports simulating disconnection in a sandbox. + /// + [JsonPropertyName("can_simulate_disconnection")] + public bool? CanSimulateDisconnection { get; init; } + + /// + /// Indicates whether the hub supports simulating connection in a sandbox. + /// + [JsonPropertyName("can_simulate_hub_connection")] + public bool? CanSimulateHubConnection { get; init; } + + /// + /// Indicates whether the hub supports simulating disconnection in a sandbox. + /// + [JsonPropertyName("can_simulate_hub_disconnection")] + public bool? CanSimulateHubDisconnection { get; init; } + + /// + /// Indicates whether the device supports simulating a paid subscription in a sandbox. + /// + [JsonPropertyName("can_simulate_paid_subscription")] + public bool? CanSimulatePaidSubscription { get; init; } + + /// + /// Indicates whether the device supports simulating removal in a sandbox. + /// + [JsonPropertyName("can_simulate_removal")] + public bool? CanSimulateRemoval { get; init; } + + /// + /// Indicates whether the thermostat can be turned off. + /// + [JsonPropertyName("can_turn_off_hvac")] + public bool? CanTurnOffHvac { get; init; } + + /// + /// Indicates whether the lock supports unlocking with an access code. + /// + [JsonPropertyName("can_unlock_with_code")] + public bool? CanUnlockWithCode { get; init; } + + /// + /// Collection of capabilities that the device supports when connected to Seam. Values are `access_code`, which indicates that the device can manage and utilize digital PIN codes for secure access; `lock`, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; `noise_detection`, which indicates that the device supports monitoring and responding to ambient noise levels; `thermostat`, which indicates that the device can regulate and adjust indoor temperatures; `battery`, which indicates that the device can manage battery life and health; and `phone`, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). + /// + [JsonPropertyName("capabilities_supported")] + public List CapabilitiesSupported { get; init; } = + default!; + + /// + /// Unique identifier for the account associated with the device. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the device object was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. + /// + [JsonPropertyName("custom_metadata")] + public object CustomMetadata { get; init; } = default!; + + /// + /// ID of the device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Manufacturer of the device. Represents the hardware brand, which may differ from the provider. + /// + [JsonPropertyName("device_manufacturer")] + public DeviceDeviceManufacturer? DeviceManufacturer { get; init; } + + /// + /// Provider of the device. Represents the third-party service through which the device is controlled. + /// + [JsonPropertyName("device_provider")] + public DeviceDeviceProvider? DeviceProvider { get; init; } + + /// + /// Type of the device. + /// + [JsonPropertyName("device_type")] + public Device.DeviceTypeEnum DeviceType { get; init; } = default!; + + /// + /// Display name of the device, defaults to nickname (if it is set) or `properties.appearance.name`, otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Array of errors associated with the device. Each error object within the array contains two fields: `error_code` and `message`. `error_code` is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Indicates whether Seam manages the device. See also [Managed and Unmanaged Devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). + /// + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Location information for the device. + /// + [JsonPropertyName("location")] + public DeviceLocation? Location { get; init; } + + /// + /// Optional nickname to describe the device, settable through Seam. + /// + [JsonPropertyName("nickname")] + public string? Nickname { get; init; } + + /// + /// Properties of the device. + /// + [JsonPropertyName("properties")] + public DeviceProperties Properties { get; init; } = default!; + + /// + /// IDs of the spaces the device is in. + /// + [JsonPropertyName("space_ids")] + public List SpaceIds { get; init; } = default!; + + /// + /// Array of warnings associated with the device. Each warning object within the array contains two fields: `warning_code` and `message`. `warning_code` is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// Unique identifier for the Seam workspace associated with the device. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record DeviceDeviceManufacturer + { + /// + /// Display name for the manufacturer, such as `August`, `Yale`, `Salto`, and so on. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Image URL for the manufacturer logo. + /// + [JsonPropertyName("image_url")] + public string? ImageUrl { get; init; } + + /// + /// Manufacturer identifier, such as `august`, `yale`, `salto`, and so on. + /// + [JsonPropertyName("manufacturer")] + public string Manufacturer { get; init; } = default!; + } + + public sealed record DeviceDeviceProvider + { + /// + /// Device provider name. Corresponds to the integration type, such as `august`, `schlage`, `yale_access`, and so on. + /// + [JsonPropertyName("device_provider_name")] + public string DeviceProviderName { get; init; } = default!; + + /// + /// Display name for the device provider type. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Image URL for the device provider. + /// + [JsonPropertyName("image_url")] + public string? ImageUrl { get; init; } + + /// + /// Provider category. Indicates the third-party provider type, such as `stable`, for stable integrations, or `internal`, for internal integrations. + /// + [JsonPropertyName("provider_category")] + public string ProviderCategory { get; init; } = default!; + } + + public sealed record DeviceLocation + { + /// + /// Name of the device location. + /// + [JsonPropertyName("location_name")] + public string? LocationName { get; init; } + + /// + /// Name of the room within the device location, when the provider reports one. + /// + [JsonPropertyName("room_name")] + public string? RoomName { get; init; } + + /// + /// Time zone of the device location. + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + + /// + /// Time zone of the device location. + /// + [Obsolete("Use `time_zone` instead.")] + [JsonPropertyName("timezone")] + public string? Timezone { get; init; } + } + + public sealed record DeviceProperties + { + /// + /// Climate preset modes that the thermostat supports, such as "home", "away", "wake", "sleep", "occupied", and "unoccupied". + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AvailableClimatePresetModesEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "home")] + Home = 1, + + [EnumMember(Value = "away")] + Away = 2, + + [EnumMember(Value = "wake")] + Wake = 3, + + [EnumMember(Value = "sleep")] + Sleep = 4, + + [EnumMember(Value = "occupied")] + Occupied = 5, + + [EnumMember(Value = "unoccupied")] + Unoccupied = 6, + } + + /// + /// Fan mode settings that the thermostat supports. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AvailableFanModeSettingsEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// HVAC mode settings that the thermostat supports. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AvailableHvacModeSettingsEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "off")] + Off = 1, + + [EnumMember(Value = "heat")] + Heat = 2, + + [EnumMember(Value = "cool")] + Cool = 3, + + [EnumMember(Value = "heat_cool")] + HeatCool = 4, + + [EnumMember(Value = "eco")] + Eco = 5, + } + + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum FanModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// Accessory keypad properties and state. + /// + [JsonPropertyName("accessory_keypad")] + public DevicePropertiesAccessoryKeypad? AccessoryKeypad { get; init; } + + /// + /// Appearance-related properties, as reported by the device. + /// + [JsonPropertyName("appearance")] + public DevicePropertiesAppearance Appearance { get; init; } = default!; + + /// + /// Represents the current status of the battery charge level. + /// + [JsonPropertyName("battery")] + public DevicePropertiesBattery? Battery { get; init; } + + /// + /// Indicates the battery level of the device as a decimal value between 0 and 1, inclusive. + /// + [JsonPropertyName("battery_level")] + public float? BatteryLevel { get; init; } + + /// + /// Array of noise threshold IDs that are currently triggering. + /// + [JsonPropertyName("currently_triggering_noise_threshold_ids")] + public List? CurrentlyTriggeringNoiseThresholdIds { get; init; } + + /// + /// Indicates whether the device has direct power. + /// + [JsonPropertyName("has_direct_power")] + public bool? HasDirectPower { get; init; } + + /// + /// Alt text for the device image. + /// + [JsonPropertyName("image_alt_text")] + public string? ImageAltText { get; init; } + + /// + /// Image URL for the device. + /// + [JsonPropertyName("image_url")] + public string? ImageUrl { get; init; } + + /// + /// Manufacturer of the device. When a device, such as a smart lock, is connected through a smart hub, the manufacturer of the device might be different from that of the smart hub. + /// + [JsonPropertyName("manufacturer")] + public string? Manufacturer { get; init; } + + /// + /// Device model-related properties. + /// + [JsonPropertyName("model")] + public DevicePropertiesModel Model { get; init; } = default!; + + /// + /// Name of the device. + /// + [Obsolete("use device.display_name instead")] + [JsonPropertyName("name")] + public string Name { get; init; } = default!; + + /// + /// Indicates current noise level in decibels, if the device supports noise detection. + /// + [JsonPropertyName("noise_level_decibels")] + public float? NoiseLevelDecibels { get; init; } + + /// + /// Indicates whether it is currently possible to use offline access codes for the device. + /// + [Obsolete("use device.can_program_offline_access_codes")] + [JsonPropertyName("offline_access_codes_enabled")] + public bool? OfflineAccessCodesEnabled { get; init; } + + /// + /// Indicates whether the device is online. + /// + [JsonPropertyName("online")] + public bool Online { get; init; } = default!; + + /// + /// Indicates whether it is currently possible to use online access codes for the device. + /// + [Obsolete("use device.can_program_online_access_codes")] + [JsonPropertyName("online_access_codes_enabled")] + public bool? OnlineAccessCodesEnabled { get; init; } + + /// + /// Serial number of the device. + /// + [JsonPropertyName("serial_number")] + public string? SerialNumber { get; init; } + + [Obsolete("use device.properties.model.can_connect_accessory_keypad")] + [JsonPropertyName("supports_accessory_keypad")] + public bool? SupportsAccessoryKeypad { get; init; } + + [Obsolete("use offline_access_codes_enabled")] + [JsonPropertyName("supports_offline_access_codes")] + public bool? SupportsOfflineAccessCodes { get; init; } + + /// + /// ASSA ABLOY Credential Service metadata for the phone. + /// + [JsonPropertyName("assa_abloy_credential_service_metadata")] + public DevicePropertiesAssaAbloyCredentialServiceMetadata? AssaAbloyCredentialServiceMetadata { get; init; } + + /// + /// Salto Space credential service metadata for the phone. + /// + [JsonPropertyName("salto_space_credential_service_metadata")] + public DevicePropertiesSaltoSpaceCredentialServiceMetadata? SaltoSpaceCredentialServiceMetadata { get; init; } + + /// + /// Metadata for an Akiles device. + /// + [JsonPropertyName("akiles_metadata")] + public DevicePropertiesAkilesMetadata? AkilesMetadata { get; init; } + + /// + /// Metadata for an Aqara device. + /// + [JsonPropertyName("aqara_metadata")] + public DevicePropertiesAqaraMetadata? AqaraMetadata { get; init; } + + /// + /// Metadata for an ASSA ABLOY Vostio system. + /// + [JsonPropertyName("assa_abloy_vostio_metadata")] + public DevicePropertiesAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; init; } + + /// + /// Metadata for an August device. + /// + [JsonPropertyName("august_metadata")] + public DevicePropertiesAugustMetadata? AugustMetadata { get; init; } + + /// + /// Metadata for an Avigilon Alta system. + /// + [JsonPropertyName("avigilon_alta_metadata")] + public DevicePropertiesAvigilonAltaMetadata? AvigilonAltaMetadata { get; init; } + + /// + /// Metadata for a Brivo device. + /// + [JsonPropertyName("brivo_metadata")] + public DevicePropertiesBrivoMetadata? BrivoMetadata { get; init; } + + /// + /// Metadata for a ControlByWeb device. + /// + [JsonPropertyName("controlbyweb_metadata")] + public DevicePropertiesControlbywebMetadata? ControlbywebMetadata { get; init; } + + /// + /// Metadata for a dormakaba Oracode device. + /// + [JsonPropertyName("dormakaba_oracode_metadata")] + public DevicePropertiesDormakabaOracodeMetadata? DormakabaOracodeMetadata { get; init; } + + /// + /// Metadata for an ecobee device. + /// + [JsonPropertyName("ecobee_metadata")] + public DevicePropertiesEcobeeMetadata? EcobeeMetadata { get; init; } + + /// + /// Metadata for a 4SUITES device. + /// + [JsonPropertyName("four_suites_metadata")] + public DevicePropertiesFourSuitesMetadata? FourSuitesMetadata { get; init; } + + /// + /// Metadata for a Genie device. + /// + [JsonPropertyName("genie_metadata")] + public DevicePropertiesGenieMetadata? GenieMetadata { get; init; } + + /// + /// Metadata for a Honeywell Resideo device. + /// + [JsonPropertyName("honeywell_resideo_metadata")] + public DevicePropertiesHoneywellResideoMetadata? HoneywellResideoMetadata { get; init; } + + /// + /// Metadata for an igloo device. + /// + [JsonPropertyName("igloo_metadata")] + public DevicePropertiesIglooMetadata? IglooMetadata { get; init; } + + /// + /// Metadata for an igloohome device. + /// + [JsonPropertyName("igloohome_metadata")] + public DevicePropertiesIgloohomeMetadata? IgloohomeMetadata { get; init; } + + /// + /// Metadata for a KeyNest device. + /// + [JsonPropertyName("keynest_metadata")] + public DevicePropertiesKeynestMetadata? KeynestMetadata { get; init; } + + /// + /// Metadata for a Kisi device. + /// + [JsonPropertyName("kisi_metadata")] + public DevicePropertiesKisiMetadata? KisiMetadata { get; init; } + + /// + /// Metadata for a Korelock device. + /// + [JsonPropertyName("korelock_metadata")] + public DevicePropertiesKorelockMetadata? KorelockMetadata { get; init; } + + /// + /// Metadata for a Kwikset device. + /// + [JsonPropertyName("kwikset_metadata")] + public DevicePropertiesKwiksetMetadata? KwiksetMetadata { get; init; } + + /// + /// Metadata for a Lockly device. + /// + [JsonPropertyName("lockly_metadata")] + public DevicePropertiesLocklyMetadata? LocklyMetadata { get; init; } + + /// + /// Metadata for a Minut device. + /// + [JsonPropertyName("minut_metadata")] + public DevicePropertiesMinutMetadata? MinutMetadata { get; init; } + + /// + /// Metadata for a Google Nest device. + /// + [JsonPropertyName("nest_metadata")] + public DevicePropertiesNestMetadata? NestMetadata { get; init; } + + /// + /// Metadata for a NoiseAware device. + /// + [JsonPropertyName("noiseaware_metadata")] + public DevicePropertiesNoiseawareMetadata? NoiseawareMetadata { get; init; } + + /// + /// Metadata for a Nuki device. + /// + [JsonPropertyName("nuki_metadata")] + public DevicePropertiesNukiMetadata? NukiMetadata { get; init; } + + /// + /// Metadata for an Omnitec device. + /// + [JsonPropertyName("omnitec_metadata")] + public DevicePropertiesOmnitecMetadata? OmnitecMetadata { get; init; } + + /// + /// Metadata for a Ring device. + /// + [JsonPropertyName("ring_metadata")] + public DevicePropertiesRingMetadata? RingMetadata { get; init; } + + /// + /// Metadata for a Salto KS device. + /// + [JsonPropertyName("salto_ks_metadata")] + public DevicePropertiesSaltoKsMetadata? SaltoKsMetadata { get; init; } + + /// + /// Metada for a Salto device. + /// + [Obsolete("Use `salto_ks_metadata` instead.")] + [JsonPropertyName("salto_metadata")] + public DevicePropertiesSaltoMetadata? SaltoMetadata { get; init; } + + /// + /// Metadata for a Schlage device. + /// + [JsonPropertyName("schlage_metadata")] + public DevicePropertiesSchlageMetadata? SchlageMetadata { get; init; } + + /// + /// Metadata for Seam Bridge. + /// + [JsonPropertyName("seam_bridge_metadata")] + public DevicePropertiesSeamBridgeMetadata? SeamBridgeMetadata { get; init; } + + /// + /// Metadata for a Sensi device. + /// + [JsonPropertyName("sensi_metadata")] + public DevicePropertiesSensiMetadata? SensiMetadata { get; init; } + + /// + /// Metadata for a SmartThings device. + /// + [JsonPropertyName("smartthings_metadata")] + public DevicePropertiesSmartthingsMetadata? SmartthingsMetadata { get; init; } + + /// + /// Metadata for a tado° device. + /// + [JsonPropertyName("tado_metadata")] + public DevicePropertiesTadoMetadata? TadoMetadata { get; init; } + + /// + /// Metadata for a Tedee device. + /// + [JsonPropertyName("tedee_metadata")] + public DevicePropertiesTedeeMetadata? TedeeMetadata { get; init; } + + /// + /// Metadata for a TTLock device. + /// + [JsonPropertyName("ttlock_metadata")] + public DevicePropertiesTtlockMetadata? TtlockMetadata { get; init; } + + /// + /// Metadata for a 2N device. + /// + [JsonPropertyName("two_n_metadata")] + public DevicePropertiesTwoNMetadata? TwoNMetadata { get; init; } + + /// + /// Metadata for an Ultraloq device. + /// + [JsonPropertyName("ultraloq_metadata")] + public DevicePropertiesUltraloqMetadata? UltraloqMetadata { get; init; } + + /// + /// Metadata for an ASSA ABLOY Visionline system. + /// + [JsonPropertyName("visionline_metadata")] + public DevicePropertiesVisionlineMetadata? VisionlineMetadata { get; init; } + + /// + /// Metadata for a Wyze device. + /// + [JsonPropertyName("wyze_metadata")] + public DevicePropertiesWyzeMetadata? WyzeMetadata { get; init; } + + /// + /// Metadata for a Yacan device. + /// + [JsonPropertyName("yacan_metadata")] + public DevicePropertiesYacanMetadata? YacanMetadata { get; init; } + + /// + /// The delay in seconds before the lock automatically locks after being unlocked. + /// + [JsonPropertyName("auto_lock_delay_seconds")] + public float? AutoLockDelaySeconds { get; init; } + + /// + /// Indicates whether automatic locking is enabled. + /// + [JsonPropertyName("auto_lock_enabled")] + public bool? AutoLockEnabled { get; init; } + + /// + /// Indicates whether the [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) is currently enabled for the device. To disable it, set this to `false` using [/devices/update](https://docs.seam.co/api/devices/update). + /// + [JsonPropertyName("backup_access_code_pool_enabled")] + public bool? BackupAccessCodePoolEnabled { get; init; } + + /// + /// Constraints on access codes for the device. Seam represents each constraint as an object with a `constraint_type` property. Depending on the constraint type, there may also be additional properties. Note that some constraints are manufacturer- or device-specific. + /// + [JsonPropertyName("code_constraints")] + public List? CodeConstraints { get; init; } + + /// + /// Indicates whether the door is open. + /// + [JsonPropertyName("door_open")] + public bool? DoorOpen { get; init; } + + /// + /// Indicates whether the device supports native entry events. + /// + [JsonPropertyName("has_native_entry_events")] + public bool? HasNativeEntryEvents { get; init; } + + /// + /// Keypad battery status. + /// + [JsonPropertyName("keypad_battery")] + public DevicePropertiesKeypadBattery? KeypadBattery { get; init; } + + /// + /// Indicates whether the lock is locked. + /// + [JsonPropertyName("locked")] + public bool? Locked { get; init; } + + /// + /// Maximum number of active access codes that the device supports. + /// + [JsonPropertyName("max_active_codes_supported")] + public float? MaxActiveCodesSupported { get; init; } + + /// + /// Time frames that may be requested when creating an offline access code, expressed as a list of options. The caller picks one option (by matching the requested duration when the options' duration ranges do not overlap, or by `display_name` when they do) and satisfies that one option's rules. When `undefined`, any time frame works. + /// + [JsonPropertyName("offline_time_frame_options")] + public List? OfflineTimeFrameOptions { get; init; } + + /// + /// Time frames that may be requested when creating an online access code, expressed as a list of options. The caller picks one option (by matching the requested duration when the options' duration ranges do not overlap, or by `display_name` when they do) and satisfies that one option's rules. When `undefined`, any time frame works. + /// + [JsonPropertyName("online_time_frame_options")] + public List? OnlineTimeFrameOptions { get; init; } + + /// + /// Supported code lengths for access codes. + /// + [JsonPropertyName("supported_code_lengths")] + public List? SupportedCodeLengths { get; init; } + + /// + /// Indicates whether the device supports a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes). + /// + [JsonPropertyName("supports_backup_access_code_pool")] + public bool? SupportsBackupAccessCodePool { get; init; } + + /// + /// Active [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [Obsolete("Use `active_thermostat_schedule_id` with `/thermostats/schedules/get` instead.")] + [JsonPropertyName("active_thermostat_schedule")] + public DevicePropertiesActiveThermostatSchedule? ActiveThermostatSchedule { get; init; } + + /// + /// ID of the active [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [JsonPropertyName("active_thermostat_schedule_id")] + public string? ActiveThermostatScheduleId { get; init; } + + /// + /// Climate preset modes that the thermostat supports, such as "home", "away", "wake", "sleep", "occupied", and "unoccupied". + /// + [JsonPropertyName("available_climate_preset_modes")] + public List? AvailableClimatePresetModes { get; init; } + + /// + /// Available [climate presets](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for the thermostat. + /// + [JsonPropertyName("available_climate_presets")] + public List? AvailableClimatePresets { get; init; } + + /// + /// Fan mode settings that the thermostat supports. + /// + [JsonPropertyName("available_fan_mode_settings")] + public List? AvailableFanModeSettings { get; init; } + + /// + /// HVAC mode settings that the thermostat supports. + /// + [JsonPropertyName("available_hvac_mode_settings")] + public List? AvailableHvacModeSettings { get; init; } + + /// + /// Current climate setting. + /// + [JsonPropertyName("current_climate_setting")] + public DevicePropertiesCurrentClimateSetting? CurrentClimateSetting { get; init; } + + [Obsolete("use fallback_climate_preset_key to specify a fallback climate preset instead.")] + [JsonPropertyName("default_climate_setting")] + public DevicePropertiesDefaultClimateSetting? DefaultClimateSetting { get; init; } + + /// + /// Key of the [fallback climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) for the thermostat. + /// + [JsonPropertyName("fallback_climate_preset_key")] + public string? FallbackClimatePresetKey { get; init; } + + [Obsolete("Use `current_climate_setting.fan_mode_setting` instead.")] + [JsonPropertyName("fan_mode_setting")] + public DeviceProperties.FanModeSettingEnum? FanModeSetting { get; init; } + + /// + /// Indicates whether the connected HVAC system is currently cooling, as reported by the thermostat. + /// + [JsonPropertyName("is_cooling")] + public bool? IsCooling { get; init; } + + /// + /// Indicates whether the fan in the connected HVAC system is currently running, as reported by the thermostat. + /// + [JsonPropertyName("is_fan_running")] + public bool? IsFanRunning { get; init; } + + /// + /// Indicates whether the connected HVAC system is currently heating, as reported by the thermostat. + /// + [JsonPropertyName("is_heating")] + public bool? IsHeating { get; init; } + + /// + /// Indicates whether the current thermostat settings differ from the most recent active program or schedule that Seam activated. For this condition to occur, `current_climate_setting.manual_override_allowed` must also be `true`. + /// + [JsonPropertyName("is_temporary_manual_override_active")] + public bool? IsTemporaryManualOverrideActive { get; init; } + + /// + /// Maximum [cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#cooling-set-point) in °C. + /// + [JsonPropertyName("max_cooling_set_point_celsius")] + public float? MaxCoolingSetPointCelsius { get; init; } + + /// + /// Maximum [cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#cooling-set-point) in °F. + /// + [JsonPropertyName("max_cooling_set_point_fahrenheit")] + public float? MaxCoolingSetPointFahrenheit { get; init; } + + /// + /// Maximum [heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#heating-set-point) in °C. + /// + [JsonPropertyName("max_heating_set_point_celsius")] + public float? MaxHeatingSetPointCelsius { get; init; } + + /// + /// Maximum [heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#heating-set-point) in °F. + /// + [JsonPropertyName("max_heating_set_point_fahrenheit")] + public float? MaxHeatingSetPointFahrenheit { get; init; } + + /// + /// Maximum number of periods that the thermostat can support per day. For example, if the thermostat supports 4 periods per day, this value is 4. + /// + [JsonPropertyName("max_thermostat_daily_program_periods_per_day")] + public float? MaxThermostatDailyProgramPeriodsPerDay { get; init; } + + /// + /// Maximum number of climate presets that the thermostat can support for weekly programming. + /// + [JsonPropertyName("max_unique_climate_presets_per_thermostat_weekly_program")] + public float? MaxUniqueClimatePresetsPerThermostatWeeklyProgram { get; init; } + + /// + /// Minimum [cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#cooling-set-point) in °C. + /// + [JsonPropertyName("min_cooling_set_point_celsius")] + public float? MinCoolingSetPointCelsius { get; init; } + + /// + /// Minimum [cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#cooling-set-point) in °F. + /// + [JsonPropertyName("min_cooling_set_point_fahrenheit")] + public float? MinCoolingSetPointFahrenheit { get; init; } + + /// + /// Minimum [temperature difference](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#minimum-heating-cooling-temperature-delta) in °C between the cooling and heating set points when in heat-cool (auto) mode. + /// + [JsonPropertyName("min_heating_cooling_delta_celsius")] + public float? MinHeatingCoolingDeltaCelsius { get; init; } + + /// + /// Minimum [temperature difference](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#minimum-heating-cooling-temperature-delta) in °F between the cooling and heating set points when in heat-cool (auto) mode. + /// + [JsonPropertyName("min_heating_cooling_delta_fahrenheit")] + public float? MinHeatingCoolingDeltaFahrenheit { get; init; } + + /// + /// Minimum [heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#heating-set-point) in °C. + /// + [JsonPropertyName("min_heating_set_point_celsius")] + public float? MinHeatingSetPointCelsius { get; init; } + + /// + /// Minimum [heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points#heating-set-point) in °F. + /// + [JsonPropertyName("min_heating_set_point_fahrenheit")] + public float? MinHeatingSetPointFahrenheit { get; init; } + + /// + /// Reported relative humidity, as a value between 0 and 1, inclusive. + /// + [JsonPropertyName("relative_humidity")] + public float? RelativeHumidity { get; init; } + + /// + /// Reported temperature in °C. + /// + [JsonPropertyName("temperature_celsius")] + public float? TemperatureCelsius { get; init; } + + /// + /// Reported temperature in °F. + /// + [JsonPropertyName("temperature_fahrenheit")] + public float? TemperatureFahrenheit { get; init; } + + /// + /// Current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. + /// + [JsonPropertyName("temperature_threshold")] + public DevicePropertiesTemperatureThreshold? TemperatureThreshold { get; init; } + + /// + /// Precision of the thermostat's period in minutes. For example, if the thermostat supports 15-minute periods, this value is 15. All values are relative to the top of the hour, so for 15 minutes, the periods would be 0, 15, 30, and 45 minutes past the hour. + /// + [JsonPropertyName("thermostat_daily_program_period_precision_minutes")] + public float? ThermostatDailyProgramPeriodPrecisionMinutes { get; init; } + + /// + /// Configured [daily programs](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-programs) for the thermostat. + /// + [JsonPropertyName("thermostat_daily_programs")] + public List? ThermostatDailyPrograms { get; init; } + + /// + /// Current [weekly program](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-programs) for the thermostat. + /// + [JsonPropertyName("thermostat_weekly_program")] + public DevicePropertiesThermostatWeeklyProgram? ThermostatWeeklyProgram { get; init; } + } + + public sealed record DevicePropertiesAccessoryKeypad + { + /// + /// Keypad battery properties. + /// + [JsonPropertyName("battery")] + public DevicePropertiesAccessoryKeypadBattery? Battery { get; init; } + + /// + /// Indicates if an accessory keypad is connected to the device. + /// + [JsonPropertyName("is_connected")] + public bool IsConnected { get; init; } = default!; + } + + public sealed record DevicePropertiesAccessoryKeypadBattery + { + [JsonPropertyName("level")] + public float Level { get; init; } = default!; + } + + public sealed record DevicePropertiesAppearance + { + /// + /// Name of the device as seen from the provider API and application, not settable through Seam. + /// + [JsonPropertyName("name")] + public string Name { get; init; } = default!; + } + + public sealed record DevicePropertiesBattery + { + /// + /// Represents the current status of the battery charge level. Values are `critical`, which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; `low`, which signifies that the battery is under the preferred threshold and should be charged soon; `good`, which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and `full`, which represents a battery that is fully charged, providing the maximum duration of usage. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum StatusEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "critical")] + Critical = 1, + + [EnumMember(Value = "low")] + Low = 2, + + [EnumMember(Value = "good")] + Good = 3, + + [EnumMember(Value = "full")] + Full = 4, + } + + /// + /// Battery charge level as a value between 0 and 1, inclusive. + /// + [JsonPropertyName("level")] + public float Level { get; init; } = default!; + + /// + /// Represents the current status of the battery charge level. Values are `critical`, which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; `low`, which signifies that the battery is under the preferred threshold and should be charged soon; `good`, which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and `full`, which represents a battery that is fully charged, providing the maximum duration of usage. + /// + [JsonPropertyName("status")] + public DevicePropertiesBattery.StatusEnum Status { get; init; } = default!; + } + + public sealed record DevicePropertiesModel + { + [Obsolete("use device.properties.model.can_connect_accessory_keypad")] + [JsonPropertyName("accessory_keypad_supported")] + public bool? AccessoryKeypadSupported { get; init; } + + /// + /// Indicates whether the device can connect a accessory keypad. + /// + [JsonPropertyName("can_connect_accessory_keypad")] + public bool? CanConnectAccessoryKeypad { get; init; } + + /// + /// Display name of the device model. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Indicates whether the device has a built in accessory keypad. + /// + [JsonPropertyName("has_built_in_keypad")] + public bool? HasBuiltInKeypad { get; init; } + + /// + /// Display name that corresponds to the manufacturer-specific terminology for the device. + /// + [JsonPropertyName("manufacturer_display_name")] + public string ManufacturerDisplayName { get; init; } = default!; + + [Obsolete("use device.can_program_offline_access_codes.")] + [JsonPropertyName("offline_access_codes_supported")] + public bool? OfflineAccessCodesSupported { get; init; } + + [Obsolete("use device.can_program_online_access_codes.")] + [JsonPropertyName("online_access_codes_supported")] + public bool? OnlineAccessCodesSupported { get; init; } + } + + public sealed record DevicePropertiesAssaAbloyCredentialServiceMetadata + { + /// + /// Endpoints associated with the phone. + /// + [JsonPropertyName("endpoints")] + public List? Endpoints { get; init; } + + /// + /// Indicates whether the credential service has active endpoints associated with the phone. + /// + [JsonPropertyName("has_active_endpoint")] + public bool? HasActiveEndpoint { get; init; } + } + + public sealed record DevicePropertiesAssaAbloyCredentialServiceMetadataEndpoints + { + /// + /// ID of the associated endpoint. + /// + [JsonPropertyName("endpoint_id")] + public string? EndpointId { get; init; } + + /// + /// Indicated whether the endpoint is active. + /// + [JsonPropertyName("is_active")] + public bool? IsActive { get; init; } + } + + public sealed record DevicePropertiesSaltoSpaceCredentialServiceMetadata + { + /// + /// Indicates whether the credential service has an active associated phone. + /// + [JsonPropertyName("has_active_phone")] + public bool? HasActivePhone { get; init; } + } + + public sealed record DevicePropertiesAkilesMetadata + { + /// + /// Group ID to which to add users for an Akiles device. + /// + [JsonPropertyName("member_group_id")] + public string? MemberGroupId { get; init; } + + /// + /// Gadget ID for an Akiles device. + /// + [JsonPropertyName("gadget_id")] + public string? GadgetId { get; init; } + + /// + /// Gadget name for an Akiles device. + /// + [JsonPropertyName("gadget_name")] + public string? GadgetName { get; init; } + + /// + /// Product name for an Akiles device. + /// + [JsonPropertyName("product_name")] + public string? ProductName { get; init; } + } + + public sealed record DevicePropertiesAqaraMetadata + { + /// + /// Device name for an Aqara device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Device ID (did) for an Aqara device. + /// + [JsonPropertyName("did")] + public string? Did { get; init; } + + /// + /// Firmware version for an Aqara device. + /// + [JsonPropertyName("firmware_version")] + public string? FirmwareVersion { get; init; } + + /// + /// Model identifier for an Aqara device. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + + /// + /// Model type for an Aqara device. + /// + [JsonPropertyName("model_type")] + public float? ModelType { get; init; } + + /// + /// Parent gateway device ID for an Aqara device. + /// + [JsonPropertyName("parent_did")] + public string? ParentDid { get; init; } + + /// + /// Position (room) ID for an Aqara device. + /// + [JsonPropertyName("position_id")] + public string? PositionId { get; init; } + + /// + /// Time zone reported for an Aqara device (e.g. GMT-07:00). + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + } + + public sealed record DevicePropertiesAssaAbloyVostioMetadata + { + /// + /// Encoder name for an ASSA ABLOY Vostio system. + /// + [JsonPropertyName("encoder_name")] + public string? EncoderName { get; init; } + } + + public sealed record DevicePropertiesAugustMetadata + { + /// + /// Indicates whether an August device has a keypad. + /// + [JsonPropertyName("has_keypad")] + public bool? HasKeypad { get; init; } + + /// + /// House ID for an August device. + /// + [JsonPropertyName("house_id")] + public string? HouseId { get; init; } + + /// + /// House name for an August device. + /// + [JsonPropertyName("house_name")] + public string? HouseName { get; init; } + + /// + /// Keypad battery level for an August device. + /// + [JsonPropertyName("keypad_battery_level")] + public string? KeypadBatteryLevel { get; init; } + + /// + /// Lock ID for an August device. + /// + [JsonPropertyName("lock_id")] + public string? LockId { get; init; } + + /// + /// Lock name for an August device. + /// + [JsonPropertyName("lock_name")] + public string? LockName { get; init; } + + /// + /// Model for an August device. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + } + + public sealed record DevicePropertiesAvigilonAltaMetadata + { + /// + /// Entry name for an Avigilon Alta system. + /// + [JsonPropertyName("entry_name")] + public string? EntryName { get; init; } + + /// + /// Total count of entry relays for an Avigilon Alta system. + /// + [JsonPropertyName("entry_relays_total_count")] + public float? EntryRelaysTotalCount { get; init; } + + /// + /// Organization name for an Avigilon Alta system. + /// + [JsonPropertyName("org_name")] + public string? OrgName { get; init; } + + /// + /// Site ID for an Avigilon Alta system. + /// + [JsonPropertyName("site_id")] + public float? SiteId { get; init; } + + /// + /// Site name for an Avigilon Alta system. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + + /// + /// Zone ID for an Avigilon Alta system. + /// + [JsonPropertyName("zone_id")] + public float? ZoneId { get; init; } + + /// + /// Zone name for an Avigilon Alta system. + /// + [JsonPropertyName("zone_name")] + public string? ZoneName { get; init; } + } + + public sealed record DevicePropertiesBrivoMetadata + { + /// + /// Indicates whether the Brivo access point has activation (remote unlock) enabled. + /// + [JsonPropertyName("activation_enabled")] + public bool? ActivationEnabled { get; init; } + + /// + /// Device name for a Brivo device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + } + + public sealed record DevicePropertiesControlbywebMetadata + { + /// + /// Device ID for a ControlByWeb device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a ControlByWeb device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Relay name for a ControlByWeb device. + /// + [JsonPropertyName("relay_name")] + public string? RelayName { get; init; } + } + + public sealed record DevicePropertiesDormakabaOracodeMetadata + { + /// + /// Device ID for a dormakaba Oracode device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Door ID for a dormakaba Oracode device. + /// + [JsonPropertyName("door_id")] + public float? DoorId { get; init; } + + /// + /// Indicates whether a door is wireless for a dormakaba Oracode device. + /// + [JsonPropertyName("door_is_wireless")] + public bool? DoorIsWireless { get; init; } + + /// + /// Door name for a dormakaba Oracode device. + /// + [JsonPropertyName("door_name")] + public string? DoorName { get; init; } + + /// + /// IANA time zone for a dormakaba Oracode device. + /// + [JsonPropertyName("iana_timezone")] + public string? IanaTimezone { get; init; } + + /// + /// Predefined time slots for a dormakaba Oracode device. + /// + [JsonPropertyName("predefined_time_slots")] + public List? PredefinedTimeSlots { get; init; } + + /// + /// Site ID for a dormakaba Oracode device. + /// + [Obsolete("Previously marked as \"@DEPRECATED.\"")] + [JsonPropertyName("site_id")] + public float? SiteId { get; init; } + + /// + /// Site name for a dormakaba Oracode device. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + } + + public sealed record DevicePropertiesDormakabaOracodeMetadataPredefinedTimeSlots + { + /// + /// Check in time for a time slot for a dormakaba Oracode device. + /// + [JsonPropertyName("check_in_time")] + public string? CheckInTime { get; init; } + + /// + /// Checkout time for a time slot for a dormakaba Oracode device. + /// + [JsonPropertyName("check_out_time")] + public string? CheckOutTime { get; init; } + + /// + /// ID of a user level for a dormakaba Oracode device. + /// + [JsonPropertyName("dormakaba_oracode_user_level_id")] + public string? DormakabaOracodeUserLevelId { get; init; } + + /// + /// Prefix for a user level for a dormakaba Oracode device. + /// + [JsonPropertyName("dormakaba_oracode_user_level_prefix")] + public float? DormakabaOracodeUserLevelPrefix { get; init; } + + /// + /// Indicates whether a time slot for a dormakaba Oracode device is a 24-hour time slot. + /// + [JsonPropertyName("is_24_hour")] + public bool? Is_24Hour { get; init; } + + /// + /// Indicates whether a time slot for a dormakaba Oracode device is in biweekly mode. + /// + [JsonPropertyName("is_biweekly_mode")] + public bool? IsBiweeklyMode { get; init; } + + /// + /// Indicates whether a time slot for a dormakaba Oracode device is a master time slot. + /// + [JsonPropertyName("is_master")] + public bool? IsMaster { get; init; } + + /// + /// Indicates whether a time slot for a dormakaba Oracode device is a one-shot time slot. + /// + [JsonPropertyName("is_one_shot")] + public bool? IsOneShot { get; init; } + + /// + /// Name of a time slot for a dormakaba Oracode device. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Prefix for a time slot for a dormakaba Oracode device. + /// + [JsonPropertyName("prefix")] + public float? Prefix { get; init; } + } + + public sealed record DevicePropertiesEcobeeMetadata + { + /// + /// Device name for an ecobee device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Device ID for an ecobee device. + /// + [JsonPropertyName("ecobee_device_id")] + public string? EcobeeDeviceId { get; init; } + } + + public sealed record DevicePropertiesFourSuitesMetadata + { + /// + /// Device ID for a 4SUITES device. + /// + [JsonPropertyName("device_id")] + public float? DeviceId { get; init; } + + /// + /// Device name for a 4SUITES device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Reclose delay, in seconds, for a 4SUITES device. + /// + [JsonPropertyName("reclose_delay_in_seconds")] + public float? RecloseDelayInSeconds { get; init; } + } + + public sealed record DevicePropertiesGenieMetadata + { + /// + /// Lock name for a Genie device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Door name for a Genie device. + /// + [JsonPropertyName("door_name")] + public string? DoorName { get; init; } + } + + public sealed record DevicePropertiesHoneywellResideoMetadata + { + /// + /// Device name for a Honeywell Resideo device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Device ID for a Honeywell Resideo device. + /// + [JsonPropertyName("honeywell_resideo_device_id")] + public string? HoneywellResideoDeviceId { get; init; } + } + + public sealed record DevicePropertiesIglooMetadata + { + /// + /// Bridge ID for an igloo device. + /// + [JsonPropertyName("bridge_id")] + public string? BridgeId { get; init; } + + /// + /// Device ID for an igloo device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Model for an igloo device. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + } + + public sealed record DevicePropertiesIgloohomeMetadata + { + /// + /// Bridge ID for an igloohome device. + /// + [JsonPropertyName("bridge_id")] + public string? BridgeId { get; init; } + + /// + /// Bridge name for an igloohome device. + /// + [JsonPropertyName("bridge_name")] + public string? BridgeName { get; init; } + + /// + /// Device ID for an igloohome device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for an igloohome device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Indicates whether a keypad is linked to a bridge for an igloohome device. + /// + [JsonPropertyName("is_accessory_keypad_linked_to_bridge")] + public bool? IsAccessoryKeypadLinkedToBridge { get; init; } + + /// + /// Keypad ID for an igloohome device. + /// + [JsonPropertyName("keypad_id")] + public string? KeypadId { get; init; } + } + + public sealed record DevicePropertiesKeynestMetadata + { + /// + /// Address for a KeyNest device. + /// + [JsonPropertyName("address")] + public string? Address { get; init; } + + /// + /// Current or last store ID for a KeyNest device. + /// + [JsonPropertyName("current_or_last_store_id")] + public float? CurrentOrLastStoreId { get; init; } + + /// + /// Current status for a KeyNest device. + /// + [JsonPropertyName("current_status")] + public string? CurrentStatus { get; init; } + + /// + /// Current user company for a KeyNest device. + /// + [JsonPropertyName("current_user_company")] + public string? CurrentUserCompany { get; init; } + + /// + /// Current user email for a KeyNest device. + /// + [JsonPropertyName("current_user_email")] + public string? CurrentUserEmail { get; init; } + + /// + /// Current user name for a KeyNest device. + /// + [JsonPropertyName("current_user_name")] + public string? CurrentUserName { get; init; } + + /// + /// Current user phone number for a KeyNest device. + /// + [JsonPropertyName("current_user_phone_number")] + public string? CurrentUserPhoneNumber { get; init; } + + /// + /// Default office ID for a KeyNest device. + /// + [JsonPropertyName("default_office_id")] + public float? DefaultOfficeId { get; init; } + + /// + /// Device name for a KeyNest device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Fob ID for a KeyNest device. + /// + [JsonPropertyName("fob_id")] + public float? FobId { get; init; } + + /// + /// Handover method for a KeyNest device. + /// + [JsonPropertyName("handover_method")] + public string? HandoverMethod { get; init; } + + /// + /// Whether the KeyNest device has a photo. + /// + [JsonPropertyName("has_photo")] + public bool? HasPhoto { get; init; } + + /// + /// Whether the key is in a locker that does not support the access codes API. + /// + [JsonPropertyName("is_quadient_locker")] + public bool? IsQuadientLocker { get; init; } + + /// + /// Key ID for a KeyNest device. + /// + [JsonPropertyName("key_id")] + public string? KeyId { get; init; } + + /// + /// Key notes for a KeyNest device. + /// + [JsonPropertyName("key_notes")] + public string? KeyNotes { get; init; } + + /// + /// KeyNest app user for a KeyNest device. + /// + [JsonPropertyName("keynest_app_user")] + public string? KeynestAppUser { get; init; } + + /// + /// Last movement timestamp for a KeyNest device. + /// + [JsonPropertyName("last_movement")] + public string? LastMovement { get; init; } + + /// + /// Property ID for a KeyNest device. + /// + [JsonPropertyName("property_id")] + public string? PropertyId { get; init; } + + /// + /// Property postcode for a KeyNest device. + /// + [JsonPropertyName("property_postcode")] + public string? PropertyPostcode { get; init; } + + /// + /// Status type for a KeyNest device. + /// + [JsonPropertyName("status_type")] + public string? StatusType { get; init; } + + /// + /// Subscription plan for a KeyNest device. + /// + [JsonPropertyName("subscription_plan")] + public string? SubscriptionPlan { get; init; } + } + + public sealed record DevicePropertiesKisiMetadata + { + /// + /// Description for a Kisi device. + /// + [JsonPropertyName("description")] + public string? Description { get; init; } + + /// + /// Lock ID for a Kisi device. + /// + [JsonPropertyName("lock_id")] + public float? LockId { get; init; } + + /// + /// Lock name for a Kisi device. + /// + [JsonPropertyName("lock_name")] + public string? LockName { get; init; } + + /// + /// Place name for a Kisi device. + /// + [JsonPropertyName("place_name")] + public string? PlaceName { get; init; } + } + + public sealed record DevicePropertiesKorelockMetadata + { + /// + /// Device ID for a Korelock device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Korelock device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Firmware version for a Korelock device. + /// + [JsonPropertyName("firmware_version")] + public string? FirmwareVersion { get; init; } + + /// + /// Location ID for a Korelock device. Required for timebound access codes. + /// + [JsonPropertyName("location_id")] + public string? LocationId { get; init; } + + /// + /// Model code for a Korelock device. + /// + [JsonPropertyName("model_code")] + public string? ModelCode { get; init; } + + /// + /// Serial number for a Korelock device. + /// + [JsonPropertyName("serial_number")] + public string? SerialNumber { get; init; } + + /// + /// WiFi signal strength (0-1) for a Korelock device. + /// + [JsonPropertyName("wifi_signal_strength")] + public float? WifiSignalStrength { get; init; } + } + + public sealed record DevicePropertiesKwiksetMetadata + { + /// + /// Device ID for a Kwikset device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Kwikset device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Model number for a Kwikset device. + /// + [JsonPropertyName("model_number")] + public string? ModelNumber { get; init; } + } + + public sealed record DevicePropertiesLocklyMetadata + { + /// + /// Device ID for a Lockly device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Lockly device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Model for a Lockly device. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + } + + public sealed record DevicePropertiesMinutMetadata + { + /// + /// Device ID for a Minut device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Minut device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Latest sensor values for a Minut device. + /// + [JsonPropertyName("latest_sensor_values")] + public DevicePropertiesMinutMetadataLatestSensorValues? LatestSensorValues { get; init; } + } + + public sealed record DevicePropertiesMinutMetadataLatestSensorValues + { + /// + /// Latest accelerometer Z-axis reading for a Minut device. + /// + [JsonPropertyName("accelerometer_z")] + public DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ? AccelerometerZ { get; init; } + + /// + /// Latest humidity reading for a Minut device. + /// + [JsonPropertyName("humidity")] + public DevicePropertiesMinutMetadataLatestSensorValuesHumidity? Humidity { get; init; } + + /// + /// Latest pressure reading for a Minut device. + /// + [JsonPropertyName("pressure")] + public DevicePropertiesMinutMetadataLatestSensorValuesPressure? Pressure { get; init; } + + /// + /// Latest sound reading for a Minut device. + /// + [JsonPropertyName("sound")] + public DevicePropertiesMinutMetadataLatestSensorValuesSound? Sound { get; init; } + + /// + /// Latest temperature reading for a Minut device. + /// + [JsonPropertyName("temperature")] + public DevicePropertiesMinutMetadataLatestSensorValuesTemperature? Temperature { get; init; } + } + + public sealed record DevicePropertiesMinutMetadataLatestSensorValuesAccelerometerZ + { + /// + /// Time of latest accelerometer Z-axis reading for a Minut device. + /// + [JsonPropertyName("time")] + public string? Time { get; init; } + + /// + /// Value of latest accelerometer Z-axis reading for a Minut device. + /// + [JsonPropertyName("value")] + public float? Value { get; init; } + } + + public sealed record DevicePropertiesMinutMetadataLatestSensorValuesHumidity + { + /// + /// Time of latest humidity reading for a Minut device. + /// + [JsonPropertyName("time")] + public string? Time { get; init; } + + /// + /// Value of latest humidity reading for a Minut device. + /// + [JsonPropertyName("value")] + public float? Value { get; init; } + } + + public sealed record DevicePropertiesMinutMetadataLatestSensorValuesPressure + { + /// + /// Time of latest pressure reading for a Minut device. + /// + [JsonPropertyName("time")] + public string? Time { get; init; } + + /// + /// Value of latest pressure reading for a Minut device. + /// + [JsonPropertyName("value")] + public float? Value { get; init; } + } + + public sealed record DevicePropertiesMinutMetadataLatestSensorValuesSound + { + /// + /// Time of latest sound reading for a Minut device. + /// + [JsonPropertyName("time")] + public string? Time { get; init; } + + /// + /// Value of latest sound reading for a Minut device. + /// + [JsonPropertyName("value")] + public float? Value { get; init; } + } + + public sealed record DevicePropertiesMinutMetadataLatestSensorValuesTemperature + { + /// + /// Time of latest temperature reading for a Minut device. + /// + [JsonPropertyName("time")] + public string? Time { get; init; } + + /// + /// Value of latest temperature reading for a Minut device. + /// + [JsonPropertyName("value")] + public float? Value { get; init; } + } + + public sealed record DevicePropertiesNestMetadata + { + /// + /// Custom device name for a Google Nest device. The device owner sets this value. + /// + [JsonPropertyName("device_custom_name")] + public string? DeviceCustomName { get; init; } + + /// + /// Device name for a Google Nest device. Google sets this value. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Display name for a Google Nest device. + /// + [JsonPropertyName("display_name")] + public string? DisplayName { get; init; } + + /// + /// Device ID for a Google Nest device. + /// + [JsonPropertyName("nest_device_id")] + public string? NestDeviceId { get; init; } + + /// + /// ID of the Google Nest structure containing the device. + /// + [JsonPropertyName("nest_structure_id")] + public string? NestStructureId { get; init; } + + /// + /// Name of the Google Nest structure containing the device. The device owner sets this value. + /// + [JsonPropertyName("structure_name")] + public string? StructureName { get; init; } + } + + public sealed record DevicePropertiesNoiseawareMetadata + { + /// + /// Device model for a NoiseAware device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceModelEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "indoor")] + Indoor = 1, + + [EnumMember(Value = "outdoor")] + Outdoor = 2, + } + + /// + /// Device ID for a NoiseAware device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device model for a NoiseAware device. + /// + [JsonPropertyName("device_model")] + public DevicePropertiesNoiseawareMetadata.DeviceModelEnum? DeviceModel { get; init; } + + /// + /// Device name for a NoiseAware device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Noise level, in decibels, for a NoiseAware device. + /// + [JsonPropertyName("noise_level_decibel")] + public float? NoiseLevelDecibel { get; init; } + + /// + /// Noise level, expressed as a Noise Risk Score (NRS), for a NoiseAware device. + /// + [JsonPropertyName("noise_level_nrs")] + public float? NoiseLevelNrs { get; init; } + } + + public sealed record DevicePropertiesNukiMetadata + { + /// + /// Device ID for a Nuki device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Nuki device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Indicates whether keypad 2 is paired for a Nuki device. + /// + [JsonPropertyName("keypad_2_paired")] + public bool? Keypad_2Paired { get; init; } + + /// + /// Indicates whether the keypad battery is in a critical state for a Nuki device. + /// + [JsonPropertyName("keypad_battery_critical")] + public bool? KeypadBatteryCritical { get; init; } + + /// + /// Indicates whether the keypad is paired for a Nuki device. + /// + [JsonPropertyName("keypad_paired")] + public bool? KeypadPaired { get; init; } + } + + public sealed record DevicePropertiesOmnitecMetadata + { + /// + /// Whether the Omnitec lock has a connected gateway for remote operations. + /// + [JsonPropertyName("has_gateway")] + public bool? HasGateway { get; init; } + + /// + /// Operator-assigned alias for an Omnitec device. + /// + [JsonPropertyName("lock_alias")] + public string? LockAlias { get; init; } + + /// + /// Lock ID for an Omnitec device. + /// + [JsonPropertyName("lock_id")] + public float? LockId { get; init; } + + /// + /// Bluetooth MAC address for an Omnitec device. + /// + [JsonPropertyName("lock_mac")] + public string? LockMac { get; init; } + + /// + /// Lock name for an Omnitec device. + /// + [JsonPropertyName("lock_name")] + public string? LockName { get; init; } + + /// + /// IANA time zone for the Omnitec device, used to schedule time-bound access codes at the correct local time (accounting for DST). + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + + /// + /// Static UTC offset of the Omnitec lock in milliseconds. Does not account for DST. + /// + [JsonPropertyName("timezone_raw_offset_ms")] + public float? TimezoneRawOffsetMs { get; init; } + } + + public sealed record DevicePropertiesRingMetadata + { + /// + /// Device ID for a Ring device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Ring device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + } + + public sealed record DevicePropertiesSaltoKsMetadata + { + /// + /// Battery level for a Salto KS device. + /// + [JsonPropertyName("battery_level")] + public string? BatteryLevel { get; init; } + + /// + /// Customer reference for a Salto KS device. + /// + [JsonPropertyName("customer_reference")] + public string? CustomerReference { get; init; } + + /// + /// Indicates whether the site has a Salto KS subscription that supports custom PINs. + /// + [JsonPropertyName("has_custom_pin_subscription")] + public bool? HasCustomPinSubscription { get; init; } + + /// + /// Lock ID for a Salto KS device. + /// + [JsonPropertyName("lock_id")] + public string? LockId { get; init; } + + /// + /// Lock type for a Salto KS device. + /// + [JsonPropertyName("lock_type")] + public string? LockType { get; init; } + + /// + /// Locked state for a Salto KS device. + /// + [JsonPropertyName("locked_state")] + public string? LockedState { get; init; } + + /// + /// Model for a Salto KS device. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + + /// + /// Site ID for the Salto KS site to which the device belongs. + /// + [JsonPropertyName("site_id")] + public string? SiteId { get; init; } + + /// + /// Site name for the Salto KS site to which the device belongs. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + } + + public sealed record DevicePropertiesSaltoMetadata + { + /// + /// Battery level for a Salto device. + /// + [JsonPropertyName("battery_level")] + public string? BatteryLevel { get; init; } + + /// + /// Customer reference for a Salto device. + /// + [JsonPropertyName("customer_reference")] + public string? CustomerReference { get; init; } + + /// + /// Lock ID for a Salto device. + /// + [JsonPropertyName("lock_id")] + public string? LockId { get; init; } + + /// + /// Lock type for a Salto device. + /// + [JsonPropertyName("lock_type")] + public string? LockType { get; init; } + + /// + /// Locked state for a Salto device. + /// + [JsonPropertyName("locked_state")] + public string? LockedState { get; init; } + + /// + /// Model for a Salto device. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + + /// + /// Site ID for the Salto KS site to which the device belongs. + /// + [JsonPropertyName("site_id")] + public string? SiteId { get; init; } + + /// + /// Site name for the Salto KS site to which the device belongs. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + } + + public sealed record DevicePropertiesSchlageMetadata + { + /// + /// Device ID for a Schlage device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Schlage device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Model for a Schlage device. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + } + + public sealed record DevicePropertiesSeamBridgeMetadata + { + /// + /// Unlock method for Seam Bridge. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum UnlockMethodEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "bridge")] + Bridge = 1, + + [EnumMember(Value = "doorking")] + Doorking = 2, + } + + /// + /// Device number for Seam Bridge. + /// + [JsonPropertyName("device_num")] + public float? DeviceNum { get; init; } + + /// + /// Name for Seam Bridge. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Unlock method for Seam Bridge. + /// + [JsonPropertyName("unlock_method")] + public DevicePropertiesSeamBridgeMetadata.UnlockMethodEnum? UnlockMethod { get; init; } + } + + public sealed record DevicePropertiesSensiMetadata + { + /// + /// Device ID for a Sensi device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Sensi device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Set to true when the device does not support the /dual-setpoints API endpoint. + /// + [JsonPropertyName("dual_setpoints_not_supported")] + public bool? DualSetpointsNotSupported { get; init; } + + /// + /// Product type for a Sensi device. + /// + [JsonPropertyName("product_type")] + public string? ProductType { get; init; } + } + + public sealed record DevicePropertiesSmartthingsMetadata + { + /// + /// Device ID for a SmartThings device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a SmartThings device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Location ID for a SmartThings device. + /// + [JsonPropertyName("location_id")] + public string? LocationId { get; init; } + + /// + /// Model for a SmartThings device. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + } + + public sealed record DevicePropertiesTadoMetadata + { + /// + /// Device type for a tado° device. + /// + [JsonPropertyName("device_type")] + public string? DeviceType { get; init; } + + /// + /// Serial number for a tado° device. + /// + [JsonPropertyName("serial_no")] + public string? SerialNo { get; init; } + } + + public sealed record DevicePropertiesTedeeMetadata + { + /// + /// Bridge ID for a Tedee device. + /// + [JsonPropertyName("bridge_id")] + public float? BridgeId { get; init; } + + /// + /// Bridge name for a Tedee device. + /// + [JsonPropertyName("bridge_name")] + public string? BridgeName { get; init; } + + /// + /// Device ID for a Tedee device. + /// + [JsonPropertyName("device_id")] + public float? DeviceId { get; init; } + + /// + /// Device model for a Tedee device. + /// + [JsonPropertyName("device_model")] + public string? DeviceModel { get; init; } + + /// + /// Device name for a Tedee device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Keypad ID for a Tedee device. + /// + [JsonPropertyName("keypad_id")] + public float? KeypadId { get; init; } + + /// + /// Serial number for a Tedee device. + /// + [JsonPropertyName("serial_number")] + public string? SerialNumber { get; init; } + } + + public sealed record DevicePropertiesTtlockMetadata + { + /// + /// Feature value for a TTLock device. + /// + [JsonPropertyName("feature_value")] + public string? FeatureValue { get; init; } + + /// + /// Features for a TTLock device. + /// + [JsonPropertyName("features")] + public DevicePropertiesTtlockMetadataFeatures? Features { get; init; } + + /// + /// Indicates whether a TTLock device has a gateway. + /// + [JsonPropertyName("has_gateway")] + public bool? HasGateway { get; init; } + + /// + /// Lock alias for a TTLock device. + /// + [JsonPropertyName("lock_alias")] + public string? LockAlias { get; init; } + + /// + /// Lock ID for a TTLock device. + /// + [JsonPropertyName("lock_id")] + public float? LockId { get; init; } + + /// + /// Lock-side timezone offset in milliseconds east of UTC, as configured in the TTLock app. Source of truth for the lock's wall-clock interpretation of access code start/end times — a misconfigured value here is the typical cause of customer "codes offset by N hours" reports. Diagnostic only; Seam does not convert times based on this value. + /// + [JsonPropertyName("timezone_raw_offset_ms")] + public float? TimezoneRawOffsetMs { get; init; } + + /// + /// Wireless keypads for a TTLock device. + /// + [JsonPropertyName("wireless_keypads")] + public List? WirelessKeypads { get; init; } + } + + public sealed record DevicePropertiesTtlockMetadataFeatures + { + /// + /// Indicates whether a TTLock device supports auto-lock time configuration. + /// + [JsonPropertyName("auto_lock_time_config")] + public bool? AutoLockTimeConfig { get; init; } + + /// + /// Indicates whether a TTLock device supports an incomplete keyboard passcode. + /// + [JsonPropertyName("incomplete_keyboard_passcode")] + public bool? IncompleteKeyboardPasscode { get; init; } + + /// + /// Indicates whether a TTLock device supports the lock command. + /// + [JsonPropertyName("lock_command")] + public bool? LockCommand { get; init; } + + /// + /// Indicates whether a TTLock device supports a passcode. + /// + [JsonPropertyName("passcode")] + public bool? Passcode { get; init; } + + /// + /// Indicates whether a TTLock device supports passcode management. + /// + [JsonPropertyName("passcode_management")] + public bool? PasscodeManagement { get; init; } + + /// + /// Indicates whether a TTLock device supports unlock via gateway. + /// + [JsonPropertyName("unlock_via_gateway")] + public bool? UnlockViaGateway { get; init; } + + /// + /// Indicates whether a TTLock device supports Wi-Fi. + /// + [JsonPropertyName("wifi")] + public bool? Wifi { get; init; } + } + + public sealed record DevicePropertiesTtlockMetadataWirelessKeypads + { + /// + /// ID for a wireless keypad for a TTLock device. + /// + [JsonPropertyName("wireless_keypad_id")] + public float? WirelessKeypadId { get; init; } + + /// + /// Name for a wireless keypad for a TTLock device. + /// + [JsonPropertyName("wireless_keypad_name")] + public string? WirelessKeypadName { get; init; } + } + + public sealed record DevicePropertiesTwoNMetadata + { + /// + /// Device ID for a 2N device. + /// + [JsonPropertyName("device_id")] + public float? DeviceId { get; init; } + + /// + /// Device name for a 2N device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + } + + public sealed record DevicePropertiesUltraloqMetadata + { + /// + /// Device ID for an Ultraloq device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for an Ultraloq device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Device type for an Ultraloq device. + /// + [JsonPropertyName("device_type")] + public string? DeviceType { get; init; } + + /// + /// IANA timezone for the Ultraloq device. + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + } + + public sealed record DevicePropertiesVisionlineMetadata + { + /// + /// Encoder ID for an ASSA ABLOY Visionline system. + /// + [JsonPropertyName("encoder_id")] + public string? EncoderId { get; init; } + } + + public sealed record DevicePropertiesWyzeMetadata + { + /// + /// Device ID for a Wyze device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device information model for a Wyze device. + /// + [JsonPropertyName("device_info_model")] + public string? DeviceInfoModel { get; init; } + + /// + /// Device name for a Wyze device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Keypad UUID for a Wyze device. + /// + [JsonPropertyName("keypad_uuid")] + public string? KeypadUuid { get; init; } + + /// + /// Locker status (hardlock) for a Wyze device. + /// + [JsonPropertyName("locker_status_hardlock")] + public float? LockerStatusHardlock { get; init; } + + /// + /// Product model for a Wyze device. + /// + [JsonPropertyName("product_model")] + public string? ProductModel { get; init; } + + /// + /// Product name for a Wyze device. + /// + [JsonPropertyName("product_name")] + public string? ProductName { get; init; } + + /// + /// Product type for a Wyze device. + /// + [JsonPropertyName("product_type")] + public string? ProductType { get; init; } + } + + public sealed record DevicePropertiesYacanMetadata + { + /// + /// Device ID for a Yacan device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Yacan device. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Device type for a Yacan device. + /// + [JsonPropertyName("device_type")] + public string? DeviceType { get; init; } + + /// + /// Serial number for a Yacan device. + /// + [JsonPropertyName("serial_number")] + public string? SerialNumber { get; init; } + } + + public sealed record DevicePropertiesCodeConstraints + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ConstraintTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "no_zeros")] + NoZeros = 1, + + [EnumMember(Value = "cannot_start_with_12")] + CannotStartWith_12 = 2, + + [EnumMember(Value = "no_triple_consecutive_ints")] + NoTripleConsecutiveInts = 3, + + [EnumMember(Value = "cannot_specify_pin_code")] + CannotSpecifyPinCode = 4, + + [EnumMember(Value = "pin_code_matches_existing_set")] + PinCodeMatchesExistingSet = 5, + + [EnumMember(Value = "start_date_in_future")] + StartDateInFuture = 6, + + [EnumMember(Value = "no_ascending_or_descending_sequence")] + NoAscendingOrDescendingSequence = 7, + + [EnumMember(Value = "at_least_three_unique_digits")] + AtLeastThreeUniqueDigits = 8, + + [EnumMember(Value = "cannot_contain_089")] + CannotContain_089 = 9, + + [EnumMember(Value = "cannot_contain_0789")] + CannotContain_0789 = 10, + + [EnumMember(Value = "unique_first_four_digits")] + UniqueFirstFourDigits = 11, + + [EnumMember(Value = "no_all_same_digits")] + NoAllSameDigits = 12, + + [EnumMember(Value = "name_length")] + NameLength = 13, + + [EnumMember(Value = "name_must_be_unique")] + NameMustBeUnique = 14, + } + + [JsonPropertyName("constraint_type")] + public DevicePropertiesCodeConstraints.ConstraintTypeEnum ConstraintType { get; init; } = + default!; + + /// + /// Maximum name length constraint for access codes. + /// + [JsonPropertyName("max_length")] + public float? MaxLength { get; init; } + + /// + /// Minimum name length constraint for access codes. + /// + [JsonPropertyName("min_length")] + public float? MinLength { get; init; } + } + + public sealed record DevicePropertiesKeypadBattery + { + /// + /// Keypad battery charge level. + /// + [JsonPropertyName("level")] + public float Level { get; init; } = default!; + } + + public sealed record DevicePropertiesOfflineTimeFrameOptions + { + /// + /// Label for this option. For a single-option device, the product name (for example, `algoPIN` or `SmartPIN`); for a multi-option device, a label that distinguishes it (for example, `Hourly` or `Fixed start times`). + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// iCalendar recurrence rule (RRULE) that the end date must fall on. Constrains which calendar dates are selectable, independent of the time-of-day rules. + /// + [JsonPropertyName("end_date_recurrence_rule")] + public string? EndDateRecurrenceRule { get; init; } + + /// + /// When `true`, the start and end must fall at the same time of day (the caller picks which). Mutually exclusive with `time_pairs`. + /// + [JsonPropertyName("matching_start_end_time")] + public bool? MatchingStartEndTime { get; init; } + + /// + /// Maximum duration this option covers, as an ISO 8601 duration (for example, `PT672H` or `P367D`). Omitted when there is no maximum. + /// + [JsonPropertyName("max_duration")] + public string? MaxDuration { get; init; } + + /// + /// Minimum duration this option covers, as an ISO 8601 duration (for example, `PT1H` or `P29D`). Omitted when there is no minimum. + /// + [JsonPropertyName("min_duration")] + public string? MinDuration { get; init; } + + /// + /// iCalendar recurrence rule (RRULE) that the start date must fall on (for example, `FREQ=MONTHLY;BYDAY=1MO,3MO`). Constrains which calendar dates are selectable, independent of the time-of-day rules. + /// + [JsonPropertyName("start_date_recurrence_rule")] + public string? StartDateRecurrenceRule { get; init; } + + /// + /// Fixed start/end time pairings the caller chooses from. Mutually exclusive with `matching_start_end_time`. + /// + [JsonPropertyName("time_pairs")] + public List? TimePairs { get; init; } + + /// + /// IANA time zone for interpreting `time_pairs` and the date recurrence rules. Present only when the option fixes times or dates. + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + } + + public sealed record DevicePropertiesOfflineTimeFrameOptionsTimePairs + { + /// + /// Label for the start/end time pairing. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// End time of day as a 24-hour `HH:MM` value, interpreted in the option's `time_zone`. An `end_time` earlier on the clock than `start_time` means the end falls on a later date. + /// + [JsonPropertyName("end_time")] + public string EndTime { get; init; } = default!; + + /// + /// Start time of day as a 24-hour `HH:MM` value, interpreted in the option's `time_zone`. + /// + [JsonPropertyName("start_time")] + public string StartTime { get; init; } = default!; + } + + public sealed record DevicePropertiesOnlineTimeFrameOptions + { + /// + /// Label for this option. For a single-option device, the product name (for example, `algoPIN` or `SmartPIN`); for a multi-option device, a label that distinguishes it (for example, `Hourly` or `Fixed start times`). + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// iCalendar recurrence rule (RRULE) that the end date must fall on. Constrains which calendar dates are selectable, independent of the time-of-day rules. + /// + [JsonPropertyName("end_date_recurrence_rule")] + public string? EndDateRecurrenceRule { get; init; } + + /// + /// When `true`, the start and end must fall at the same time of day (the caller picks which). Mutually exclusive with `time_pairs`. + /// + [JsonPropertyName("matching_start_end_time")] + public bool? MatchingStartEndTime { get; init; } + + /// + /// Maximum duration this option covers, as an ISO 8601 duration (for example, `PT672H` or `P367D`). Omitted when there is no maximum. + /// + [JsonPropertyName("max_duration")] + public string? MaxDuration { get; init; } + + /// + /// Minimum duration this option covers, as an ISO 8601 duration (for example, `PT1H` or `P29D`). Omitted when there is no minimum. + /// + [JsonPropertyName("min_duration")] + public string? MinDuration { get; init; } + + /// + /// iCalendar recurrence rule (RRULE) that the start date must fall on (for example, `FREQ=MONTHLY;BYDAY=1MO,3MO`). Constrains which calendar dates are selectable, independent of the time-of-day rules. + /// + [JsonPropertyName("start_date_recurrence_rule")] + public string? StartDateRecurrenceRule { get; init; } + + /// + /// Fixed start/end time pairings the caller chooses from. Mutually exclusive with `matching_start_end_time`. + /// + [JsonPropertyName("time_pairs")] + public List? TimePairs { get; init; } + + /// + /// IANA time zone for interpreting `time_pairs` and the date recurrence rules. Present only when the option fixes times or dates. + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + } + + public sealed record DevicePropertiesOnlineTimeFrameOptionsTimePairs + { + /// + /// Label for the start/end time pairing. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// End time of day as a 24-hour `HH:MM` value, interpreted in the option's `time_zone`. An `end_time` earlier on the clock than `start_time` means the end falls on a later date. + /// + [JsonPropertyName("end_time")] + public string EndTime { get; init; } = default!; + + /// + /// Start time of day as a 24-hour `HH:MM` value, interpreted in the option's `time_zone`. + /// + [JsonPropertyName("start_time")] + public string StartTime { get; init; } = default!; + } + + public sealed record DevicePropertiesActiveThermostatSchedule + { + /// + /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [JsonPropertyName("climate_preset_key")] + public string ClimatePresetKey { get; init; } = default!; + + /// + /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// ID of the desired [thermostat](https://docs.seam.co/capability-guides/thermostats) device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("ends_at")] + public string EndsAt { get; init; } = default!; + + /// + /// Errors associated with the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = + default!; + + /// + /// Indicates whether a person at the thermostat can change the thermostat's settings after the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts. + /// + [JsonPropertyName("is_override_allowed")] + public bool? IsOverrideAllowed { get; init; } + + /// + /// Number of minutes for which a person at the thermostat can change the thermostat's settings after the activation of the scheduled [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [JsonPropertyName("max_override_period_minutes")] + public int? MaxOverridePeriodMinutes { get; init; } + + /// + /// User-friendly name to identify the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string StartsAt { get; init; } = default!; + + /// + /// ID of the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [JsonPropertyName("thermostat_schedule_id")] + public string ThermostatScheduleId { get; init; } = default!; + + /// + /// ID of the workspace that contains the thermostat schedule. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record DevicePropertiesActiveThermostatScheduleErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record DevicePropertiesAvailableClimatePresets + { + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ClimatePresetModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "home")] + Home = 1, + + [EnumMember(Value = "away")] + Away = 2, + + [EnumMember(Value = "wake")] + Wake = 3, + + [EnumMember(Value = "sleep")] + Sleep = 4, + + [EnumMember(Value = "occupied")] + Occupied = 5, + + [EnumMember(Value = "unoccupied")] + Unoccupied = 6, + } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum FanModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum HvacModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "off")] + Off = 1, + + [EnumMember(Value = "heat")] + Heat = 2, + + [EnumMember(Value = "cool")] + Cool = 3, + + [EnumMember(Value = "heat_cool")] + HeatCool = 4, + + [EnumMember(Value = "eco")] + Eco = 5, + } + + /// + /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be deleted. + /// + [JsonPropertyName("can_delete")] + public bool CanDelete { get; init; } = default!; + + /// + /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be edited. + /// + [JsonPropertyName("can_edit")] + public bool CanEdit { get; init; } = default!; + + /// + /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be programmed in a thermostat daily program. + /// + [JsonPropertyName("can_use_with_thermostat_daily_programs")] + public bool CanUseWithThermostatDailyPrograms { get; init; } = default!; + + /// + /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("climate_preset_key")] + public string ClimatePresetKey { get; init; } = default!; + + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonPropertyName("climate_preset_mode")] + public DevicePropertiesAvailableClimatePresets.ClimatePresetModeEnum? ClimatePresetMode { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// Display name for the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Metadata specific to the Ecobee climate, if applicable. + /// + [JsonPropertyName("ecobee_metadata")] + public DevicePropertiesAvailableClimatePresetsEcobeeMetadata? EcobeeMetadata { get; init; } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonPropertyName("fan_mode_setting")] + public DevicePropertiesAvailableClimatePresets.FanModeSettingEnum? FanModeSetting { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonPropertyName("hvac_mode_setting")] + public DevicePropertiesAvailableClimatePresets.HvacModeSettingEnum? HvacModeSetting { get; init; } + + /// + /// Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] + [JsonPropertyName("manual_override_allowed")] + public bool ManualOverrideAllowed { get; init; } = default!; + + /// + /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record DevicePropertiesAvailableClimatePresetsEcobeeMetadata + { + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum OwnerEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "user")] + User = 1, + + [EnumMember(Value = "system")] + System = 2, + } + + /// + /// Reference to the Ecobee climate, if applicable. + /// + [JsonPropertyName("climate_ref")] + public string? ClimateRef { get; init; } + + /// + /// Indicates if the climate preset is optimized by Ecobee. + /// + [JsonPropertyName("is_optimized")] + public bool? IsOptimized { get; init; } + + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonPropertyName("owner")] + public DevicePropertiesAvailableClimatePresetsEcobeeMetadata.OwnerEnum? Owner { get; init; } + } + + public sealed record DevicePropertiesCurrentClimateSetting + { + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ClimatePresetModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "home")] + Home = 1, + + [EnumMember(Value = "away")] + Away = 2, + + [EnumMember(Value = "wake")] + Wake = 3, + + [EnumMember(Value = "sleep")] + Sleep = 4, + + [EnumMember(Value = "occupied")] + Occupied = 5, + + [EnumMember(Value = "unoccupied")] + Unoccupied = 6, + } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum FanModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum HvacModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "off")] + Off = 1, + + [EnumMember(Value = "heat")] + Heat = 2, + + [EnumMember(Value = "cool")] + Cool = 3, + + [EnumMember(Value = "heat_cool")] + HeatCool = 4, + + [EnumMember(Value = "eco")] + Eco = 5, + } + + /// + /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be deleted. + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; init; } + + /// + /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be edited. + /// + [JsonPropertyName("can_edit")] + public bool? CanEdit { get; init; } + + /// + /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be programmed in a thermostat daily program. + /// + [JsonPropertyName("can_use_with_thermostat_daily_programs")] + public bool? CanUseWithThermostatDailyPrograms { get; init; } + + /// + /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("climate_preset_key")] + public string? ClimatePresetKey { get; init; } + + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonPropertyName("climate_preset_mode")] + public DevicePropertiesCurrentClimateSetting.ClimatePresetModeEnum? ClimatePresetMode { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// Display name for the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("display_name")] + public string? DisplayName { get; init; } + + /// + /// Metadata specific to the Ecobee climate, if applicable. + /// + [JsonPropertyName("ecobee_metadata")] + public DevicePropertiesCurrentClimateSettingEcobeeMetadata? EcobeeMetadata { get; init; } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonPropertyName("fan_mode_setting")] + public DevicePropertiesCurrentClimateSetting.FanModeSettingEnum? FanModeSetting { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonPropertyName("hvac_mode_setting")] + public DevicePropertiesCurrentClimateSetting.HvacModeSettingEnum? HvacModeSetting { get; init; } + + /// + /// Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] + [JsonPropertyName("manual_override_allowed")] + public bool? ManualOverrideAllowed { get; init; } + + /// + /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record DevicePropertiesCurrentClimateSettingEcobeeMetadata + { + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum OwnerEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "user")] + User = 1, + + [EnumMember(Value = "system")] + System = 2, + } + + /// + /// Reference to the Ecobee climate, if applicable. + /// + [JsonPropertyName("climate_ref")] + public string? ClimateRef { get; init; } + + /// + /// Indicates if the climate preset is optimized by Ecobee. + /// + [JsonPropertyName("is_optimized")] + public bool? IsOptimized { get; init; } + + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonPropertyName("owner")] + public DevicePropertiesCurrentClimateSettingEcobeeMetadata.OwnerEnum? Owner { get; init; } + } + + public sealed record DevicePropertiesDefaultClimateSetting + { + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ClimatePresetModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "home")] + Home = 1, + + [EnumMember(Value = "away")] + Away = 2, + + [EnumMember(Value = "wake")] + Wake = 3, + + [EnumMember(Value = "sleep")] + Sleep = 4, + + [EnumMember(Value = "occupied")] + Occupied = 5, + + [EnumMember(Value = "unoccupied")] + Unoccupied = 6, + } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum FanModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum HvacModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "off")] + Off = 1, + + [EnumMember(Value = "heat")] + Heat = 2, + + [EnumMember(Value = "cool")] + Cool = 3, + + [EnumMember(Value = "heat_cool")] + HeatCool = 4, + + [EnumMember(Value = "eco")] + Eco = 5, + } + + /// + /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be deleted. + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; init; } + + /// + /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be edited. + /// + [JsonPropertyName("can_edit")] + public bool? CanEdit { get; init; } + + /// + /// Indicates whether the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) key can be programmed in a thermostat daily program. + /// + [JsonPropertyName("can_use_with_thermostat_daily_programs")] + public bool? CanUseWithThermostatDailyPrograms { get; init; } + + /// + /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("climate_preset_key")] + public string? ClimatePresetKey { get; init; } + + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonPropertyName("climate_preset_mode")] + public DevicePropertiesDefaultClimateSetting.ClimatePresetModeEnum? ClimatePresetMode { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// Display name for the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("display_name")] + public string? DisplayName { get; init; } + + /// + /// Metadata specific to the Ecobee climate, if applicable. + /// + [JsonPropertyName("ecobee_metadata")] + public DevicePropertiesDefaultClimateSettingEcobeeMetadata? EcobeeMetadata { get; init; } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonPropertyName("fan_mode_setting")] + public DevicePropertiesDefaultClimateSetting.FanModeSettingEnum? FanModeSetting { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonPropertyName("hvac_mode_setting")] + public DevicePropertiesDefaultClimateSetting.HvacModeSettingEnum? HvacModeSetting { get; init; } + + /// + /// Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] + [JsonPropertyName("manual_override_allowed")] + public bool? ManualOverrideAllowed { get; init; } + + /// + /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record DevicePropertiesDefaultClimateSettingEcobeeMetadata + { + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum OwnerEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "user")] + User = 1, + + [EnumMember(Value = "system")] + System = 2, + } + + /// + /// Reference to the Ecobee climate, if applicable. + /// + [JsonPropertyName("climate_ref")] + public string? ClimateRef { get; init; } + + /// + /// Indicates if the climate preset is optimized by Ecobee. + /// + [JsonPropertyName("is_optimized")] + public bool? IsOptimized { get; init; } + + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonPropertyName("owner")] + public DevicePropertiesDefaultClimateSettingEcobeeMetadata.OwnerEnum? Owner { get; init; } + } + + public sealed record DevicePropertiesTemperatureThreshold + { + /// + /// Lower limit in °C within the current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. + /// + [JsonPropertyName("lower_limit_celsius")] + public float? LowerLimitCelsius { get; init; } + + /// + /// Lower limit in °F within the current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. + /// + [JsonPropertyName("lower_limit_fahrenheit")] + public float? LowerLimitFahrenheit { get; init; } + + /// + /// Upper limit in °C within the current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. + /// + [JsonPropertyName("upper_limit_celsius")] + public float? UpperLimitCelsius { get; init; } + + /// + /// Upper limit in °F within the current [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) set for the thermostat. + /// + [JsonPropertyName("upper_limit_fahrenheit")] + public float? UpperLimitFahrenheit { get; init; } + } + + public sealed record DevicePropertiesThermostatDailyPrograms + { + /// + /// Date and time at which the thermostat daily program was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// ID of the thermostat device on which the thermostat daily program is configured. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// User-friendly name to identify the thermostat daily program. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Array of thermostat daily program periods. + /// + [JsonPropertyName("periods")] + public List Periods { get; init; } = + default!; + + /// + /// ID of the thermostat daily program. + /// + [JsonPropertyName("thermostat_daily_program_id")] + public string ThermostatDailyProgramId { get; init; } = default!; + + /// + /// ID of the workspace that contains the thermostat daily program. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record DevicePropertiesThermostatDailyProgramsPeriods + { + /// + /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to activate at the `starts_at_time`. + /// + [JsonPropertyName("climate_preset_key")] + public string ClimatePresetKey { get; init; } = default!; + + /// + /// Time at which the thermostat daily program period starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at_time")] + public string StartsAtTime { get; init; } = default!; + } + + public sealed record DevicePropertiesThermostatWeeklyProgram + { + /// + /// Date and time at which the thermostat weekly program was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// ID of the thermostat daily program to run on Fridays. + /// + [JsonPropertyName("friday_program_id")] + public string? FridayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Mondays. + /// + [JsonPropertyName("monday_program_id")] + public string? MondayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Saturdays. + /// + [JsonPropertyName("saturday_program_id")] + public string? SaturdayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Sundays. + /// + [JsonPropertyName("sunday_program_id")] + public string? SundayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Thursdays. + /// + [JsonPropertyName("thursday_program_id")] + public string? ThursdayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Tuesdays. + /// + [JsonPropertyName("tuesday_program_id")] + public string? TuesdayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Wednesdays. + /// + [JsonPropertyName("wednesday_program_id")] + public string? WednesdayProgramId { get; init; } + } +} diff --git a/src/Seam/Model/DeviceProvider.cs b/src/Seam/Models/DeviceProvider.cs similarity index 53% rename from src/Seam/Model/DeviceProvider.cs rename to src/Seam/Models/DeviceProvider.cs index e4e9e674..29e1731f 100644 --- a/src/Seam/Model/DeviceProvider.cs +++ b/src/Seam/Models/DeviceProvider.cs @@ -1,78 +1,20 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Model; - -namespace Seam.Model +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models { - [DataContract(Name = "seamModel_deviceProvider_model")] - public class DeviceProvider + public sealed record DeviceProvider { - [JsonConstructorAttribute] - protected DeviceProvider() { } - - public DeviceProvider( - bool? canConfigureAutoLock = default, - bool? canHvacCool = default, - bool? canHvacHeat = default, - bool? canHvacHeatCool = default, - bool? canProgramOfflineAccessCodes = default, - bool? canProgramOnlineAccessCodes = default, - bool? canProgramThermostatProgramsAsDifferentEachDay = default, - bool? canProgramThermostatProgramsAsSameEachDay = default, - bool? canProgramThermostatProgramsAsWeekdayWeekend = default, - bool? canRemotelyLock = default, - bool? canRemotelyUnlock = default, - bool? canRunThermostatPrograms = default, - bool? canSimulateConnection = default, - bool? canSimulateDisconnection = default, - bool? canSimulateHubConnection = default, - bool? canSimulateHubDisconnection = default, - bool? canSimulatePaidSubscription = default, - bool? canSimulateRemoval = default, - bool? canTurnOffHvac = default, - bool? canUnlockWithCode = default, - DeviceProvider.DeviceProviderNameEnum deviceProviderName = default, - string displayName = default, - string imageUrl = default, - List providerCategories = default - ) - { - CanConfigureAutoLock = canConfigureAutoLock; - CanHvacCool = canHvacCool; - CanHvacHeat = canHvacHeat; - CanHvacHeatCool = canHvacHeatCool; - CanProgramOfflineAccessCodes = canProgramOfflineAccessCodes; - CanProgramOnlineAccessCodes = canProgramOnlineAccessCodes; - CanProgramThermostatProgramsAsDifferentEachDay = - canProgramThermostatProgramsAsDifferentEachDay; - CanProgramThermostatProgramsAsSameEachDay = canProgramThermostatProgramsAsSameEachDay; - CanProgramThermostatProgramsAsWeekdayWeekend = - canProgramThermostatProgramsAsWeekdayWeekend; - CanRemotelyLock = canRemotelyLock; - CanRemotelyUnlock = canRemotelyUnlock; - CanRunThermostatPrograms = canRunThermostatPrograms; - CanSimulateConnection = canSimulateConnection; - CanSimulateDisconnection = canSimulateDisconnection; - CanSimulateHubConnection = canSimulateHubConnection; - CanSimulateHubDisconnection = canSimulateHubDisconnection; - CanSimulatePaidSubscription = canSimulatePaidSubscription; - CanSimulateRemoval = canSimulateRemoval; - CanTurnOffHvac = canTurnOffHvac; - CanUnlockWithCode = canUnlockWithCode; - DeviceProviderName = deviceProviderName; - DisplayName = displayName; - ImageUrl = imageUrl; - ProviderCategories = providerCategories; - } - /// /// Name of the device provider. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum DeviceProviderNameEnum { [EnumMember(Value = "unrecognized")] @@ -274,7 +216,7 @@ public enum DeviceProviderNameEnum /// /// List of provider categories to which the device provider belongs, such as `stable`, `consumer_smartlocks`, `thermostats`, and so on. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum ProviderCategoriesEnum { [EnumMember(Value = "unrecognized")] @@ -308,204 +250,146 @@ public enum ProviderCategoriesEnum /// /// Indicates whether the lock supports configuring automatic locking. /// - [DataMember(Name = "can_configure_auto_lock", IsRequired = false, EmitDefaultValue = false)] - public bool? CanConfigureAutoLock { get; set; } + [JsonPropertyName("can_configure_auto_lock")] + public bool? CanConfigureAutoLock { get; init; } /// /// Indicates whether the thermostat supports cooling. /// - [DataMember(Name = "can_hvac_cool", IsRequired = false, EmitDefaultValue = false)] - public bool? CanHvacCool { get; set; } + [JsonPropertyName("can_hvac_cool")] + public bool? CanHvacCool { get; init; } /// /// Indicates whether the thermostat supports heating. /// - [DataMember(Name = "can_hvac_heat", IsRequired = false, EmitDefaultValue = false)] - public bool? CanHvacHeat { get; set; } + [JsonPropertyName("can_hvac_heat")] + public bool? CanHvacHeat { get; init; } /// /// Indicates whether the thermostat supports simultaneous heating and cooling. /// - [DataMember(Name = "can_hvac_heat_cool", IsRequired = false, EmitDefaultValue = false)] - public bool? CanHvacHeatCool { get; set; } + [JsonPropertyName("can_hvac_heat_cool")] + public bool? CanHvacHeatCool { get; init; } /// /// Indicates whether the device supports programming offline access codes. /// - [DataMember( - Name = "can_program_offline_access_codes", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramOfflineAccessCodes { get; set; } + [JsonPropertyName("can_program_offline_access_codes")] + public bool? CanProgramOfflineAccessCodes { get; init; } /// /// Indicates whether the device supports programming online access codes. /// - [DataMember( - Name = "can_program_online_access_codes", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramOnlineAccessCodes { get; set; } + [JsonPropertyName("can_program_online_access_codes")] + public bool? CanProgramOnlineAccessCodes { get; init; } /// /// Indicates whether the thermostat supports different climate programs for each day of the week. /// - [DataMember( - Name = "can_program_thermostat_programs_as_different_each_day", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramThermostatProgramsAsDifferentEachDay { get; set; } + [JsonPropertyName("can_program_thermostat_programs_as_different_each_day")] + public bool? CanProgramThermostatProgramsAsDifferentEachDay { get; init; } /// /// Indicates whether the thermostat supports a single climate program applied to every day. /// - [DataMember( - Name = "can_program_thermostat_programs_as_same_each_day", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramThermostatProgramsAsSameEachDay { get; set; } + [JsonPropertyName("can_program_thermostat_programs_as_same_each_day")] + public bool? CanProgramThermostatProgramsAsSameEachDay { get; init; } /// /// Indicates whether the thermostat supports weekday/weekend climate programs. /// - [DataMember( - Name = "can_program_thermostat_programs_as_weekday_weekend", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanProgramThermostatProgramsAsWeekdayWeekend { get; set; } + [JsonPropertyName("can_program_thermostat_programs_as_weekday_weekend")] + public bool? CanProgramThermostatProgramsAsWeekdayWeekend { get; init; } /// /// Indicates whether the device supports remote locking. /// - [DataMember(Name = "can_remotely_lock", IsRequired = false, EmitDefaultValue = false)] - public bool? CanRemotelyLock { get; set; } + [JsonPropertyName("can_remotely_lock")] + public bool? CanRemotelyLock { get; init; } /// /// Indicates whether the device supports remote unlocking. /// - [DataMember(Name = "can_remotely_unlock", IsRequired = false, EmitDefaultValue = false)] - public bool? CanRemotelyUnlock { get; set; } + [JsonPropertyName("can_remotely_unlock")] + public bool? CanRemotelyUnlock { get; init; } /// /// Indicates whether the thermostat supports running climate programs. /// - [DataMember( - Name = "can_run_thermostat_programs", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanRunThermostatPrograms { get; set; } + [JsonPropertyName("can_run_thermostat_programs")] + public bool? CanRunThermostatPrograms { get; init; } /// /// Indicates whether the device supports simulating connection in a sandbox. /// - [DataMember(Name = "can_simulate_connection", IsRequired = false, EmitDefaultValue = false)] - public bool? CanSimulateConnection { get; set; } + [JsonPropertyName("can_simulate_connection")] + public bool? CanSimulateConnection { get; init; } /// /// Indicates whether the device supports simulating disconnection in a sandbox. /// - [DataMember( - Name = "can_simulate_disconnection", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulateDisconnection { get; set; } + [JsonPropertyName("can_simulate_disconnection")] + public bool? CanSimulateDisconnection { get; init; } /// /// Indicates whether the hub supports simulating connection in a sandbox. /// - [DataMember( - Name = "can_simulate_hub_connection", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulateHubConnection { get; set; } + [JsonPropertyName("can_simulate_hub_connection")] + public bool? CanSimulateHubConnection { get; init; } /// /// Indicates whether the hub supports simulating disconnection in a sandbox. /// - [DataMember( - Name = "can_simulate_hub_disconnection", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulateHubDisconnection { get; set; } + [JsonPropertyName("can_simulate_hub_disconnection")] + public bool? CanSimulateHubDisconnection { get; init; } /// /// Indicates whether the device supports simulating a paid subscription in a sandbox. /// - [DataMember( - Name = "can_simulate_paid_subscription", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? CanSimulatePaidSubscription { get; set; } + [JsonPropertyName("can_simulate_paid_subscription")] + public bool? CanSimulatePaidSubscription { get; init; } /// /// Indicates whether the device supports simulating removal in a sandbox. /// - [DataMember(Name = "can_simulate_removal", IsRequired = false, EmitDefaultValue = false)] - public bool? CanSimulateRemoval { get; set; } + [JsonPropertyName("can_simulate_removal")] + public bool? CanSimulateRemoval { get; init; } /// /// Indicates whether the thermostat can be turned off. /// - [DataMember(Name = "can_turn_off_hvac", IsRequired = false, EmitDefaultValue = false)] - public bool? CanTurnOffHvac { get; set; } + [JsonPropertyName("can_turn_off_hvac")] + public bool? CanTurnOffHvac { get; init; } /// /// Indicates whether the lock supports unlocking with an access code. /// - [DataMember(Name = "can_unlock_with_code", IsRequired = false, EmitDefaultValue = false)] - public bool? CanUnlockWithCode { get; set; } + [JsonPropertyName("can_unlock_with_code")] + public bool? CanUnlockWithCode { get; init; } /// /// Name of the device provider. /// - [DataMember(Name = "device_provider_name", IsRequired = false, EmitDefaultValue = false)] - public DeviceProvider.DeviceProviderNameEnum DeviceProviderName { get; set; } + [JsonPropertyName("device_provider_name")] + public DeviceProvider.DeviceProviderNameEnum DeviceProviderName { get; init; } = default!; /// /// Display name for the device provider. /// - [DataMember(Name = "display_name", IsRequired = false, EmitDefaultValue = false)] - public string DisplayName { get; set; } + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; /// /// Image URL for the device provider. /// - [DataMember(Name = "image_url", IsRequired = false, EmitDefaultValue = false)] - public string ImageUrl { get; set; } + [JsonPropertyName("image_url")] + public string ImageUrl { get; init; } = default!; /// /// List of provider categories to which the device provider belongs, such as `stable`, `consumer_smartlocks`, `thermostats`, and so on. /// - [DataMember(Name = "provider_categories", IsRequired = false, EmitDefaultValue = false)] - public List ProviderCategories { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("provider_categories")] + public List ProviderCategories { get; init; } = + default!; } } diff --git a/src/Seam/Models/Event.cs b/src/Seam/Models/Event.cs new file mode 100644 index 00000000..ceda0e3b --- /dev/null +++ b/src/Seam/Models/Event.cs @@ -0,0 +1,6433 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("event_type")] + [SeamUnionVariant("access_code.created", typeof(EventAccessCodeCreated))] + [SeamUnionVariant("access_code.changed", typeof(EventAccessCodeChanged))] + [SeamUnionVariant("access_code.name_changed", typeof(EventAccessCodeNameChanged))] + [SeamUnionVariant("access_code.code_changed", typeof(EventAccessCodeCodeChanged))] + [SeamUnionVariant("access_code.time_frame_changed", typeof(EventAccessCodeTimeFrameChanged))] + [SeamUnionVariant("access_code.mutations_requested", typeof(EventAccessCodeMutationsRequested))] + [SeamUnionVariant("access_code.scheduled_on_device", typeof(EventAccessCodeScheduledOnDevice))] + [SeamUnionVariant("access_code.set_on_device", typeof(EventAccessCodeSetOnDevice))] + [SeamUnionVariant("access_code.removed_from_device", typeof(EventAccessCodeRemovedFromDevice))] + [SeamUnionVariant( + "access_code.delay_in_setting_on_device", + typeof(EventAccessCodeDelayInSettingOnDevice) + )] + [SeamUnionVariant( + "access_code.failed_to_set_on_device", + typeof(EventAccessCodeFailedToSetOnDevice) + )] + [SeamUnionVariant("access_code.deleted", typeof(EventAccessCodeDeleted))] + [SeamUnionVariant( + "access_code.delay_in_removing_from_device", + typeof(EventAccessCodeDelayInRemovingFromDevice) + )] + [SeamUnionVariant( + "access_code.failed_to_remove_from_device", + typeof(EventAccessCodeFailedToRemoveFromDevice) + )] + [SeamUnionVariant( + "access_code.modified_external_to_seam", + typeof(EventAccessCodeModifiedExternalToSeam) + )] + [SeamUnionVariant( + "access_code.deleted_external_to_seam", + typeof(EventAccessCodeDeletedExternalToSeam) + )] + [SeamUnionVariant( + "access_code.backup_access_code_pulled", + typeof(EventAccessCodeBackupAccessCodePulled) + )] + [SeamUnionVariant( + "access_code.unmanaged.converted_to_managed", + typeof(EventAccessCodeUnmanagedConvertedToManaged) + )] + [SeamUnionVariant( + "access_code.unmanaged.failed_to_convert_to_managed", + typeof(EventAccessCodeUnmanagedFailedToConvertToManaged) + )] + [SeamUnionVariant("access_code.unmanaged.created", typeof(EventAccessCodeUnmanagedCreated))] + [SeamUnionVariant("access_code.unmanaged.removed", typeof(EventAccessCodeUnmanagedRemoved))] + [SeamUnionVariant("access_grant.created", typeof(EventAccessGrantCreated))] + [SeamUnionVariant("access_grant.deleted", typeof(EventAccessGrantDeleted))] + [SeamUnionVariant( + "access_grant.access_granted_to_all_doors", + typeof(EventAccessGrantAccessGrantedToAllDoors) + )] + [SeamUnionVariant( + "access_grant.access_granted_to_door", + typeof(EventAccessGrantAccessGrantedToDoor) + )] + [SeamUnionVariant("access_grant.access_to_door_lost", typeof(EventAccessGrantAccessToDoorLost))] + [SeamUnionVariant( + "access_grant.access_times_changed", + typeof(EventAccessGrantAccessTimesChanged) + )] + [SeamUnionVariant( + "access_grant.could_not_create_requested_access_methods", + typeof(EventAccessGrantCouldNotCreateRequestedAccessMethods) + )] + [SeamUnionVariant("access_method.issued", typeof(EventAccessMethodIssued))] + [SeamUnionVariant("access_method.revoked", typeof(EventAccessMethodRevoked))] + [SeamUnionVariant( + "access_method.card_encoding_required", + typeof(EventAccessMethodCardEncodingRequired) + )] + [SeamUnionVariant("access_method.deleted", typeof(EventAccessMethodDeleted))] + [SeamUnionVariant("access_method.reissued", typeof(EventAccessMethodReissued))] + [SeamUnionVariant("access_method.created", typeof(EventAccessMethodCreated))] + [SeamUnionVariant("access_method.delay_in_issuing", typeof(EventAccessMethodDelayInIssuing))] + [SeamUnionVariant("access_method.failed_to_issue", typeof(EventAccessMethodFailedToIssue))] + [SeamUnionVariant("acs_system.connected", typeof(EventAcsSystemConnected))] + [SeamUnionVariant("acs_system.added", typeof(EventAcsSystemAdded))] + [SeamUnionVariant("acs_system.disconnected", typeof(EventAcsSystemDisconnected))] + [SeamUnionVariant("acs_credential.deleted", typeof(EventAcsCredentialDeleted))] + [SeamUnionVariant("acs_credential.issued", typeof(EventAcsCredentialIssued))] + [SeamUnionVariant("acs_credential.reissued", typeof(EventAcsCredentialReissued))] + [SeamUnionVariant("acs_credential.invalidated", typeof(EventAcsCredentialInvalidated))] + [SeamUnionVariant("acs_user.created", typeof(EventAcsUserCreated))] + [SeamUnionVariant("acs_user.deleted", typeof(EventAcsUserDeleted))] + [SeamUnionVariant("acs_encoder.added", typeof(EventAcsEncoderAdded))] + [SeamUnionVariant("acs_encoder.removed", typeof(EventAcsEncoderRemoved))] + [SeamUnionVariant("acs_access_group.deleted", typeof(EventAcsAccessGroupDeleted))] + [SeamUnionVariant("acs_entrance.added", typeof(EventAcsEntranceAdded))] + [SeamUnionVariant("acs_entrance.removed", typeof(EventAcsEntranceRemoved))] + [SeamUnionVariant("client_session.deleted", typeof(EventClientSessionDeleted))] + [SeamUnionVariant("connected_account.connected", typeof(EventConnectedAccountConnected))] + [SeamUnionVariant("connected_account.created", typeof(EventConnectedAccountCreated))] + [SeamUnionVariant( + "connected_account.successful_login", + typeof(EventConnectedAccountSuccessfulLogin) + )] + [SeamUnionVariant("connected_account.disconnected", typeof(EventConnectedAccountDisconnected))] + [SeamUnionVariant( + "connected_account.completed_first_sync", + typeof(EventConnectedAccountCompletedFirstSync) + )] + [SeamUnionVariant("connected_account.deleted", typeof(EventConnectedAccountDeleted))] + [SeamUnionVariant( + "connected_account.completed_first_sync_after_reconnection", + typeof(EventConnectedAccountCompletedFirstSyncAfterReconnection) + )] + [SeamUnionVariant( + "connected_account.reauthorization_requested", + typeof(EventConnectedAccountReauthorizationRequested) + )] + [SeamUnionVariant( + "action_attempt.lock_door.succeeded", + typeof(EventActionAttemptLockDoorSucceeded) + )] + [SeamUnionVariant("action_attempt.lock_door.failed", typeof(EventActionAttemptLockDoorFailed))] + [SeamUnionVariant( + "action_attempt.unlock_door.succeeded", + typeof(EventActionAttemptUnlockDoorSucceeded) + )] + [SeamUnionVariant( + "action_attempt.unlock_door.failed", + typeof(EventActionAttemptUnlockDoorFailed) + )] + [SeamUnionVariant( + "action_attempt.simulate_keypad_code_entry.succeeded", + typeof(EventActionAttemptSimulateKeypadCodeEntrySucceeded) + )] + [SeamUnionVariant( + "action_attempt.simulate_keypad_code_entry.failed", + typeof(EventActionAttemptSimulateKeypadCodeEntryFailed) + )] + [SeamUnionVariant( + "action_attempt.simulate_manual_lock_via_keypad.succeeded", + typeof(EventActionAttemptSimulateManualLockViaKeypadSucceeded) + )] + [SeamUnionVariant( + "action_attempt.simulate_manual_lock_via_keypad.failed", + typeof(EventActionAttemptSimulateManualLockViaKeypadFailed) + )] + [SeamUnionVariant("connect_webview.login_succeeded", typeof(EventConnectWebviewLoginSucceeded))] + [SeamUnionVariant("connect_webview.login_failed", typeof(EventConnectWebviewLoginFailed))] + [SeamUnionVariant("device.connected", typeof(EventDeviceConnected))] + [SeamUnionVariant("device.added", typeof(EventDeviceAdded))] + [SeamUnionVariant("device.converted_to_unmanaged", typeof(EventDeviceConvertedToUnmanaged))] + [SeamUnionVariant( + "device.unmanaged.converted_to_managed", + typeof(EventDeviceUnmanagedConvertedToManaged) + )] + [SeamUnionVariant("device.unmanaged.connected", typeof(EventDeviceUnmanagedConnected))] + [SeamUnionVariant("device.disconnected", typeof(EventDeviceDisconnected))] + [SeamUnionVariant("device.unmanaged.disconnected", typeof(EventDeviceUnmanagedDisconnected))] + [SeamUnionVariant("device.tampered", typeof(EventDeviceTampered))] + [SeamUnionVariant("device.low_battery", typeof(EventDeviceLowBattery))] + [SeamUnionVariant("device.battery_status_changed", typeof(EventDeviceBatteryStatusChanged))] + [SeamUnionVariant("device.removed", typeof(EventDeviceRemoved))] + [SeamUnionVariant("device.deleted", typeof(EventDeviceDeleted))] + [SeamUnionVariant( + "device.third_party_integration_detected", + typeof(EventDeviceThirdPartyIntegrationDetected) + )] + [SeamUnionVariant( + "device.third_party_integration_no_longer_detected", + typeof(EventDeviceThirdPartyIntegrationNoLongerDetected) + )] + [SeamUnionVariant( + "device.salto.privacy_mode_activated", + typeof(EventDeviceSaltoPrivacyModeActivated) + )] + [SeamUnionVariant( + "device.salto.privacy_mode_deactivated", + typeof(EventDeviceSaltoPrivacyModeDeactivated) + )] + [SeamUnionVariant("device.connection_became_flaky", typeof(EventDeviceConnectionBecameFlaky))] + [SeamUnionVariant("device.connection_stabilized", typeof(EventDeviceConnectionStabilized))] + [SeamUnionVariant( + "device.error.subscription_required", + typeof(EventDeviceErrorSubscriptionRequired) + )] + [SeamUnionVariant( + "device.error.subscription_required.resolved", + typeof(EventDeviceErrorSubscriptionRequiredResolved) + )] + [SeamUnionVariant( + "device.accessory_keypad_connected", + typeof(EventDeviceAccessoryKeypadConnected) + )] + [SeamUnionVariant( + "device.accessory_keypad_disconnected", + typeof(EventDeviceAccessoryKeypadDisconnected) + )] + [SeamUnionVariant( + "noise_sensor.noise_threshold_triggered", + typeof(EventNoiseSensorNoiseThresholdTriggered) + )] + [SeamUnionVariant("lock.locked", typeof(EventLockLocked))] + [SeamUnionVariant("lock.unlocked", typeof(EventLockUnlocked))] + [SeamUnionVariant("lock.access_denied", typeof(EventLockAccessDenied))] + [SeamUnionVariant( + "thermostat.climate_preset_activated", + typeof(EventThermostatClimatePresetActivated) + )] + [SeamUnionVariant("thermostat.manually_adjusted", typeof(EventThermostatManuallyAdjusted))] + [SeamUnionVariant( + "thermostat.temperature_threshold_exceeded", + typeof(EventThermostatTemperatureThresholdExceeded) + )] + [SeamUnionVariant( + "thermostat.temperature_threshold_no_longer_exceeded", + typeof(EventThermostatTemperatureThresholdNoLongerExceeded) + )] + [SeamUnionVariant( + "thermostat.temperature_reached_set_point", + typeof(EventThermostatTemperatureReachedSetPoint) + )] + [SeamUnionVariant("thermostat.temperature_changed", typeof(EventThermostatTemperatureChanged))] + [SeamUnionVariant("device.name_changed", typeof(EventDeviceNameChanged))] + [SeamUnionVariant("camera.activated", typeof(EventCameraActivated))] + [SeamUnionVariant("device.doorbell_rang", typeof(EventDeviceDoorbellRang))] + [SeamUnionVariant("phone.deactivated", typeof(EventPhoneDeactivated))] + [SeamUnionVariant("space.device_membership_changed", typeof(EventSpaceDeviceMembershipChanged))] + [SeamUnionVariant("space.created", typeof(EventSpaceCreated))] + [SeamUnionVariant("space.deleted", typeof(EventSpaceDeleted))] + [SeamUnionFallback(typeof(EventUnrecognized))] + public abstract record Event + { + /// The value of the event_type discriminator. + public abstract string EventType { get; } + + /// + /// Date and time at which the event was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. + /// + [JsonPropertyName("event_description")] + public string? EventDescription { get; init; } + + /// + /// ID of the event. + /// + [JsonPropertyName("event_id")] + public string EventId { get; init; } = default!; + + /// + /// Date and time at which the event occurred. + /// + [JsonPropertyName("occurred_at")] + public string OccurredAt { get; init; } = default!; + + /// + /// ID of the workspace associated with the event. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was created. + /// + public sealed record EventAccessCodeCreated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.created"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was changed. + /// + public sealed record EventAccessCodeChanged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.changed"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Human-readable reason for the change (e.g. `ongoing code auto-renewed`). + /// + [JsonPropertyName("change_reason")] + public string? ChangeReason { get; init; } + + /// + /// List of properties that changed on the access code. + /// + [JsonPropertyName("changed_properties")] + public List? ChangedProperties { get; init; } + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + public sealed record EventAccessCodeChangedChangedProperties + { + /// + /// Previous value of the property, or null if not set. + /// + [JsonPropertyName("from")] + public string? From { get; init; } + + /// + /// Name of the property that changed (e.g. `code`). + /// + [JsonPropertyName("property")] + public string Property { get; init; } = default!; + + /// + /// New value of the property, or null if cleared. + /// + [JsonPropertyName("to")] + public string? To { get; init; } + } + + /// + /// The name of an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was changed on the device. + /// + public sealed record EventAccessCodeNameChanged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.name_changed"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Human-readable description of the change and its source. + /// + [JsonPropertyName("description")] + public string Description { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Previous access code name configuration. + /// + [JsonPropertyName("from")] + public EventAccessCodeNameChangedFrom From { get; init; } = default!; + + /// + /// New access code name configuration. + /// + [JsonPropertyName("to")] + public EventAccessCodeNameChangedTo To { get; init; } = default!; + } + + public sealed record EventAccessCodeNameChangedFrom + { + /// + /// Previous name of the access code. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record EventAccessCodeNameChangedTo + { + /// + /// New name of the access code. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + /// + /// The pin code of an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was changed on the device. + /// + public sealed record EventAccessCodeCodeChanged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.code_changed"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Human-readable description of the change and its source. + /// + [JsonPropertyName("description")] + public string Description { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Previous pin code configuration. + /// + [JsonPropertyName("from")] + public EventAccessCodeCodeChangedFrom From { get; init; } = default!; + + /// + /// New pin code configuration. + /// + [JsonPropertyName("to")] + public EventAccessCodeCodeChangedTo To { get; init; } = default!; + } + + public sealed record EventAccessCodeCodeChangedFrom + { + /// + /// Previous pin code. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + } + + public sealed record EventAccessCodeCodeChangedTo + { + /// + /// New pin code. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + } + + /// + /// The time frame of an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was changed on the device. + /// + public sealed record EventAccessCodeTimeFrameChanged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.time_frame_changed"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Human-readable description of the change and its source. + /// + [JsonPropertyName("description")] + public string Description { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Previous time frame configuration. + /// + [JsonPropertyName("from")] + public EventAccessCodeTimeFrameChangedFrom From { get; init; } = default!; + + /// + /// New time frame configuration. + /// + [JsonPropertyName("to")] + public EventAccessCodeTimeFrameChangedTo To { get; init; } = default!; + } + + public sealed record EventAccessCodeTimeFrameChangedFrom + { + /// + /// Previous end time. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Previous start time. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record EventAccessCodeTimeFrameChangedTo + { + /// + /// New end time. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// New start time. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + /// + /// Mutations were requested on an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). This event fires at request time, before the change is confirmed on the device. + /// + public sealed record EventAccessCodeMutationsRequested : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.mutations_requested"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Array of mutations requested on the access code, each containing the mutation type and from/to values. + /// + [JsonPropertyName("requested_mutations")] + public List RequestedMutations { get; init; } = + default!; + } + + public sealed record EventAccessCodeMutationsRequestedRequestedMutations + { + /// + /// Code identifying the type of mutation requested, such as `updating_name`, `updating_code`, `updating_time_frame`, or `deleting`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum MutationCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "updating_name")] + UpdatingName = 1, + + [EnumMember(Value = "updating_code")] + UpdatingCode = 2, + + [EnumMember(Value = "updating_time_frame")] + UpdatingTimeFrame = 3, + + [EnumMember(Value = "deleting")] + Deleting = 4, + + [EnumMember(Value = "creating")] + Creating = 5, + + [EnumMember(Value = "deferring_creation")] + DeferringCreation = 6, + } + + /// + /// Previous property values before the requested change. Keys depend on the mutation type. Absent for non-property mutations like `deleting`. + /// + [JsonPropertyName("from")] + public object? From { get; init; } + + /// + /// Code identifying the type of mutation requested, such as `updating_name`, `updating_code`, `updating_time_frame`, or `deleting`. + /// + [JsonPropertyName("mutation_code")] + public EventAccessCodeMutationsRequestedRequestedMutations.MutationCodeEnum MutationCode { get; init; } = + default!; + + /// + /// New property values after the requested change. Keys depend on the mutation type. Absent for non-property mutations like `deleting`. + /// + [JsonPropertyName("to")] + public object? To { get; init; } + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was [scheduled natively](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) on a device. + /// + public sealed record EventAccessCodeScheduledOnDevice : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.scheduled_on_device"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Code for the affected access code. + /// + [JsonPropertyName("code")] + public string Code { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was set on a device. + /// + public sealed record EventAccessCodeSetOnDevice : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.set_on_device"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Code for the affected access code. + /// + [JsonPropertyName("code")] + public string Code { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was removed from a device. + /// + public sealed record EventAccessCodeRemovedFromDevice : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.removed_from_device"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// There was an unusually long delay in setting an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) on a device. + /// + public sealed record EventAccessCodeDelayInSettingOnDevice : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.delay_in_setting_on_device"; + + /// + /// Errors associated with the access code. + /// + [JsonPropertyName("access_code_errors")] + public List AccessCodeErrors { get; init; } = + default!; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Warnings associated with the access code. + /// + [JsonPropertyName("access_code_warnings")] + public List AccessCodeWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = + default!; + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = + default!; + } + + public sealed record EventAccessCodeDelayInSettingOnDeviceAccessCodeErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInSettingOnDeviceAccessCodeWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInSettingOnDeviceConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInSettingOnDeviceConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInSettingOnDeviceDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInSettingOnDeviceDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) failed to be set on a device. + /// + public sealed record EventAccessCodeFailedToSetOnDevice : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.failed_to_set_on_device"; + + /// + /// Errors associated with the access code. + /// + [JsonPropertyName("access_code_errors")] + public List AccessCodeErrors { get; init; } = + default!; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Warnings associated with the access code. + /// + [JsonPropertyName("access_code_warnings")] + public List AccessCodeWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = + default!; + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = + default!; + } + + public sealed record EventAccessCodeFailedToSetOnDeviceAccessCodeErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToSetOnDeviceAccessCodeWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToSetOnDeviceConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToSetOnDeviceConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToSetOnDeviceDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToSetOnDeviceDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was deleted. + /// + public sealed record EventAccessCodeDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.deleted"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Code for the affected access code. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// There was an unusually long delay in removing an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) from a device. + /// + [Obsolete( + "Seam no longer emits this event. Use `access_code.failed_to_remove_from_device` instead." + )] + public sealed record EventAccessCodeDelayInRemovingFromDevice : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.delay_in_removing_from_device"; + + /// + /// Errors associated with the access code. + /// + [JsonPropertyName("access_code_errors")] + public List AccessCodeErrors { get; init; } = + default!; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Warnings associated with the access code. + /// + [JsonPropertyName("access_code_warnings")] + public List AccessCodeWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = + default!; + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = + default!; + } + + public sealed record EventAccessCodeDelayInRemovingFromDeviceAccessCodeErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInRemovingFromDeviceAccessCodeWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInRemovingFromDeviceConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInRemovingFromDeviceConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInRemovingFromDeviceDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeDelayInRemovingFromDeviceDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) failed to be removed from a device. + /// + public sealed record EventAccessCodeFailedToRemoveFromDevice : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.failed_to_remove_from_device"; + + /// + /// Errors associated with the access code. + /// + [JsonPropertyName("access_code_errors")] + public List AccessCodeErrors { get; init; } = + default!; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Warnings associated with the access code. + /// + [JsonPropertyName("access_code_warnings")] + public List AccessCodeWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = + default!; + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = + default!; + } + + public sealed record EventAccessCodeFailedToRemoveFromDeviceAccessCodeErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToRemoveFromDeviceAccessCodeWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToRemoveFromDeviceConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToRemoveFromDeviceConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToRemoveFromDeviceDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeFailedToRemoveFromDeviceDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was modified outside of Seam. + /// + public sealed record EventAccessCodeModifiedExternalToSeam : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.modified_external_to_seam"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was deleted outside of Seam. + /// + public sealed record EventAccessCodeDeletedExternalToSeam : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.deleted_external_to_seam"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A [backup access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) was pulled from the backup access code pool and set on a device. + /// + public sealed record EventAccessCodeBackupAccessCodePulled : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.backup_access_code_pulled"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// ID of the backup access code that was pulled from the pool. + /// + [JsonPropertyName("backup_access_code_id")] + public string BackupAccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) was converted successfully to a managed access code. + /// + public sealed record EventAccessCodeUnmanagedConvertedToManaged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.unmanaged.converted_to_managed"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) failed to be converted to a managed access code. + /// + public sealed record EventAccessCodeUnmanagedFailedToConvertToManaged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = + "access_code.unmanaged.failed_to_convert_to_managed"; + + /// + /// Errors associated with the access code. + /// + [JsonPropertyName("access_code_errors")] + public List AccessCodeErrors { get; init; } = + default!; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Warnings associated with the access code. + /// + [JsonPropertyName("access_code_warnings")] + public List AccessCodeWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = + default!; + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = + default!; + } + + public sealed record EventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeUnmanagedFailedToConvertToManagedAccessCodeWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeUnmanagedFailedToConvertToManagedConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAccessCodeUnmanagedFailedToConvertToManagedDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAccessCodeUnmanagedFailedToConvertToManagedDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// An [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) was created on a device. + /// + public sealed record EventAccessCodeUnmanagedCreated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.unmanaged.created"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) was removed from a device. + /// + public sealed record EventAccessCodeUnmanagedRemoved : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_code.unmanaged.removed"; + + /// + /// ID of the affected access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the affected access code. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the device associated with the affected access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An Access Grant was created. + /// + public sealed record EventAccessGrantCreated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_grant.created"; + + /// + /// ID of the affected Access Grant. + /// + [JsonPropertyName("access_grant_id")] + public string AccessGrantId { get; init; } = default!; + } + + /// + /// An Access Grant was deleted. + /// + public sealed record EventAccessGrantDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_grant.deleted"; + + /// + /// ID of the affected Access Grant. + /// + [JsonPropertyName("access_grant_id")] + public string AccessGrantId { get; init; } = default!; + } + + /// + /// All access requested for an Access Grant was successfully granted. + /// + public sealed record EventAccessGrantAccessGrantedToAllDoors : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_grant.access_granted_to_all_doors"; + + /// + /// ID of the affected Access Grant. + /// + [JsonPropertyName("access_grant_id")] + public string AccessGrantId { get; init; } = default!; + } + + /// + /// Access requested as part of an Access Grant to a particular door was successfully granted. + /// + public sealed record EventAccessGrantAccessGrantedToDoor : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_grant.access_granted_to_door"; + + /// + /// ID of the affected Access Grant. + /// + [JsonPropertyName("access_grant_id")] + public string AccessGrantId { get; init; } = default!; + + /// + /// ID of the affected [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("acs_entrance_id")] + public string AcsEntranceId { get; init; } = default!; + } + + /// + /// Access to a particular door that was requested as part of an Access Grant was lost. + /// + public sealed record EventAccessGrantAccessToDoorLost : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_grant.access_to_door_lost"; + + /// + /// ID of the affected Access Grant. + /// + [JsonPropertyName("access_grant_id")] + public string AccessGrantId { get; init; } = default!; + + /// + /// ID of the affected [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + [JsonPropertyName("acs_entrance_id")] + public string AcsEntranceId { get; init; } = default!; + } + + /// + /// An Access Grant's start or end time was changed. + /// + public sealed record EventAccessGrantAccessTimesChanged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_grant.access_times_changed"; + + /// + /// ID of the affected Access Grant. + /// + [JsonPropertyName("access_grant_id")] + public string AccessGrantId { get; init; } = default!; + + /// + /// Key of the affected Access Grant (if present). + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + /// + /// The new end time for the access grant. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// The new start time for the access grant. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + /// + /// One or more requested access methods could not be created for an Access Grant. + /// + public sealed record EventAccessGrantCouldNotCreateRequestedAccessMethods : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = + "access_grant.could_not_create_requested_access_methods"; + + /// + /// ID of the affected Access Grant. + /// + [JsonPropertyName("access_grant_id")] + public string AccessGrantId { get; init; } = default!; + + /// + /// Description of why the access methods could not be created. + /// + [JsonPropertyName("error_message")] + public string ErrorMessage { get; init; } = default!; + + /// + /// IDs of the devices that did not receive a requested access method. Use these to identify which specific devices failed without having to fetch the Access Grant. + /// + [JsonPropertyName("missing_device_ids")] + public List? MissingDeviceIds { get; init; } + } + + /// + /// An access method was issued. + /// + public sealed record EventAccessMethodIssued : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_method.issued"; + + /// + /// IDs of the access grants associated with this access method. + /// + [JsonPropertyName("access_grant_ids")] + public List AccessGrantIds { get; init; } = default!; + + /// + /// Keys of the access grants associated with this access method (if present). + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + /// + /// ID of the affected access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + + /// + /// The actual PIN code for code access methods (only present when mode is 'code'). + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Indicates whether the code is a backup code (only present when mode is 'code' and a backup code was used). + /// + [JsonPropertyName("is_backup_code")] + public bool? IsBackupCode { get; init; } + } + + /// + /// An access method was revoked. + /// + public sealed record EventAccessMethodRevoked : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_method.revoked"; + + /// + /// IDs of the access grants associated with this access method. + /// + [JsonPropertyName("access_grant_ids")] + public List AccessGrantIds { get; init; } = default!; + + /// + /// Keys of the access grants associated with this access method (if present). + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + /// + /// ID of the affected access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + } + + /// + /// An access method representing a physical card requires encoding. + /// + public sealed record EventAccessMethodCardEncodingRequired : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_method.card_encoding_required"; + + /// + /// IDs of the access grants associated with this access method. + /// + [JsonPropertyName("access_grant_ids")] + public List AccessGrantIds { get; init; } = default!; + + /// + /// Keys of the access grants associated with this access method (if present). + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + /// + /// ID of the affected access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + } + + /// + /// An access method was deleted. + /// + public sealed record EventAccessMethodDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_method.deleted"; + + /// + /// IDs of the access grants associated with this access method. + /// + [JsonPropertyName("access_grant_ids")] + public List AccessGrantIds { get; init; } = default!; + + /// + /// Keys of the access grants associated with this access method (if present). + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + /// + /// ID of the affected access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + } + + /// + /// An access method was reissued. + /// + public sealed record EventAccessMethodReissued : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_method.reissued"; + + /// + /// IDs of the access grants associated with this access method. + /// + [JsonPropertyName("access_grant_ids")] + public List AccessGrantIds { get; init; } = default!; + + /// + /// Keys of the access grants associated with this access method (if present). + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + /// + /// ID of the affected access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + + /// + /// The actual PIN code for code access methods (only present when mode is 'code'). + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Indicates whether the code is a backup code (only present when mode is 'code' and a backup code was used). + /// + [JsonPropertyName("is_backup_code")] + public bool? IsBackupCode { get; init; } + } + + /// + /// An access method was created. + /// + public sealed record EventAccessMethodCreated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_method.created"; + + /// + /// IDs of the access grants associated with this access method. + /// + [JsonPropertyName("access_grant_ids")] + public List AccessGrantIds { get; init; } = default!; + + /// + /// Keys of the access grants associated with this access method (if present). + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + /// + /// ID of the affected access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + } + + /// + /// Seam has not yet issued this access method, even though its access grant is about to begin, so access may not be ready when the recipient arrives. Seam is still attempting to issue it, and the accompanying `delay_in_issuing` warning clears automatically once issuance succeeds. + /// + public sealed record EventAccessMethodDelayInIssuing : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_method.delay_in_issuing"; + + /// + /// IDs of the access grants associated with this access method. + /// + [JsonPropertyName("access_grant_ids")] + public List AccessGrantIds { get; init; } = default!; + + /// + /// Keys of the access grants associated with this access method (if present). + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + /// + /// ID of the affected access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + } + + /// + /// Seam was unable to issue this access method before its access grant started, so the recipient may be unable to access the space. This usually points to a problem that needs attention, such as an offline or disconnected device. Seam keeps retrying, and the accompanying `failed_to_issue` error clears automatically if the access method is eventually issued. + /// + public sealed record EventAccessMethodFailedToIssue : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "access_method.failed_to_issue"; + + /// + /// IDs of the access grants associated with this access method. + /// + [JsonPropertyName("access_grant_ids")] + public List AccessGrantIds { get; init; } = default!; + + /// + /// Keys of the access grants associated with this access method (if present). + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + /// + /// ID of the affected access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + } + + /// + /// An [access system](https://docs.seam.co/low-level-apis/access-systems) was connected. + /// + public sealed record EventAcsSystemConnected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_system.connected"; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system](https://docs.seam.co/low-level-apis/access-systems) was added. + /// + public sealed record EventAcsSystemAdded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_system.added"; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system](https://docs.seam.co/low-level-apis/access-systems) was disconnected. + /// + public sealed record EventAcsSystemDisconnected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_system.disconnected"; + + /// + /// Errors associated with the access control system. + /// + [JsonPropertyName("acs_system_errors")] + public List AcsSystemErrors { get; init; } = + default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// Warnings associated with the access control system. + /// + [JsonPropertyName("acs_system_warnings")] + public List AcsSystemWarnings { get; init; } = + default!; + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + } + + public sealed record EventAcsSystemDisconnectedAcsSystemErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAcsSystemDisconnectedAcsSystemWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventAcsSystemDisconnectedConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventAcsSystemDisconnectedConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// An [access system credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was deleted. + /// + public sealed record EventAcsCredentialDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_credential.deleted"; + + /// + /// ID of the affected credential. + /// + [JsonPropertyName("acs_credential_id")] + public string AcsCredentialId { get; init; } = default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was issued. + /// + public sealed record EventAcsCredentialIssued : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_credential.issued"; + + /// + /// ID of the affected credential. + /// + [JsonPropertyName("acs_credential_id")] + public string AcsCredentialId { get; init; } = default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was reissued. + /// + public sealed record EventAcsCredentialReissued : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_credential.reissued"; + + /// + /// ID of the affected credential. + /// + [JsonPropertyName("acs_credential_id")] + public string AcsCredentialId { get; init; } = default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was invalidated. That is, the credential cannot be used anymore. + /// + public sealed record EventAcsCredentialInvalidated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_credential.invalidated"; + + /// + /// ID of the affected credential. + /// + [JsonPropertyName("acs_credential_id")] + public string AcsCredentialId { get; init; } = default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) was created. + /// + public sealed record EventAcsUserCreated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_user.created"; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the affected access system user. + /// + [JsonPropertyName("acs_user_id")] + public string AcsUserId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) was deleted. + /// + public sealed record EventAcsUserDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_user.deleted"; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the affected access system user. + /// + [JsonPropertyName("acs_user_id")] + public string AcsUserId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) was added. + /// + public sealed record EventAcsEncoderAdded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_encoder.added"; + + /// + /// ID of the affected encoder. + /// + [JsonPropertyName("acs_encoder_id")] + public string AcsEncoderId { get; init; } = default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) was removed. + /// + public sealed record EventAcsEncoderRemoved : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_encoder.removed"; + + /// + /// ID of the affected encoder. + /// + [JsonPropertyName("acs_encoder_id")] + public string AcsEncoderId { get; init; } = default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An ACS access group was deleted. + /// + public sealed record EventAcsAccessGroupDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_access_group.deleted"; + + /// + /// ID of the affected access group. + /// + [JsonPropertyName("acs_access_group_id")] + public string AcsAccessGroupId { get; init; } = default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) was added. + /// + public sealed record EventAcsEntranceAdded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_entrance.added"; + + /// + /// ID of the affected entrance. + /// + [JsonPropertyName("acs_entrance_id")] + public string AcsEntranceId { get; init; } = default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// An [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) was removed. + /// + public sealed record EventAcsEntranceRemoved : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "acs_entrance.removed"; + + /// + /// ID of the affected entrance. + /// + [JsonPropertyName("acs_entrance_id")] + public string AcsEntranceId { get; init; } = default!; + + /// + /// ID of the access system. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the connected account. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + } + + /// + /// A client session was deleted. + /// + public sealed record EventClientSessionDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "client_session.deleted"; + + /// + /// ID of the affected client session. + /// + [JsonPropertyName("client_session_id")] + public string ClientSessionId { get; init; } = default!; + } + + /// + /// A connected account was connected for the first time or was reconnected after being disconnected. + /// + public sealed record EventConnectedAccountConnected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "connected_account.connected"; + + /// + /// ID of the Connect Webview associated with the event. + /// + [JsonPropertyName("connect_webview_id")] + public string? ConnectWebviewId { get; init; } + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the affected connected account. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with this connected account, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + } + + /// + /// A connected account was created. + /// + public sealed record EventConnectedAccountCreated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "connected_account.created"; + + /// + /// ID of the Connect Webview associated with the event. + /// + [JsonPropertyName("connect_webview_id")] + public string ConnectWebviewId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the affected connected account. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + } + + /// + /// A connected account had a successful login using a Connect Webview. + /// + [Obsolete("Use `connect_webview.login_succeeded`.")] + public sealed record EventConnectedAccountSuccessfulLogin : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "connected_account.successful_login"; + + /// + /// ID of the Connect Webview associated with the event. + /// + [JsonPropertyName("connect_webview_id")] + public string ConnectWebviewId { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the affected connected account. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + } + + /// + /// A connected account was disconnected. + /// + public sealed record EventConnectedAccountDisconnected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "connected_account.disconnected"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the affected connected account. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + } + + public sealed record EventConnectedAccountDisconnectedConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventConnectedAccountDisconnectedConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// A connected account completed the first sync with Seam, and the corresponding devices or systems are now available. + /// + public sealed record EventConnectedAccountCompletedFirstSync : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "connected_account.completed_first_sync"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the affected connected account. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + } + + /// + /// A connected account was deleted. + /// + public sealed record EventConnectedAccountDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "connected_account.deleted"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the affected connected account. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with this connected account, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + } + + /// + /// A connected account completed the first sync after reconnection with Seam, and the corresponding devices or systems are now available. + /// + public sealed record EventConnectedAccountCompletedFirstSyncAfterReconnection : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = + "connected_account.completed_first_sync_after_reconnection"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the affected connected account. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + } + + /// + /// A connected account requires reauthorization using a new Connect Webview. The account is still connected, but cannot access new features. Delaying reauthorization too long will eventually cause the Connected Account to become disconnected. + /// + public sealed record EventConnectedAccountReauthorizationRequested : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "connected_account.reauthorization_requested"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the affected connected account. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + } + + public sealed record EventConnectedAccountReauthorizationRequestedConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventConnectedAccountReauthorizationRequestedConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// A lock door action attempt succeeded. + /// + public sealed record EventActionAttemptLockDoorSucceeded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "action_attempt.lock_door.succeeded"; + + /// + /// ID of the affected action attempt. + /// + [JsonPropertyName("action_attempt_id")] + public string ActionAttemptId { get; init; } = default!; + + /// + /// Type of the action. + /// + [JsonPropertyName("action_type")] + public string ActionType { get; init; } = default!; + + /// + /// ID of the connected account associated with the action attempt, if applicable. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// ID of the device associated with the action attempt, if applicable. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Status of the action. + /// + [JsonPropertyName("status")] + public string Status { get; init; } = default!; + } + + /// + /// A lock door action attempt failed. + /// + public sealed record EventActionAttemptLockDoorFailed : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "action_attempt.lock_door.failed"; + + /// + /// ID of the affected action attempt. + /// + [JsonPropertyName("action_attempt_id")] + public string ActionAttemptId { get; init; } = default!; + + /// + /// Type of the action. + /// + [JsonPropertyName("action_type")] + public string ActionType { get; init; } = default!; + + /// + /// ID of the connected account associated with the action attempt, if applicable. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// ID of the device associated with the action attempt, if applicable. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Status of the action. + /// + [JsonPropertyName("status")] + public string Status { get; init; } = default!; + } + + /// + /// An unlock door action attempt succeeded. + /// + public sealed record EventActionAttemptUnlockDoorSucceeded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "action_attempt.unlock_door.succeeded"; + + /// + /// ID of the affected action attempt. + /// + [JsonPropertyName("action_attempt_id")] + public string ActionAttemptId { get; init; } = default!; + + /// + /// Type of the action. + /// + [JsonPropertyName("action_type")] + public string ActionType { get; init; } = default!; + + /// + /// ID of the connected account associated with the action attempt, if applicable. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// ID of the device associated with the action attempt, if applicable. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Status of the action. + /// + [JsonPropertyName("status")] + public string Status { get; init; } = default!; + } + + /// + /// An unlock door action attempt failed. + /// + public sealed record EventActionAttemptUnlockDoorFailed : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "action_attempt.unlock_door.failed"; + + /// + /// ID of the affected action attempt. + /// + [JsonPropertyName("action_attempt_id")] + public string ActionAttemptId { get; init; } = default!; + + /// + /// Type of the action. + /// + [JsonPropertyName("action_type")] + public string ActionType { get; init; } = default!; + + /// + /// ID of the connected account associated with the action attempt, if applicable. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// ID of the device associated with the action attempt, if applicable. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Status of the action. + /// + [JsonPropertyName("status")] + public string Status { get; init; } = default!; + } + + /// + /// A simulate keypad code entry action attempt succeeded. + /// + public sealed record EventActionAttemptSimulateKeypadCodeEntrySucceeded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = + "action_attempt.simulate_keypad_code_entry.succeeded"; + + /// + /// ID of the affected action attempt. + /// + [JsonPropertyName("action_attempt_id")] + public string ActionAttemptId { get; init; } = default!; + + /// + /// Type of the action. + /// + [JsonPropertyName("action_type")] + public string ActionType { get; init; } = default!; + + /// + /// ID of the connected account associated with the action attempt, if applicable. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// ID of the device associated with the action attempt, if applicable. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Status of the action. + /// + [JsonPropertyName("status")] + public string Status { get; init; } = default!; + } + + /// + /// A simulate keypad code entry action attempt failed. + /// + public sealed record EventActionAttemptSimulateKeypadCodeEntryFailed : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = + "action_attempt.simulate_keypad_code_entry.failed"; + + /// + /// ID of the affected action attempt. + /// + [JsonPropertyName("action_attempt_id")] + public string ActionAttemptId { get; init; } = default!; + + /// + /// Type of the action. + /// + [JsonPropertyName("action_type")] + public string ActionType { get; init; } = default!; + + /// + /// ID of the connected account associated with the action attempt, if applicable. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// ID of the device associated with the action attempt, if applicable. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Status of the action. + /// + [JsonPropertyName("status")] + public string Status { get; init; } = default!; + } + + /// + /// A simulate manual lock via keypad action attempt succeeded. + /// + public sealed record EventActionAttemptSimulateManualLockViaKeypadSucceeded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = + "action_attempt.simulate_manual_lock_via_keypad.succeeded"; + + /// + /// ID of the affected action attempt. + /// + [JsonPropertyName("action_attempt_id")] + public string ActionAttemptId { get; init; } = default!; + + /// + /// Type of the action. + /// + [JsonPropertyName("action_type")] + public string ActionType { get; init; } = default!; + + /// + /// ID of the connected account associated with the action attempt, if applicable. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// ID of the device associated with the action attempt, if applicable. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Status of the action. + /// + [JsonPropertyName("status")] + public string Status { get; init; } = default!; + } + + /// + /// A simulate manual lock via keypad action attempt failed. + /// + public sealed record EventActionAttemptSimulateManualLockViaKeypadFailed : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = + "action_attempt.simulate_manual_lock_via_keypad.failed"; + + /// + /// ID of the affected action attempt. + /// + [JsonPropertyName("action_attempt_id")] + public string ActionAttemptId { get; init; } = default!; + + /// + /// Type of the action. + /// + [JsonPropertyName("action_type")] + public string ActionType { get; init; } = default!; + + /// + /// ID of the connected account associated with the action attempt, if applicable. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// ID of the device associated with the action attempt, if applicable. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Status of the action. + /// + [JsonPropertyName("status")] + public string Status { get; init; } = default!; + } + + /// + /// A Connect Webview login succeeded. + /// + public sealed record EventConnectWebviewLoginSucceeded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "connect_webview.login_succeeded"; + + /// + /// ID of the affected Connect Webview. + /// + [JsonPropertyName("connect_webview_id")] + public string ConnectWebviewId { get; init; } = default!; + + /// + /// Custom metadata of the connected account; present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with this connect webview, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + } + + /// + /// A Connect Webview login failed. + /// + public sealed record EventConnectWebviewLoginFailed : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "connect_webview.login_failed"; + + /// + /// ID of the affected Connect Webview. + /// + [JsonPropertyName("connect_webview_id")] + public string ConnectWebviewId { get; init; } = default!; + } + + /// + /// The status of a device changed from offline to online. That is, the `device.properties.online` property changed from `false` to `true`. Note that some devices operate entirely in offline mode, so Seam never emits a `device.connected` event for these devices. + /// + public sealed record EventDeviceConnected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.connected"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A device was added to Seam or was re-added to Seam after having been removed. + /// + public sealed record EventDeviceAdded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.added"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A managed device was successfully converted to an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). + /// + public sealed record EventDeviceConvertedToUnmanaged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.converted_to_unmanaged"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices) was successfully converted to a managed device. + /// + public sealed record EventDeviceUnmanagedConvertedToManaged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.unmanaged.converted_to_managed"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// The status of an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices) changed from offline to online. That is, the `device.properties.online` property changed from `false` to `true`. + /// + public sealed record EventDeviceUnmanagedConnected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.unmanaged.connected"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// The status of a device changed from online to offline. That is, the `device.properties.online` property changed from `true` to `false`. + /// + public sealed record EventDeviceDisconnected : Event + { + /// + /// Error code associated with the disconnection event, if any. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ErrorCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "account_disconnected")] + AccountDisconnected = 1, + + [EnumMember(Value = "hub_disconnected")] + HubDisconnected = 2, + + [EnumMember(Value = "device_disconnected")] + DeviceDisconnected = 3, + } + + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.disconnected"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = default!; + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = default!; + + /// + /// Error code associated with the disconnection event, if any. + /// + [JsonPropertyName("error_code")] + public EventDeviceDisconnected.ErrorCodeEnum ErrorCode { get; init; } = default!; + } + + public sealed record EventDeviceDisconnectedConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceDisconnectedConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventDeviceDisconnectedDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceDisconnectedDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// The status of an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices) changed from online to offline. That is, the `device.properties.online` property changed from `true` to `false`. + /// + public sealed record EventDeviceUnmanagedDisconnected : Event + { + /// + /// Error code associated with the disconnection event, if any. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ErrorCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "account_disconnected")] + AccountDisconnected = 1, + + [EnumMember(Value = "hub_disconnected")] + HubDisconnected = 2, + + [EnumMember(Value = "device_disconnected")] + DeviceDisconnected = 3, + } + + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.unmanaged.disconnected"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = + default!; + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = + default!; + + /// + /// Error code associated with the disconnection event, if any. + /// + [JsonPropertyName("error_code")] + public EventDeviceUnmanagedDisconnected.ErrorCodeEnum ErrorCode { get; init; } = default!; + } + + public sealed record EventDeviceUnmanagedDisconnectedConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceUnmanagedDisconnectedConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventDeviceUnmanagedDisconnectedDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceUnmanagedDisconnectedDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// A device detected that it was tampered with, for example, opened or moved. + /// + public sealed record EventDeviceTampered : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.tampered"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A device battery level dropped below the low threshold. + /// + public sealed record EventDeviceLowBattery : Event + { + /// + /// Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum BatterySourceEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "lock")] + Lock = 1, + + [EnumMember(Value = "accessory_keypad")] + AccessoryKeypad = 2, + } + + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.low_battery"; + + /// + /// Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. + /// + [JsonPropertyName("battery_level")] + public float BatteryLevel { get; init; } = default!; + + /// + /// Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. + /// + [JsonPropertyName("battery_source")] + public EventDeviceLowBattery.BatterySourceEnum? BatterySource { get; init; } + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A device battery status changed since the last `battery_status_changed` event. + /// + public sealed record EventDeviceBatteryStatusChanged : Event + { + /// + /// Battery status of the affected device, calculated from the numeric `battery_level` value. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum BatteryStatusEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "critical")] + Critical = 1, + + [EnumMember(Value = "low")] + Low = 2, + + [EnumMember(Value = "good")] + Good = 3, + + [EnumMember(Value = "full")] + Full = 4, + } + + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.battery_status_changed"; + + /// + /// Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. + /// + [JsonPropertyName("battery_level")] + public float BatteryLevel { get; init; } = default!; + + /// + /// Battery status of the affected device, calculated from the numeric `battery_level` value. + /// + [JsonPropertyName("battery_status")] + public EventDeviceBatteryStatusChanged.BatteryStatusEnum BatteryStatus { get; init; } = + default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A device was removed externally from the connected account. + /// + public sealed record EventDeviceRemoved : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.removed"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A device was deleted. + /// + public sealed record EventDeviceDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.deleted"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Name of the deleted device, captured at deletion time. The device record no longer exists when this event fires, so the name is preserved here. Null when the device had no resolvable name. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + } + + /// + /// Seam detected that a device is using a third-party integration that will interfere with Seam device management. + /// + public sealed record EventDeviceThirdPartyIntegrationDetected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.third_party_integration_detected"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// Seam detected that a device is no longer using a third-party integration that was interfering with Seam device management. + /// + public sealed record EventDeviceThirdPartyIntegrationNoLongerDetected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = + "device.third_party_integration_no_longer_detected"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A [Salto device](https://docs.seam.co/device-and-system-integration-guides/salto-locks) activated privacy mode. + /// + public sealed record EventDeviceSaltoPrivacyModeActivated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.salto.privacy_mode_activated"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A [Salto device](https://docs.seam.co/device-and-system-integration-guides/salto-locks) deactivated privacy mode. + /// + public sealed record EventDeviceSaltoPrivacyModeDeactivated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.salto.privacy_mode_deactivated"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// Seam detected a flaky device connection. + /// + public sealed record EventDeviceConnectionBecameFlaky : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.connection_became_flaky"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = + default!; + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = + default!; + } + + public sealed record EventDeviceConnectionBecameFlakyConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceConnectionBecameFlakyConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventDeviceConnectionBecameFlakyDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceConnectionBecameFlakyDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// Seam detected that a previously-flaky device connection stabilized. + /// + public sealed record EventDeviceConnectionStabilized : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.connection_stabilized"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A third-party subscription is required to use all device features. + /// + public sealed record EventDeviceErrorSubscriptionRequired : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.error.subscription_required"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = + default!; + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = + default!; + } + + public sealed record EventDeviceErrorSubscriptionRequiredConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceErrorSubscriptionRequiredConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventDeviceErrorSubscriptionRequiredDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceErrorSubscriptionRequiredDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// A third-party subscription is active or no longer required to use all device features. + /// + public sealed record EventDeviceErrorSubscriptionRequiredResolved : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.error.subscription_required.resolved"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An accessory keypad was connected to a device. + /// + public sealed record EventDeviceAccessoryKeypadConnected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.accessory_keypad_connected"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// An accessory keypad was disconnected from a device. + /// + public sealed record EventDeviceAccessoryKeypadDisconnected : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.accessory_keypad_disconnected"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// Errors associated with the connected account. + /// + [JsonPropertyName("connected_account_errors")] + public List ConnectedAccountErrors { get; init; } = + default!; + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Warnings associated with the connected account. + /// + [JsonPropertyName("connected_account_warnings")] + public List ConnectedAccountWarnings { get; init; } = + default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// Errors associated with the device. + /// + [JsonPropertyName("device_errors")] + public List DeviceErrors { get; init; } = + default!; + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Warnings associated with the device. + /// + [JsonPropertyName("device_warnings")] + public List DeviceWarnings { get; init; } = + default!; + } + + public sealed record EventDeviceAccessoryKeypadDisconnectedConnectedAccountErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceAccessoryKeypadDisconnectedConnectedAccountWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + public sealed record EventDeviceAccessoryKeypadDisconnectedDeviceErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record EventDeviceAccessoryKeypadDisconnectedDeviceWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } + + /// + /// Extended periods of noise or noise exceeding a [threshold](https://docs.seam.co/capability-guides/noise-sensors#what-is-a-threshold) were detected. + /// + public sealed record EventNoiseSensorNoiseThresholdTriggered : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "noise_sensor.noise_threshold_triggered"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Metadata from Minut. + /// + [JsonPropertyName("minut_metadata")] + public object? MinutMetadata { get; init; } + + /// + /// Detected noise level in decibels. + /// + [JsonPropertyName("noise_level_decibels")] + public float? NoiseLevelDecibels { get; init; } + + /// + /// Detected noise level in Noiseaware Noise Risk Score (NRS). + /// + [JsonPropertyName("noise_level_nrs")] + public float? NoiseLevelNrs { get; init; } + + /// + /// ID of the noise threshold that was triggered. + /// + [JsonPropertyName("noise_threshold_id")] + public string? NoiseThresholdId { get; init; } + + /// + /// Name of the noise threshold that was triggered. + /// + [JsonPropertyName("noise_threshold_name")] + public string? NoiseThresholdName { get; init; } + + /// + /// Metadata from Noiseaware. + /// + [JsonPropertyName("noiseaware_metadata")] + public object? NoiseawareMetadata { get; init; } + } + + /// + /// A [lock](https://docs.seam.co/low-level-apis/smart-locks) was locked. + /// + public sealed record EventLockLocked : Event + { + /// + /// Method by which the lock was locked. `keycode`: an access code was used (see `access_code_id`). `manual`: a physical action such as a thumbturn or button press. `remote`: a remote action via an app, Bluetooth, or the Seam API (see `action_attempt_id` if Seam-initiated; see `is_via_bluetooth` or `is_via_nfc` for the transport). `automatic`: triggered automatically, for example by an auto-relock timer. `unknown`: could not be determined. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum MethodEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "keycode")] + Keycode = 1, + + [EnumMember(Value = "manual")] + Manual = 2, + + [EnumMember(Value = "automatic")] + Automatic = 3, + + [EnumMember(Value = "unknown")] + Unknown = 4, + + [EnumMember(Value = "remote")] + Remote = 5, + + [EnumMember(Value = "card")] + Card = 6, + } + + [JsonPropertyName("event_type")] + public override string EventType { get; } = "lock.locked"; + + /// + /// ID of the access code that was used to lock the device. + /// + [JsonPropertyName("access_code_id")] + public string? AccessCodeId { get; init; } + + /// + /// Whether the access code is managed by Seam (true) or unmanaged (false). Only present when access_code_id is set. + /// + [JsonPropertyName("access_code_is_managed")] + public bool? AccessCodeIsManaged { get; init; } + + /// + /// ID of the Seam action attempt that triggered this lock. Present only when the lock was initiated through Seam (via a `LOCK_DOOR` action attempt). + /// + [JsonPropertyName("action_attempt_id")] + public string? ActionAttemptId { get; init; } + + /// + /// Code (PIN) that was used to lock the device, if known. Taken from the matched managed or unmanaged access code, or from the code reported by the provider when no access code matched. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Whether the lock action was performed over Bluetooth by a remote client (such as the provider's mobile app), rather than a direct physical interaction or a Seam-initiated remote action. + /// + [JsonPropertyName("is_via_bluetooth")] + public bool? IsViaBluetooth { get; init; } + + /// + /// Whether the lock action was performed by an NFC credential tap (such as an Apple Home Key or an NFC key fob) presented to the lock, rather than a direct physical interaction or a Seam-initiated remote action. + /// + [JsonPropertyName("is_via_nfc")] + public bool? IsViaNfc { get; init; } + + /// + /// Method by which the lock was locked. `keycode`: an access code was used (see `access_code_id`). `manual`: a physical action such as a thumbturn or button press. `remote`: a remote action via an app, Bluetooth, or the Seam API (see `action_attempt_id` if Seam-initiated; see `is_via_bluetooth` or `is_via_nfc` for the transport). `automatic`: triggered automatically, for example by an auto-relock timer. `unknown`: could not be determined. + /// + [JsonPropertyName("method")] + public EventLockLocked.MethodEnum Method { get; init; } = default!; + } + + /// + /// A [lock](https://docs.seam.co/low-level-apis/smart-locks) was unlocked. + /// + public sealed record EventLockUnlocked : Event + { + /// + /// Method by which the lock was unlocked. `keycode`: an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was used (see `access_code_id`). `manual`: a physical action such as a thumbturn or handle press. `remote`: a remote action via an app, Bluetooth, or the Seam API (see `action_attempt_id` if Seam-initiated; see `is_via_bluetooth` or `is_via_nfc` for the transport). `automatic`: triggered automatically, for example by a time-based schedule. `unknown`: could not be determined. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum MethodEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "keycode")] + Keycode = 1, + + [EnumMember(Value = "manual")] + Manual = 2, + + [EnumMember(Value = "automatic")] + Automatic = 3, + + [EnumMember(Value = "unknown")] + Unknown = 4, + + [EnumMember(Value = "remote")] + Remote = 5, + + [EnumMember(Value = "card")] + Card = 6, + } + + [JsonPropertyName("event_type")] + public override string EventType { get; } = "lock.unlocked"; + + /// + /// ID of the access code that was used to unlock the affected device. + /// + [JsonPropertyName("access_code_id")] + public string? AccessCodeId { get; init; } + + /// + /// Whether the access code is managed by Seam (true) or unmanaged (false). Only present when access_code_id is set. + /// + [JsonPropertyName("access_code_is_managed")] + public bool? AccessCodeIsManaged { get; init; } + + /// + /// ID of the Seam action attempt that triggered this unlock. Present only when the unlock was initiated through Seam (via an `UNLOCK_DOOR` action attempt). + /// + [JsonPropertyName("action_attempt_id")] + public string? ActionAttemptId { get; init; } + + /// + /// Code (PIN) that was used to unlock the affected device, if known. Taken from the matched managed or unmanaged access code, or from the code reported by the provider when no access code matched. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Whether the unlock action was performed over Bluetooth by a remote client (such as the provider's mobile app), rather than a direct physical interaction or a Seam-initiated remote action. + /// + [JsonPropertyName("is_via_bluetooth")] + public bool? IsViaBluetooth { get; init; } + + /// + /// Whether the unlock action was performed by an NFC credential tap (such as an Apple Home Key or an NFC key fob) presented to the lock, rather than a direct physical interaction or a Seam-initiated remote action. + /// + [JsonPropertyName("is_via_nfc")] + public bool? IsViaNfc { get; init; } + + /// + /// Method by which the lock was unlocked. `keycode`: an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was used (see `access_code_id`). `manual`: a physical action such as a thumbturn or handle press. `remote`: a remote action via an app, Bluetooth, or the Seam API (see `action_attempt_id` if Seam-initiated; see `is_via_bluetooth` or `is_via_nfc` for the transport). `automatic`: triggered automatically, for example by a time-based schedule. `unknown`: could not be determined. + /// + [JsonPropertyName("method")] + public EventLockUnlocked.MethodEnum Method { get; init; } = default!; + } + + /// + /// The [lock](https://docs.seam.co/low-level-apis/smart-locks) denied access to a user after one or more consecutive invalid attempts to unlock the device. + /// + public sealed record EventLockAccessDenied : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "lock.access_denied"; + + /// + /// ID of the access code that was used in the unlock attempts. + /// + [JsonPropertyName("access_code_id")] + public string? AccessCodeId { get; init; } + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Why access was denied, when the provider reports a determinable cause. Omitted when unknown. + /// + [JsonPropertyName("reason")] + public EventLockAccessDeniedReason? Reason { get; init; } + } + + public sealed record EventLockAccessDeniedReason + { + /// + /// Normalized reason a lock denied access. Provider-agnostic; not all providers report every value. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ReasonCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "unknown_code")] + UnknownCode = 1, + + [EnumMember(Value = "expired_code")] + ExpiredCode = 2, + + [EnumMember(Value = "blocklisted_code")] + BlocklistedCode = 3, + + [EnumMember(Value = "too_many_attempts")] + TooManyAttempts = 4, + + [EnumMember(Value = "blocked_by_privacy_mode")] + BlockedByPrivacyMode = 5, + + [EnumMember(Value = "credential_error")] + CredentialError = 6, + } + + /// + /// Human-readable explanation of why access was denied. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Normalized reason a lock denied access. Provider-agnostic; not all providers report every value. + /// + [JsonPropertyName("reason_code")] + public EventLockAccessDeniedReason.ReasonCodeEnum ReasonCode { get; init; } = default!; + } + + /// + /// A thermostat [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) was activated. + /// + public sealed record EventThermostatClimatePresetActivated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "thermostat.climate_preset_activated"; + + /// + /// Key of the climate preset that was activated. + /// + [JsonPropertyName("climate_preset_key")] + public string ClimatePresetKey { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Indicates whether the climate preset that was activated is the fallback climate preset for the thermostat. + /// + [JsonPropertyName("is_fallback_climate_preset")] + public bool IsFallbackClimatePreset { get; init; } = default!; + + /// + /// ID of the thermostat schedule that prompted the affected climate preset to be activated. + /// + [JsonPropertyName("thermostat_schedule_id")] + public string? ThermostatScheduleId { get; init; } + } + + /// + /// A [thermostat](https://docs.seam.co/capability-guides/thermostats) was adjusted manually. + /// + public sealed record EventThermostatManuallyAdjusted : Event + { + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum FanModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum HvacModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "off")] + Off = 1, + + [EnumMember(Value = "heat")] + Heat = 2, + + [EnumMember(Value = "cool")] + Cool = 3, + + [EnumMember(Value = "heat_cool")] + HeatCool = 4, + + [EnumMember(Value = "eco")] + Eco = 5, + } + + /// + /// Method used to adjust the affected thermostat manually. `seam` indicates that the Seam API, Seam CLI, or Seam Console was used to adjust the thermostat. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum MethodEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "seam")] + Seam = 1, + + [EnumMember(Value = "external")] + External = 2, + } + + [JsonPropertyName("event_type")] + public override string EventType { get; } = "thermostat.manually_adjusted"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonPropertyName("fan_mode_setting")] + public EventThermostatManuallyAdjusted.FanModeSettingEnum? FanModeSetting { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonPropertyName("hvac_mode_setting")] + public EventThermostatManuallyAdjusted.HvacModeSettingEnum? HvacModeSetting { get; init; } + + /// + /// Method used to adjust the affected thermostat manually. `seam` indicates that the Seam API, Seam CLI, or Seam Console was used to adjust the thermostat. + /// + [JsonPropertyName("method")] + public EventThermostatManuallyAdjusted.MethodEnum Method { get; init; } = default!; + } + + /// + /// A [thermostat's](https://docs.seam.co/capability-guides/thermostats) temperature reading exceeded the set [threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds). + /// + public sealed record EventThermostatTemperatureThresholdExceeded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "thermostat.temperature_threshold_exceeded"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Lower temperature limit, in °C, defined by the set threshold. + /// + [JsonPropertyName("lower_limit_celsius")] + public float? LowerLimitCelsius { get; init; } + + /// + /// Lower temperature limit, in °F, defined by the set threshold. + /// + [JsonPropertyName("lower_limit_fahrenheit")] + public float? LowerLimitFahrenheit { get; init; } + + /// + /// Temperature, in °C, reported by the affected thermostat. + /// + [JsonPropertyName("temperature_celsius")] + public float TemperatureCelsius { get; init; } = default!; + + /// + /// Temperature, in °F, reported by the affected thermostat. + /// + [JsonPropertyName("temperature_fahrenheit")] + public float TemperatureFahrenheit { get; init; } = default!; + + /// + /// Upper temperature limit, in °C, defined by the set threshold. + /// + [JsonPropertyName("upper_limit_celsius")] + public float? UpperLimitCelsius { get; init; } + + /// + /// Upper temperature limit, in °F, defined by the set threshold. + /// + [JsonPropertyName("upper_limit_fahrenheit")] + public float? UpperLimitFahrenheit { get; init; } + } + + /// + /// A [thermostat's](https://docs.seam.co/capability-guides/thermostats) temperature reading no longer exceeds the set [threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds). + /// + public sealed record EventThermostatTemperatureThresholdNoLongerExceeded : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = + "thermostat.temperature_threshold_no_longer_exceeded"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Lower temperature limit, in °C, defined by the set threshold. + /// + [JsonPropertyName("lower_limit_celsius")] + public float? LowerLimitCelsius { get; init; } + + /// + /// Lower temperature limit, in °F, defined by the set threshold. + /// + [JsonPropertyName("lower_limit_fahrenheit")] + public float? LowerLimitFahrenheit { get; init; } + + /// + /// Temperature, in °C, reported by the affected thermostat. + /// + [JsonPropertyName("temperature_celsius")] + public float TemperatureCelsius { get; init; } = default!; + + /// + /// Temperature, in °F, reported by the affected thermostat. + /// + [JsonPropertyName("temperature_fahrenheit")] + public float TemperatureFahrenheit { get; init; } = default!; + + /// + /// Upper temperature limit, in °C, defined by the set threshold. + /// + [JsonPropertyName("upper_limit_celsius")] + public float? UpperLimitCelsius { get; init; } + + /// + /// Upper temperature limit, in °F, defined by the set threshold. + /// + [JsonPropertyName("upper_limit_fahrenheit")] + public float? UpperLimitFahrenheit { get; init; } + } + + /// + /// A [thermostat's](https://docs.seam.co/capability-guides/thermostats) temperature reading is within 1 °C of the configured cooling or heating [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + public sealed record EventThermostatTemperatureReachedSetPoint : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "thermostat.temperature_reached_set_point"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Desired temperature, in °C, defined by the affected thermostat's cooling or heating set point. + /// + [JsonPropertyName("desired_temperature_celsius")] + public float? DesiredTemperatureCelsius { get; init; } + + /// + /// Desired temperature, in °F, defined by the affected thermostat's cooling or heating set point. + /// + [JsonPropertyName("desired_temperature_fahrenheit")] + public float? DesiredTemperatureFahrenheit { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Temperature, in °C, reported by the affected thermostat. + /// + [JsonPropertyName("temperature_celsius")] + public float TemperatureCelsius { get; init; } = default!; + + /// + /// Temperature, in °F, reported by the affected thermostat. + /// + [JsonPropertyName("temperature_fahrenheit")] + public float TemperatureFahrenheit { get; init; } = default!; + } + + /// + /// A [thermostat's](https://docs.seam.co/capability-guides/thermostats) reported temperature changed by at least 1 °C. + /// + public sealed record EventThermostatTemperatureChanged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "thermostat.temperature_changed"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Temperature, in °C, reported by the affected thermostat. + /// + [JsonPropertyName("temperature_celsius")] + public float TemperatureCelsius { get; init; } = default!; + + /// + /// Temperature, in °F, reported by the affected thermostat. + /// + [JsonPropertyName("temperature_fahrenheit")] + public float TemperatureFahrenheit { get; init; } = default!; + } + + /// + /// The name of a device was changed. + /// + public sealed record EventDeviceNameChanged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.name_changed"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// The new name of the affected device. + /// + [JsonPropertyName("device_name")] + public string DeviceName { get; init; } = default!; + } + + /// + /// A camera was activated, for example, by motion detection. + /// + public sealed record EventCameraActivated : Event + { + /// + /// The reason the camera was activated. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ActivationReasonEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "motion_detected")] + MotionDetected = 1, + } + + /// + /// Sub-type of motion detected, if available. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum MotionSubTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "human")] + Human = 1, + + [EnumMember(Value = "vehicle")] + Vehicle = 2, + + [EnumMember(Value = "package")] + Package = 3, + + [EnumMember(Value = "other")] + Other = 4, + } + + [JsonPropertyName("event_type")] + public override string EventType { get; } = "camera.activated"; + + /// + /// The reason the camera was activated. + /// + [JsonPropertyName("activation_reason")] + public EventCameraActivated.ActivationReasonEnum ActivationReason { get; init; } = default!; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// URL to a thumbnail image captured at the time of activation. + /// + [JsonPropertyName("image_url")] + public string? ImageUrl { get; init; } + + /// + /// Sub-type of motion detected, if available. + /// + [JsonPropertyName("motion_sub_type")] + public EventCameraActivated.MotionSubTypeEnum? MotionSubType { get; init; } + + /// + /// URL to a short video clip captured at the time of activation. + /// + [JsonPropertyName("video_url")] + public string? VideoUrl { get; init; } + } + + /// + /// A doorbell button was pressed on a device. + /// + public sealed record EventDeviceDoorbellRang : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "device.doorbell_rang"; + + /// + /// Custom metadata of the connected account, present when connected_account_id is provided. + /// + [JsonPropertyName("connected_account_custom_metadata")] + public object? ConnectedAccountCustomMetadata { get; init; } + + /// + /// ID of the connected account associated with the event. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// The customer key associated with the device, if any. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Custom metadata of the device, present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// URL to a thumbnail image captured at the time the doorbell was pressed. + /// + [JsonPropertyName("image_url")] + public string? ImageUrl { get; init; } + + /// + /// URL to a short video clip captured at the time the doorbell was pressed. + /// + [JsonPropertyName("video_url")] + public string? VideoUrl { get; init; } + } + + /// + /// A phone device was deactivated. + /// + public sealed record EventPhoneDeactivated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "phone.deactivated"; + + /// + /// Custom metadata of the device; present when device_id is provided. + /// + [JsonPropertyName("device_custom_metadata")] + public object? DeviceCustomMetadata { get; init; } + + /// + /// ID of the affected phone device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + /// + /// A device was added or removed from a space. + /// + public sealed record EventSpaceDeviceMembershipChanged : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "space.device_membership_changed"; + + /// + /// IDs of all ACS entrances currently attached to the space. + /// + [JsonPropertyName("acs_entrance_ids")] + public List AcsEntranceIds { get; init; } = default!; + + /// + /// IDs of all devices currently attached to the space. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + + /// + /// ID of the affected space. + /// + [JsonPropertyName("space_id")] + public string SpaceId { get; init; } = default!; + + /// + /// Unique key for the space within the workspace. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + } + + /// + /// A space was created. + /// + public sealed record EventSpaceCreated : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "space.created"; + + /// + /// IDs of all ACS entrances attached to the space when it was created. + /// + [JsonPropertyName("acs_entrance_ids")] + public List AcsEntranceIds { get; init; } = default!; + + /// + /// IDs of all devices attached to the space when it was created. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + + /// + /// ID of the affected space. + /// + [JsonPropertyName("space_id")] + public string SpaceId { get; init; } = default!; + + /// + /// Unique key for the space within the workspace. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + } + + /// + /// A space was deleted. + /// + public sealed record EventSpaceDeleted : Event + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "space.deleted"; + + /// + /// IDs of all ACS entrances currently attached to the space when it was deleted. + /// + [JsonPropertyName("acs_entrance_ids")] + public List AcsEntranceIds { get; init; } = default!; + + /// + /// IDs of all devices attached to the space when it was deleted. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + + /// + /// ID of the affected space. + /// + [JsonPropertyName("space_id")] + public string SpaceId { get; init; } = default!; + + /// + /// Unique key for the space within the workspace. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + } + + public sealed record EventUnrecognized : Event, ISeamUnrecognizedVariant + { + [JsonPropertyName("event_type")] + public override string EventType { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } +} diff --git a/src/Seam/Models/InstantKey.cs b/src/Seam/Models/InstantKey.cs new file mode 100644 index 00000000..30832c91 --- /dev/null +++ b/src/Seam/Models/InstantKey.cs @@ -0,0 +1,94 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a Seam Instant Key. For issuing Bluetooth mobile keys, Instant Keys are the fastest way to share access. With a single API call, you can create a mobile key and send it through text or email or embed it in your own app. + /// + /// There’s no app to install, nor account to create. Your user just taps a link and gets a lightweight, native-feeling experience using iOS App Clip or Instant Apps on Android. Further, Instant Keys work offline, so even in areas with poor cellular or Wi-Fi, like elevator banks or concrete-walled hallways, the Instant Keys still work. + /// + public sealed record InstantKey + { + /// + /// ID of the client session associated with the Instant Key. + /// + [JsonPropertyName("client_session_id")] + public string ClientSessionId { get; init; } = default!; + + /// + /// Date and time at which the Instant Key was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Customization applied to the Instant Key UI. + /// + [JsonPropertyName("customization")] + public InstantKeyCustomization? Customization { get; init; } + + /// + /// ID of the customization profile associated with the Instant Key. + /// + [JsonPropertyName("customization_profile_id")] + public string? CustomizationProfileId { get; init; } + + /// + /// Date and time at which the Instant Key expires. + /// + [JsonPropertyName("expires_at")] + public string ExpiresAt { get; init; } = default!; + + /// + /// ID of the Instant Key. + /// + [JsonPropertyName("instant_key_id")] + public string InstantKeyId { get; init; } = default!; + + /// + /// Shareable URL for the Instant Key. Use the URL to deliver the Instant Key to your user through a link in a text message or email or by embedding it in your web app. + /// + [JsonPropertyName("instant_key_url")] + public string InstantKeyUrl { get; init; } = default!; + + /// + /// ID of the user identity associated with the Instant Key. + /// + [JsonPropertyName("user_identity_id")] + public string UserIdentityId { get; init; } = default!; + + /// + /// ID of the workspace that contains the Instant Key. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record InstantKeyCustomization + { + /// + /// URL of the logo displayed on the Instant Key. + /// + [JsonPropertyName("logo_url")] + public string? LogoUrl { get; init; } + + /// + /// Primary color used in the Instant Key UI. + /// + [JsonPropertyName("primary_color")] + public string? PrimaryColor { get; init; } + + /// + /// Secondary color used in the Instant Key UI. + /// + [JsonPropertyName("secondary_color")] + public string? SecondaryColor { get; init; } + } +} diff --git a/src/Seam/Models/NoiseThreshold.cs b/src/Seam/Models/NoiseThreshold.cs new file mode 100644 index 00000000..14fea7e2 --- /dev/null +++ b/src/Seam/Models/NoiseThreshold.cs @@ -0,0 +1,59 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + /// + public sealed record NoiseThreshold + { + /// + /// Unique identifier for the device that contains the noise threshold. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Time at which the noise threshold should become inactive daily. + /// + [JsonPropertyName("ends_daily_at")] + public string EndsDailyAt { get; init; } = default!; + + /// + /// Name of the noise threshold. + /// + [JsonPropertyName("name")] + public string Name { get; init; } = default!; + + /// + /// Noise level in decibels for the noise threshold. + /// + [JsonPropertyName("noise_threshold_decibels")] + public float NoiseThresholdDecibels { get; init; } = default!; + + /// + /// Unique identifier for the noise threshold. + /// + [JsonPropertyName("noise_threshold_id")] + public string NoiseThresholdId { get; init; } = default!; + + /// + /// Noise level in Noiseaware Noise Risk Score (NRS) for the noise threshold. This parameter is only relevant for [Noiseaware sensors](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors). + /// + [JsonPropertyName("noise_threshold_nrs")] + public float? NoiseThresholdNrs { get; init; } + + /// + /// Time at which the noise threshold should become active daily. + /// + [JsonPropertyName("starts_daily_at")] + public string StartsDailyAt { get; init; } = default!; + } +} diff --git a/src/Seam/Models/Phone.cs b/src/Seam/Models/Phone.cs new file mode 100644 index 00000000..55ec56fe --- /dev/null +++ b/src/Seam/Models/Phone.cs @@ -0,0 +1,189 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an app user's mobile phone. + /// + public sealed record Phone + { + /// + /// Type of the phone device, such as `ios_phone` or `android_phone`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "ios_phone")] + IosPhone = 1, + + [EnumMember(Value = "android_phone")] + AndroidPhone = 2, + } + + /// + /// Date and time at which the phone was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Optional [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for the phone. + /// + [JsonPropertyName("custom_metadata")] + public object CustomMetadata { get; init; } = default!; + + /// + /// ID of the phone. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Type of the phone device, such as `ios_phone` or `android_phone`. + /// + [JsonPropertyName("device_type")] + public Phone.DeviceTypeEnum DeviceType { get; init; } = default!; + + /// + /// Display name of the phone. Defaults to `nickname` (if it is set) or `properties.appearance.name`, otherwise. Enables administrators and users to identify the phone easily, especially when there are numerous phones. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Errors associated with the phone. + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Optional nickname to describe the phone, settable through Seam. + /// + [JsonPropertyName("nickname")] + public string? Nickname { get; init; } + + /// + /// Properties of the phone. + /// + [JsonPropertyName("properties")] + public PhoneProperties Properties { get; init; } = default!; + + /// + /// Warnings associated with the phone. + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the workspace that contains the phone. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record PhoneErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record PhoneProperties + { + /// + /// ASSA ABLOY Credential Service metadata for the phone. + /// + [JsonPropertyName("assa_abloy_credential_service_metadata")] + public PhonePropertiesAssaAbloyCredentialServiceMetadata? AssaAbloyCredentialServiceMetadata { get; init; } + + /// + /// Salto Space credential service metadata for the phone. + /// + [JsonPropertyName("salto_space_credential_service_metadata")] + public PhonePropertiesSaltoSpaceCredentialServiceMetadata? SaltoSpaceCredentialServiceMetadata { get; init; } + } + + public sealed record PhonePropertiesAssaAbloyCredentialServiceMetadata + { + /// + /// Endpoints associated with the phone. + /// + [JsonPropertyName("endpoints")] + public List? Endpoints { get; init; } + + /// + /// Indicates whether the credential service has active endpoints associated with the phone. + /// + [JsonPropertyName("has_active_endpoint")] + public bool? HasActiveEndpoint { get; init; } + } + + public sealed record PhonePropertiesAssaAbloyCredentialServiceMetadataEndpoints + { + /// + /// ID of the associated endpoint. + /// + [JsonPropertyName("endpoint_id")] + public string? EndpointId { get; init; } + + /// + /// Indicated whether the endpoint is active. + /// + [JsonPropertyName("is_active")] + public bool? IsActive { get; init; } + } + + public sealed record PhonePropertiesSaltoSpaceCredentialServiceMetadata + { + /// + /// Indicates whether the credential service has an active associated phone. + /// + [JsonPropertyName("has_active_phone")] + public bool? HasActivePhone { get; init; } + } + + public sealed record PhoneWarnings + { + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + + /// + /// Unique identifier of the type of warning. + /// + [JsonPropertyName("warning_code")] + public string WarningCode { get; init; } = default!; + } +} diff --git a/src/Seam/Models/Space.cs b/src/Seam/Models/Space.cs new file mode 100644 index 00000000..edc956a1 --- /dev/null +++ b/src/Seam/Models/Space.cs @@ -0,0 +1,125 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a space that is a logical grouping of devices and entrances. You can assign access to an entire space, thereby making granting access more efficient. + /// + public sealed record Space + { + /// + /// Number of entrances in the space. + /// + [JsonPropertyName("acs_entrance_count")] + public float AcsEntranceCount { get; init; } = default!; + + /// + /// Date and time at which the space was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Reservation/stay-related defaults for the space. Also carries the provider/PMS-supplied name under a `<connector_type>_name` key (e.g. `guesty_name`), which Seam preserves when you rename the space (read-only — managed by Seam). + /// + [JsonPropertyName("customer_data")] + public SpaceCustomerData? CustomerData { get; init; } + + /// + /// Customer key associated with the space. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Number of devices in the space. + /// + [JsonPropertyName("device_count")] + public float DeviceCount { get; init; } = default!; + + /// + /// Display name for the space. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Geographic coordinates (latitude and longitude) of the space. + /// + [JsonPropertyName("geolocation")] + public SpaceGeolocation? Geolocation { get; init; } + + /// + /// Name of the space. + /// + [JsonPropertyName("name")] + public string Name { get; init; } = default!; + + /// + /// ID of the space. + /// + [JsonPropertyName("space_id")] + public string SpaceId { get; init; } = default!; + + /// + /// Unique key for the space within the workspace. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + + /// + /// ID of the workspace associated with the space. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record SpaceCustomerData + { + /// + /// Postal address for the space. + /// + [JsonPropertyName("address")] + public string? Address { get; init; } + + /// + /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkin_time")] + public string? DefaultCheckinTime { get; init; } + + /// + /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkout_time")] + public string? DefaultCheckoutTime { get; init; } + + /// + /// IANA time zone for the space, e.g. America/Los_Angeles. + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + } + + public sealed record SpaceGeolocation + { + /// + /// Latitude of the space, in decimal degrees. + /// + [JsonPropertyName("latitude")] + public float Latitude { get; init; } = default!; + + /// + /// Longitude of the space, in decimal degrees. + /// + [JsonPropertyName("longitude")] + public float Longitude { get; init; } = default!; + } +} diff --git a/src/Seam/Models/ThermostatDailyProgram.cs b/src/Seam/Models/ThermostatDailyProgram.cs new file mode 100644 index 00000000..91861c92 --- /dev/null +++ b/src/Seam/Models/ThermostatDailyProgram.cs @@ -0,0 +1,68 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a thermostat daily program, consisting of a set of periods, each of which has a starting time and the key that identifies the climate preset to apply at the starting time. + /// + public sealed record ThermostatDailyProgram + { + /// + /// Date and time at which the thermostat daily program was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// ID of the thermostat device on which the thermostat daily program is configured. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// User-friendly name to identify the thermostat daily program. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Array of thermostat daily program periods. + /// + [JsonPropertyName("periods")] + public List Periods { get; init; } = default!; + + /// + /// ID of the thermostat daily program. + /// + [JsonPropertyName("thermostat_daily_program_id")] + public string ThermostatDailyProgramId { get; init; } = default!; + + /// + /// ID of the workspace that contains the thermostat daily program. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record ThermostatDailyProgramPeriods + { + /// + /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to activate at the `starts_at_time`. + /// + [JsonPropertyName("climate_preset_key")] + public string ClimatePresetKey { get; init; } = default!; + + /// + /// Time at which the thermostat daily program period starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at_time")] + public string StartsAtTime { get; init; } = default!; + } +} diff --git a/src/Seam/Models/ThermostatSchedule.cs b/src/Seam/Models/ThermostatSchedule.cs new file mode 100644 index 00000000..9dc88876 --- /dev/null +++ b/src/Seam/Models/ThermostatSchedule.cs @@ -0,0 +1,104 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) that activates a configured [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) on a [thermostat](https://docs.seam.co/capability-guides/thermostats) at a specified starting time and deactivates the climate preset at a specified ending time. + /// + public sealed record ThermostatSchedule + { + /// + /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [JsonPropertyName("climate_preset_key")] + public string ClimatePresetKey { get; init; } = default!; + + /// + /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// ID of the desired [thermostat](https://docs.seam.co/capability-guides/thermostats) device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("ends_at")] + public string EndsAt { get; init; } = default!; + + /// + /// Errors associated with the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Indicates whether a person at the thermostat can change the thermostat's settings after the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts. + /// + [JsonPropertyName("is_override_allowed")] + public bool? IsOverrideAllowed { get; init; } + + /// + /// Number of minutes for which a person at the thermostat can change the thermostat's settings after the activation of the scheduled [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [JsonPropertyName("max_override_period_minutes")] + public int? MaxOverridePeriodMinutes { get; init; } + + /// + /// User-friendly name to identify the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string StartsAt { get; init; } = default!; + + /// + /// ID of the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + [JsonPropertyName("thermostat_schedule_id")] + public string ThermostatScheduleId { get; init; } = default!; + + /// + /// ID of the workspace that contains the thermostat schedule. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record ThermostatScheduleErrors + { + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } +} diff --git a/src/Seam/Models/UnmanagedAccessCode.cs b/src/Seam/Models/UnmanagedAccessCode.cs new file mode 100644 index 00000000..4b6e06e0 --- /dev/null +++ b/src/Seam/Models/UnmanagedAccessCode.cs @@ -0,0 +1,1091 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an [unmanaged smart lock access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + /// + /// An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. + /// + /// When you create an access code on a device in Seam, it is created as a managed access code. Access codes that exist on a device that were not created through Seam are considered unmanaged codes. We strictly limit the operations that can be performed on unmanaged codes. + /// + /// Prior to using Seam to manage your devices, you may have used another lock management system to manage the access codes on your devices. Where possible, we help you keep any existing access codes on devices and transition those codes to ones managed by your Seam workspace. + /// + /// Not all providers support unmanaged access codes. The following providers do not support unmanaged access codes: + /// + /// - [Kwikset](https://docs.seam.co/device-and-system-integration-guides/kwikset-locks) + /// + public sealed record UnmanagedAccessCode + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("provider_issue", typeof(UnmanagedAccessCodeErrorsProviderIssue))] + [SeamUnionVariant( + "failed_to_set_on_device", + typeof(UnmanagedAccessCodeErrorsFailedToSetOnDevice) + )] + [SeamUnionVariant( + "failed_to_remove_from_device", + typeof(UnmanagedAccessCodeErrorsFailedToRemoveFromDevice) + )] + [SeamUnionVariant( + "duplicate_code_on_device", + typeof(UnmanagedAccessCodeErrorsDuplicateCodeOnDevice) + )] + [SeamUnionVariant( + "no_space_for_access_code_on_device", + typeof(UnmanagedAccessCodeErrorsNoSpaceForAccessCodeOnDevice) + )] + [SeamUnionVariant( + "conflicting_external_modification", + typeof(UnmanagedAccessCodeErrorsConflictingExternalModification) + )] + [SeamUnionVariant( + "access_code_inactive", + typeof(UnmanagedAccessCodeErrorsAccessCodeInactive) + )] + [SeamUnionVariant( + "code_constraints_violated", + typeof(UnmanagedAccessCodeErrorsCodeConstraintsViolated) + )] + [SeamUnionVariant("failed_to_issue", typeof(UnmanagedAccessCodeErrorsFailedToIssue))] + [SeamUnionVariant( + "failed_to_apply_mutations", + typeof(UnmanagedAccessCodeErrorsFailedToApplyMutations) + )] + [SeamUnionVariant("failed_to_expire", typeof(UnmanagedAccessCodeErrorsFailedToExpire))] + [SeamUnionVariant( + "account_disconnected", + typeof(UnmanagedAccessCodeErrorsAccountDisconnected) + )] + [SeamUnionVariant( + "salto_ks_subscription_limit_exceeded", + typeof(UnmanagedAccessCodeErrorsSaltoKsSubscriptionLimitExceeded) + )] + [SeamUnionVariant( + "insufficient_permissions", + typeof(UnmanagedAccessCodeErrorsInsufficientPermissions) + )] + [SeamUnionVariant( + "dormakaba_sites_disconnected", + typeof(UnmanagedAccessCodeErrorsDormakabaSitesDisconnected) + )] + [SeamUnionVariant("device_offline", typeof(UnmanagedAccessCodeErrorsDeviceOffline))] + [SeamUnionVariant("device_removed", typeof(UnmanagedAccessCodeErrorsDeviceRemoved))] + [SeamUnionVariant("hub_disconnected", typeof(UnmanagedAccessCodeErrorsHubDisconnected))] + [SeamUnionVariant( + "device_disconnected", + typeof(UnmanagedAccessCodeErrorsDeviceDisconnected) + )] + [SeamUnionVariant( + "empty_backup_access_code_pool", + typeof(UnmanagedAccessCodeErrorsEmptyBackupAccessCodePool) + )] + [SeamUnionVariant( + "august_lock_not_authorized", + typeof(UnmanagedAccessCodeErrorsAugustLockNotAuthorized) + )] + [SeamUnionVariant( + "missing_device_credentials", + typeof(UnmanagedAccessCodeErrorsMissingDeviceCredentials) + )] + [SeamUnionVariant( + "auxiliary_heat_running", + typeof(UnmanagedAccessCodeErrorsAuxiliaryHeatRunning) + )] + [SeamUnionVariant( + "subscription_required", + typeof(UnmanagedAccessCodeErrorsSubscriptionRequired) + )] + [SeamUnionVariant( + "bridge_disconnected", + typeof(UnmanagedAccessCodeErrorsBridgeDisconnected) + )] + [SeamUnionFallback(typeof(UnmanagedAccessCodeErrorsUnrecognized))] + public abstract record UnmanagedAccessCodeErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsProviderIssue : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "provider_issue"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsFailedToSetOnDevice + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_set_on_device"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsFailedToRemoveFromDevice + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_remove_from_device"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsDuplicateCodeOnDevice + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "duplicate_code_on_device"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + + /// + /// ID of the managed access code that conflicts with this managed access code, when Seam can identify it. + /// + [JsonPropertyName("managed_access_code_id")] + public string? ManagedAccessCodeId { get; init; } + + /// + /// ID of the unmanaged access code that conflicts with this managed access code, when Seam can identify it. + /// + [JsonPropertyName("unmanaged_access_code_id")] + public string? UnmanagedAccessCodeId { get; init; } + } + + public sealed record UnmanagedAccessCodeErrorsNoSpaceForAccessCodeOnDevice + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "no_space_for_access_code_on_device"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsConflictingExternalModification + : UnmanagedAccessCodeErrors + { + /// + /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ChangeTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "modified")] + Modified = 1, + + [EnumMember(Value = "removed")] + Removed = 2, + } + + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "conflicting_external_modification"; + + /// + /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. + /// + [JsonPropertyName("change_type")] + public UnmanagedAccessCodeErrorsConflictingExternalModification.ChangeTypeEnum? ChangeType { get; init; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + + /// + /// List of fields that were changed externally, with their previous and new values. + /// + [JsonPropertyName("modified_fields")] + public List? ModifiedFields { get; init; } + } + + public sealed record UnmanagedAccessCodeErrorsConflictingExternalModificationModifiedFields + { + /// + /// The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). + /// + [JsonPropertyName("field")] + public string Field { get; init; } = default!; + + /// + /// The previous value of the field. + /// + [JsonPropertyName("from")] + public string? From { get; init; } + + /// + /// The new value of the field. + /// + [JsonPropertyName("to")] + public string? To { get; init; } + } + + public sealed record UnmanagedAccessCodeErrorsAccessCodeInactive : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "access_code_inactive"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsCodeConstraintsViolated + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "code_constraints_violated"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsFailedToIssue : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_issue"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsFailedToApplyMutations + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_apply_mutations"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsFailedToExpire : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_expire"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Indicates that this is an access code error. + /// + [JsonPropertyName("is_access_code_error")] + public bool IsAccessCodeError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsAccountDisconnected + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "account_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsSaltoKsSubscriptionLimitExceeded + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsInsufficientPermissions + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "insufficient_permissions"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsDormakabaSitesDisconnected + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsDeviceOffline : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_offline"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsDeviceRemoved : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_removed"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsHubDisconnected : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "hub_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsDeviceDisconnected : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsEmptyBackupAccessCodePool + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "empty_backup_access_code_pool"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsAugustLockNotAuthorized + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "august_lock_not_authorized"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsMissingDeviceCredentials + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "missing_device_credentials"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsAuxiliaryHeatRunning + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "auxiliary_heat_running"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsSubscriptionRequired + : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "subscription_required"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeErrorsBridgeDisconnected : UnmanagedAccessCodeErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "bridge_disconnected"; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). + /// + [JsonPropertyName("is_bridge_error")] + public bool? IsBridgeError { get; init; } + + /// + /// Indicates whether the error is related specifically to the connected account. + /// + [JsonPropertyName("is_connected_account_error")] + public bool? IsConnectedAccountError { get; init; } + } + + public sealed record UnmanagedAccessCodeErrorsUnrecognized + : UnmanagedAccessCodeErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Current status of the access code within the operational lifecycle. `set` indicates that the code is active and operational. `unset` indicates that the code exists on the provider but is not usable on the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum StatusEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "set")] + Set = 1, + + [EnumMember(Value = "unset")] + Unset = 2, + } + + /// + /// Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum TypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "time_bound")] + TimeBound = 1, + + [EnumMember(Value = "ongoing")] + Ongoing = 2, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant( + "code_rotates_periodically", + typeof(UnmanagedAccessCodeWarningsCodeRotatesPeriodically) + )] + [SeamUnionVariant( + "time_frame_adjusted_for_unknown_time_zone", + typeof(UnmanagedAccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone) + )] + [SeamUnionVariant( + "external_modification_in_effect", + typeof(UnmanagedAccessCodeWarningsExternalModificationInEffect) + )] + [SeamUnionVariant( + "delay_in_setting_on_device", + typeof(UnmanagedAccessCodeWarningsDelayInSettingOnDevice) + )] + [SeamUnionVariant( + "delay_in_removing_from_device", + typeof(UnmanagedAccessCodeWarningsDelayInRemovingFromDevice) + )] + [SeamUnionVariant("delay_in_issuing", typeof(UnmanagedAccessCodeWarningsDelayInIssuing))] + [SeamUnionVariant( + "delay_in_applying_mutations", + typeof(UnmanagedAccessCodeWarningsDelayInApplyingMutations) + )] + [SeamUnionVariant( + "third_party_integration_detected", + typeof(UnmanagedAccessCodeWarningsThirdPartyIntegrationDetected) + )] + [SeamUnionVariant( + "igloo_algopin_must_be_used_within_24_hours", + typeof(UnmanagedAccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours) + )] + [SeamUnionVariant( + "management_transferred", + typeof(UnmanagedAccessCodeWarningsManagementTransferred) + )] + [SeamUnionVariant( + "using_backup_access_code", + typeof(UnmanagedAccessCodeWarningsUsingBackupAccessCode) + )] + [SeamUnionVariant("being_deleted", typeof(UnmanagedAccessCodeWarningsBeingDeleted))] + [SeamUnionVariant( + "unknown_issue_with_access_code", + typeof(UnmanagedAccessCodeWarningsUnknownIssueWithAccessCode) + )] + [SeamUnionFallback(typeof(UnmanagedAccessCodeWarningsUnrecognized))] + public abstract record UnmanagedAccessCodeWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string? CreatedAt { get; init; } + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeWarningsCodeRotatesPeriodically + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "code_rotates_periodically"; + } + + public sealed record UnmanagedAccessCodeWarningsTimeFrameAdjustedForUnknownTimeZone + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "time_frame_adjusted_for_unknown_time_zone"; + } + + public sealed record UnmanagedAccessCodeWarningsExternalModificationInEffect + : UnmanagedAccessCodeWarnings + { + /// + /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ChangeTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "modified")] + Modified = 1, + + [EnumMember(Value = "removed")] + Removed = 2, + } + + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "external_modification_in_effect"; + + /// + /// Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. + /// + [JsonPropertyName("change_type")] + public UnmanagedAccessCodeWarningsExternalModificationInEffect.ChangeTypeEnum? ChangeType { get; init; } + + /// + /// List of fields that were changed externally, with their previous and new values. + /// + [JsonPropertyName("modified_fields")] + public List? ModifiedFields { get; init; } + } + + public sealed record UnmanagedAccessCodeWarningsExternalModificationInEffectModifiedFields + { + /// + /// The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). + /// + [JsonPropertyName("field")] + public string Field { get; init; } = default!; + + /// + /// The previous value of the field. + /// + [JsonPropertyName("from")] + public string? From { get; init; } + + /// + /// The new value of the field. + /// + [JsonPropertyName("to")] + public string? To { get; init; } + } + + public sealed record UnmanagedAccessCodeWarningsDelayInSettingOnDevice + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_setting_on_device"; + } + + public sealed record UnmanagedAccessCodeWarningsDelayInRemovingFromDevice + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_removing_from_device"; + } + + public sealed record UnmanagedAccessCodeWarningsDelayInIssuing : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_issuing"; + } + + public sealed record UnmanagedAccessCodeWarningsDelayInApplyingMutations + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_applying_mutations"; + } + + public sealed record UnmanagedAccessCodeWarningsThirdPartyIntegrationDetected + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "third_party_integration_detected"; + } + + public sealed record UnmanagedAccessCodeWarningsIglooAlgopinMustBeUsedWithin_24Hours + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "igloo_algopin_must_be_used_within_24_hours"; + } + + public sealed record UnmanagedAccessCodeWarningsManagementTransferred + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "management_transferred"; + } + + public sealed record UnmanagedAccessCodeWarningsUsingBackupAccessCode + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "using_backup_access_code"; + } + + public sealed record UnmanagedAccessCodeWarningsBeingDeleted : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record UnmanagedAccessCodeWarningsUnknownIssueWithAccessCode + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unknown_issue_with_access_code"; + } + + public sealed record UnmanagedAccessCodeWarningsUnrecognized + : UnmanagedAccessCodeWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Unique identifier for the access code. + /// + [JsonPropertyName("access_code_id")] + public string AccessCodeId { get; init; } = default!; + + /// + /// Indicates that Seam cannot convert this unmanaged access code to a managed access code. Some providers do not support management of unmanaged access codes through API integrations. + /// + [JsonPropertyName("cannot_be_managed")] + public bool? CannotBeManaged { get; init; } + + /// + /// Indicates that Seam cannot delete this unmanaged access code through the provider. If this access code needs to be deleted, it will only be possible from the manufacturer app. + /// + [JsonPropertyName("cannot_delete_unmanaged_access_code")] + public bool? CannotDeleteUnmanagedAccessCode { get; init; } + + /// + /// Code used for access. Typically, a numeric or alphanumeric string. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Date and time at which the access code was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Unique identifier for the device associated with the access code. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Metadata for a dormakaba Oracode unmanaged access code. Only present for unmanaged access codes from dormakaba Oracode devices. + /// + [JsonPropertyName("dormakaba_oracode_metadata")] + public UnmanagedAccessCodeDormakabaOracodeMetadata? DormakabaOracodeMetadata { get; init; } + + /// + /// Date and time after which the time-bound access code becomes inactive. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Errors associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Indicates that Seam does not manage the access code. + /// + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Date and time at which the time-bound access code becomes active. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Current status of the access code within the operational lifecycle. `set` indicates that the code is active and operational. `unset` indicates that the code exists on the provider but is not usable on the device. + /// + [JsonPropertyName("status")] + public UnmanagedAccessCode.StatusEnum Status { get; init; } = default!; + + /// + /// Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. + /// + [JsonPropertyName("type")] + public UnmanagedAccessCode.TypeEnum Type { get; init; } = default!; + + /// + /// Warnings associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// Unique identifier for the Seam workspace associated with the access code. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record UnmanagedAccessCodeDormakabaOracodeMetadata + { + /// + /// Indicates whether the stay can be cancelled via the Dormakaba Oracode API. + /// + [JsonPropertyName("is_cancellable")] + public bool? IsCancellable { get; init; } + + /// + /// Indicates whether early check-in is available for this stay. + /// + [JsonPropertyName("is_early_checkin_able")] + public bool? IsEarlyCheckinAble { get; init; } + + /// + /// Indicates whether the stay can be extended via the Dormakaba Oracode API. + /// + [JsonPropertyName("is_extendable")] + public bool? IsExtendable { get; init; } + + /// + /// Indicates whether the access code can be overridden. When false, the maximum number of overrides has been reached. + /// + [JsonPropertyName("is_overridable")] + public bool? IsOverridable { get; init; } + + /// + /// Dormakaba Oracode site name associated with this access code. + /// + [JsonPropertyName("site_name")] + public string? SiteName { get; init; } + + /// + /// Dormakaba Oracode stay ID associated with this access code. + /// + [JsonPropertyName("stay_id")] + public float? StayId { get; init; } + + /// + /// Dormakaba Oracode user level ID associated with this access code. + /// + [JsonPropertyName("user_level_id")] + public string? UserLevelId { get; init; } + + /// + /// Dormakaba Oracode user level name associated with this access code. + /// + [JsonPropertyName("user_level_name")] + public string? UserLevelName { get; init; } + } +} diff --git a/src/Seam/Models/UnmanagedAccessGrant.cs b/src/Seam/Models/UnmanagedAccessGrant.cs new file mode 100644 index 00000000..88eb45cb --- /dev/null +++ b/src/Seam/Models/UnmanagedAccessGrant.cs @@ -0,0 +1,562 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an unmanaged Access Grant. Unmanaged Access Grants do not have client sessions, instant keys, customization profiles, or keys. + /// + public sealed record UnmanagedAccessGrant + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant( + "cannot_create_requested_access_methods", + typeof(UnmanagedAccessGrantErrorsCannotCreateRequestedAccessMethods) + )] + [SeamUnionFallback(typeof(UnmanagedAccessGrantErrorsUnrecognized))] + public abstract record UnmanagedAccessGrantErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantErrorsCannotCreateRequestedAccessMethods + : UnmanagedAccessGrantErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "cannot_create_requested_access_methods"; + + /// + /// IDs of the devices that did not receive an access code at grant creation. Use these to identify which specific devices failed when the message reports a partial failure. + /// + [JsonPropertyName("missing_device_ids")] + public List? MissingDeviceIds { get; init; } + } + + public sealed record UnmanagedAccessGrantErrorsUnrecognized + : UnmanagedAccessGrantErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("mutation_code")] + [SeamUnionVariant( + "updating_spaces", + typeof(UnmanagedAccessGrantPendingMutationsUpdatingSpaces) + )] + [SeamUnionVariant( + "updating_access_times", + typeof(UnmanagedAccessGrantPendingMutationsUpdatingAccessTimes) + )] + [SeamUnionFallback(typeof(UnmanagedAccessGrantPendingMutationsUnrecognized))] + public abstract record UnmanagedAccessGrantPendingMutations + { + /// The value of the mutation_code discriminator. + public abstract string MutationCode { get; } + + /// + /// Date and time at which the mutation was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the mutation. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantPendingMutationsUpdatingSpaces + : UnmanagedAccessGrantPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_spaces"; + + /// + /// Previous location configuration. + /// + [JsonPropertyName("from")] + public UnmanagedAccessGrantPendingMutationsUpdatingSpacesFrom From { get; init; } = + default!; + + /// + /// New location configuration. + /// + [JsonPropertyName("to")] + public UnmanagedAccessGrantPendingMutationsUpdatingSpacesTo To { get; init; } = + default!; + } + + public sealed record UnmanagedAccessGrantPendingMutationsUpdatingSpacesFrom + { + /// + /// Previous device IDs where access codes existed. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantPendingMutationsUpdatingSpacesTo + { + /// + /// Common code key to ensure PIN code reuse across devices. + /// + [JsonPropertyName("common_code_key")] + public string? CommonCodeKey { get; init; } + + /// + /// New device IDs where access codes should be created. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantPendingMutationsUpdatingAccessTimes + : UnmanagedAccessGrantPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_access_times"; + + /// + /// IDs of the access methods being updated. + /// + [JsonPropertyName("access_method_ids")] + public List AccessMethodIds { get; init; } = default!; + + /// + /// Previous access time configuration. + /// + [JsonPropertyName("from")] + public UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesFrom From { get; init; } = + default!; + + /// + /// New access time configuration. + /// + [JsonPropertyName("to")] + public UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesTo To { get; init; } = + default!; + } + + public sealed record UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesFrom + { + /// + /// Previous end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Previous start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record UnmanagedAccessGrantPendingMutationsUpdatingAccessTimesTo + { + /// + /// New end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// New start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record UnmanagedAccessGrantPendingMutationsUnrecognized + : UnmanagedAccessGrantPendingMutations, + ISeamUnrecognizedVariant + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant("being_deleted", typeof(UnmanagedAccessGrantWarningsBeingDeleted))] + [SeamUnionVariant( + "underprovisioned_access", + typeof(UnmanagedAccessGrantWarningsUnderprovisionedAccess) + )] + [SeamUnionVariant( + "overprovisioned_access", + typeof(UnmanagedAccessGrantWarningsOverprovisionedAccess) + )] + [SeamUnionVariant( + "updating_access_times", + typeof(UnmanagedAccessGrantWarningsUpdatingAccessTimes) + )] + [SeamUnionVariant( + "requested_code_unavailable", + typeof(UnmanagedAccessGrantWarningsRequestedCodeUnavailable) + )] + [SeamUnionVariant( + "device_does_not_support_access_codes", + typeof(UnmanagedAccessGrantWarningsDeviceDoesNotSupportAccessCodes) + )] + [SeamUnionVariant( + "device_time_constraints_violated", + typeof(UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated) + )] + [SeamUnionFallback(typeof(UnmanagedAccessGrantWarningsUnrecognized))] + public abstract record UnmanagedAccessGrantWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantWarningsBeingDeleted : UnmanagedAccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record UnmanagedAccessGrantWarningsUnderprovisionedAccess + : UnmanagedAccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "underprovisioned_access"; + } + + public sealed record UnmanagedAccessGrantWarningsOverprovisionedAccess + : UnmanagedAccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "overprovisioned_access"; + + /// + /// Devices whose access codes could not be revoked during reconciliation. Present when the provider does not support revoking an offline access code (e.g. Dormakaba oracode with exhausted override budget). + /// + [JsonPropertyName("failed_devices")] + public List? FailedDevices { get; init; } + } + + public sealed record UnmanagedAccessGrantWarningsOverprovisionedAccessFailedDevices + { + /// + /// Device whose access code could not be revoked. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`). + /// + [JsonPropertyName("error_code")] + public string ErrorCode { get; init; } = default!; + + /// + /// Human-readable description of why revocation failed. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantWarningsUpdatingAccessTimes + : UnmanagedAccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "updating_access_times"; + + /// + /// IDs of the access methods being updated. + /// + [JsonPropertyName("access_method_ids")] + public List AccessMethodIds { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantWarningsRequestedCodeUnavailable + : UnmanagedAccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "requested_code_unavailable"; + + /// + /// ID of the device where the requested code was unavailable. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// The new PIN code that was assigned instead. + /// + [JsonPropertyName("new_code")] + public string NewCode { get; init; } = default!; + + /// + /// The originally requested PIN code that was unavailable. + /// + [JsonPropertyName("original_code")] + public string OriginalCode { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantWarningsDeviceDoesNotSupportAccessCodes + : UnmanagedAccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_does_not_support_access_codes"; + + /// + /// ID of the device that does not support access codes. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated + : UnmanagedAccessGrantWarnings + { + /// + /// Specific reason why the grant's times are not programmable on the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ReasonEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "duration_exceeds_max")] + DurationExceedsMax = 1, + + [EnumMember(Value = "times_do_not_match_slots")] + TimesDoNotMatchSlots = 2, + + [EnumMember(Value = "ongoing_not_supported")] + OngoingNotSupported = 3, + } + + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_time_constraints_violated"; + + /// + /// ID of the device whose time constraints the access grant violates. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Specific reason why the grant's times are not programmable on the device. + /// + [JsonPropertyName("reason")] + public UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated.ReasonEnum Reason { get; init; } = + default!; + } + + public sealed record UnmanagedAccessGrantWarningsUnrecognized + : UnmanagedAccessGrantWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// ID of the Access Grant. + /// + [JsonPropertyName("access_grant_id")] + public string AccessGrantId { get; init; } = default!; + + /// + /// IDs of the access methods created for the Access Grant. + /// + [JsonPropertyName("access_method_ids")] + public List AccessMethodIds { get; init; } = default!; + + /// + /// Date and time at which the Access Grant was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name of the Access Grant. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Date and time at which the Access Grant ends. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Errors associated with the [access grant](https://docs.seam.co/use-cases/granting-access). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + [Obsolete("Use `space_ids`.")] + [JsonPropertyName("location_ids")] + public List LocationIds { get; init; } = default!; + + /// + /// Name of the Access Grant. If not provided, the display name will be computed. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// List of pending mutations for the access grant. This shows updates that are in progress. + /// + [JsonPropertyName("pending_mutations")] + public List PendingMutations { get; init; } = + default!; + + /// + /// Access methods that the user requested for the Access Grant. + /// + [JsonPropertyName("requested_access_methods")] + public List RequestedAccessMethods { get; init; } = + default!; + + /// + /// Reservation key for the access grant. + /// + [JsonPropertyName("reservation_key")] + public string? ReservationKey { get; init; } + + /// + /// IDs of the spaces to which the Access Grant gives access. + /// + [JsonPropertyName("space_ids")] + public List SpaceIds { get; init; } = default!; + + /// + /// Date and time at which the Access Grant starts. + /// + [JsonPropertyName("starts_at")] + public string StartsAt { get; init; } = default!; + + /// + /// ID of user identity to which the Access Grant gives access. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Warnings associated with the [access grant](https://docs.seam.co/use-cases/granting-access). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the Seam workspace associated with the Access Grant. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record UnmanagedAccessGrantRequestedAccessMethods + { + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// Specific PIN code to use for this access method. Only applicable when mode is 'code'. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// IDs of the access methods created for the requested access method. + /// + [JsonPropertyName("created_access_method_ids")] + public List CreatedAccessMethodIds { get; init; } = default!; + + /// + /// Date and time at which the requested access method was added to the Access Grant. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name of the access method. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Maximum number of times the instant key can be used. Only applicable when mode is 'mobile_key'. Defaults to 1 if not specified. + /// + [JsonPropertyName("instant_key_max_use_count")] + public int? InstantKeyMaxUseCount { get; init; } + + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("mode")] + public UnmanagedAccessGrantRequestedAccessMethods.ModeEnum Mode { get; init; } = default!; + } +} diff --git a/src/Seam/Models/UnmanagedAccessMethod.cs b/src/Seam/Models/UnmanagedAccessMethod.cs new file mode 100644 index 00000000..705b54fc --- /dev/null +++ b/src/Seam/Models/UnmanagedAccessMethod.cs @@ -0,0 +1,427 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an unmanaged access method. Unmanaged access methods do not have client sessions, instant keys, customization profiles, or keys. + /// + public sealed record UnmanagedAccessMethod + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("failed_to_issue", typeof(UnmanagedAccessMethodErrorsFailedToIssue))] + [SeamUnionFallback(typeof(UnmanagedAccessMethodErrorsUnrecognized))] + public abstract record UnmanagedAccessMethodErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedAccessMethodErrorsFailedToIssue : UnmanagedAccessMethodErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "failed_to_issue"; + } + + public sealed record UnmanagedAccessMethodErrorsUnrecognized + : UnmanagedAccessMethodErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("mutation_code")] + [SeamUnionVariant( + "provisioning_access", + typeof(UnmanagedAccessMethodPendingMutationsProvisioningAccess) + )] + [SeamUnionVariant( + "revoking_access", + typeof(UnmanagedAccessMethodPendingMutationsRevokingAccess) + )] + [SeamUnionVariant( + "updating_access_times", + typeof(UnmanagedAccessMethodPendingMutationsUpdatingAccessTimes) + )] + [SeamUnionFallback(typeof(UnmanagedAccessMethodPendingMutationsUnrecognized))] + public abstract record UnmanagedAccessMethodPendingMutations + { + /// The value of the mutation_code discriminator. + public abstract string MutationCode { get; } + + /// + /// Date and time at which the mutation was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the mutation. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedAccessMethodPendingMutationsProvisioningAccess + : UnmanagedAccessMethodPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "provisioning_access"; + + /// + /// Previous device configuration. + /// + [JsonPropertyName("from")] + public UnmanagedAccessMethodPendingMutationsProvisioningAccessFrom From { get; init; } = + default!; + + /// + /// New device configuration. + /// + [JsonPropertyName("to")] + public UnmanagedAccessMethodPendingMutationsProvisioningAccessTo To { get; init; } = + default!; + } + + public sealed record UnmanagedAccessMethodPendingMutationsProvisioningAccessFrom + { + /// + /// Previous device IDs where access was provisioned. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record UnmanagedAccessMethodPendingMutationsProvisioningAccessTo + { + /// + /// New device IDs where access is being provisioned. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record UnmanagedAccessMethodPendingMutationsRevokingAccess + : UnmanagedAccessMethodPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "revoking_access"; + + /// + /// Previous device configuration. + /// + [JsonPropertyName("from")] + public UnmanagedAccessMethodPendingMutationsRevokingAccessFrom From { get; init; } = + default!; + + /// + /// New device configuration. + /// + [JsonPropertyName("to")] + public UnmanagedAccessMethodPendingMutationsRevokingAccessTo To { get; init; } = + default!; + } + + public sealed record UnmanagedAccessMethodPendingMutationsRevokingAccessFrom + { + /// + /// Previous device IDs where access existed. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record UnmanagedAccessMethodPendingMutationsRevokingAccessTo + { + /// + /// New device IDs where access should remain. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record UnmanagedAccessMethodPendingMutationsUpdatingAccessTimes + : UnmanagedAccessMethodPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "updating_access_times"; + + /// + /// Previous access time configuration. + /// + [JsonPropertyName("from")] + public UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesFrom From { get; init; } = + default!; + + /// + /// New access time configuration. + /// + [JsonPropertyName("to")] + public UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesTo To { get; init; } = + default!; + } + + public sealed record UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesFrom + { + /// + /// Previous end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Previous start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesTo + { + /// + /// New end time for access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// New start time for access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record UnmanagedAccessMethodPendingMutationsUnrecognized + : UnmanagedAccessMethodPendingMutations, + ISeamUnrecognizedVariant + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant("being_deleted", typeof(UnmanagedAccessMethodWarningsBeingDeleted))] + [SeamUnionVariant( + "updating_access_times", + typeof(UnmanagedAccessMethodWarningsUpdatingAccessTimes) + )] + [SeamUnionVariant( + "pulled_backup_access_code", + typeof(UnmanagedAccessMethodWarningsPulledBackupAccessCode) + )] + [SeamUnionVariant("delay_in_issuing", typeof(UnmanagedAccessMethodWarningsDelayInIssuing))] + [SeamUnionFallback(typeof(UnmanagedAccessMethodWarningsUnrecognized))] + public abstract record UnmanagedAccessMethodWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedAccessMethodWarningsBeingDeleted + : UnmanagedAccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record UnmanagedAccessMethodWarningsUpdatingAccessTimes + : UnmanagedAccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "updating_access_times"; + } + + public sealed record UnmanagedAccessMethodWarningsPulledBackupAccessCode + : UnmanagedAccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "pulled_backup_access_code"; + + /// + /// ID of the original access method from which this backup access method was split, if applicable. + /// + [JsonPropertyName("original_access_method_id")] + public string? OriginalAccessMethodId { get; init; } + } + + public sealed record UnmanagedAccessMethodWarningsDelayInIssuing + : UnmanagedAccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "delay_in_issuing"; + } + + public sealed record UnmanagedAccessMethodWarningsUnrecognized + : UnmanagedAccessMethodWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// ID of the access method. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + + /// + /// The actual PIN code for code access methods. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Date and time at which the access method was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name of the access method. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Human-readable sentence describing where the access method sits in its relationship with the device or access system, for example `Awaiting encoding`. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read `is_issued`, `errors`, and `pending_mutations`. + /// + [JsonPropertyName("display_status")] + public string DisplayStatus { get; init; } = default!; + + /// + /// Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Indicates whether an existing card credential must be assigned to this access method before it can be issued. Only applies to card-mode access methods on systems that support credential assignment. + /// + [JsonPropertyName("is_assignment_required")] + public bool? IsAssignmentRequired { get; init; } + + /// + /// Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method. + /// + [JsonPropertyName("is_encoding_required")] + public bool? IsEncodingRequired { get; init; } + + /// + /// Indicates whether the access method has been issued. + /// + [JsonPropertyName("is_issued")] + public bool IsIssued { get; init; } = default!; + + /// + /// Indicates whether the access method is ready for card assignment. This is true when the access method is in card mode, has not yet been issued, and the system supports credential assignment. + /// + [JsonPropertyName("is_ready_for_assignment")] + public bool? IsReadyForAssignment { get; init; } + + /// + /// Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. + /// + [JsonPropertyName("is_ready_for_encoding")] + public bool? IsReadyForEncoding { get; init; } + + /// + /// Date and time at which the access method was issued. + /// + [JsonPropertyName("issued_at")] + public string? IssuedAt { get; init; } + + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("mode")] + public UnmanagedAccessMethod.ModeEnum Mode { get; init; } = default!; + + /// + /// Pending mutations for the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). Indicates operations that are in progress. + /// + [JsonPropertyName("pending_mutations")] + public List PendingMutations { get; init; } = + default!; + + /// + /// Warnings associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the Seam workspace associated with the access method. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } +} diff --git a/src/Seam/Models/UnmanagedDevice.cs b/src/Seam/Models/UnmanagedDevice.cs new file mode 100644 index 00000000..872448bf --- /dev/null +++ b/src/Seam/Models/UnmanagedDevice.cs @@ -0,0 +1,1178 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). + /// + public sealed record UnmanagedDevice + { + /// + /// Collection of capabilities that the device supports when connected to Seam. Values are `access_code`, which indicates that the device can manage and utilize digital PIN codes for secure access; `lock`, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; `noise_detection`, which indicates that the device supports monitoring and responding to ambient noise levels; `thermostat`, which indicates that the device can regulate and adjust indoor temperatures; `battery`, which indicates that the device can manage battery life and health; and `phone`, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum CapabilitiesSupportedEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "access_code")] + AccessCode = 1, + + [EnumMember(Value = "lock")] + Lock = 2, + + [EnumMember(Value = "noise_detection")] + NoiseDetection = 3, + + [EnumMember(Value = "thermostat")] + Thermostat = 4, + + [EnumMember(Value = "battery")] + Battery = 5, + + [EnumMember(Value = "phone")] + Phone = 6, + } + + /// + /// Type of the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "akuvox_lock")] + AkuvoxLock = 1, + + [EnumMember(Value = "august_lock")] + AugustLock = 2, + + [EnumMember(Value = "brivo_access_point")] + BrivoAccessPoint = 3, + + [EnumMember(Value = "butterflymx_panel")] + ButterflymxPanel = 4, + + [EnumMember(Value = "avigilon_alta_entry")] + AvigilonAltaEntry = 5, + + [EnumMember(Value = "doorking_lock")] + DoorkingLock = 6, + + [EnumMember(Value = "genie_door")] + GenieDoor = 7, + + [EnumMember(Value = "igloo_lock")] + IglooLock = 8, + + [EnumMember(Value = "linear_lock")] + LinearLock = 9, + + [EnumMember(Value = "lockly_lock")] + LocklyLock = 10, + + [EnumMember(Value = "kwikset_lock")] + KwiksetLock = 11, + + [EnumMember(Value = "nuki_lock")] + NukiLock = 12, + + [EnumMember(Value = "salto_lock")] + SaltoLock = 13, + + [EnumMember(Value = "schlage_lock")] + SchlageLock = 14, + + [EnumMember(Value = "smartthings_lock")] + SmartthingsLock = 15, + + [EnumMember(Value = "wyze_lock")] + WyzeLock = 16, + + [EnumMember(Value = "yale_lock")] + YaleLock = 17, + + [EnumMember(Value = "two_n_intercom")] + TwoNIntercom = 18, + + [EnumMember(Value = "controlbyweb_device")] + ControlbywebDevice = 19, + + [EnumMember(Value = "ttlock_lock")] + TtlockLock = 20, + + [EnumMember(Value = "igloohome_lock")] + IgloohomeLock = 21, + + [EnumMember(Value = "four_suites_door")] + FourSuitesDoor = 22, + + [EnumMember(Value = "dormakaba_oracode_door")] + DormakabaOracodeDoor = 23, + + [EnumMember(Value = "tedee_lock")] + TedeeLock = 24, + + [EnumMember(Value = "akiles_lock")] + AkilesLock = 25, + + [EnumMember(Value = "ultraloq_lock")] + UltraloqLock = 26, + + [EnumMember(Value = "yacan_lock")] + YacanLock = 27, + + [EnumMember(Value = "keyincode_lock")] + KeyincodeLock = 28, + + [EnumMember(Value = "omnitec_lock")] + OmnitecLock = 29, + + [EnumMember(Value = "kisi_lock")] + KisiLock = 30, + + [EnumMember(Value = "aqara_lock")] + AqaraLock = 31, + + [EnumMember(Value = "keynest_key")] + KeynestKey = 32, + + [EnumMember(Value = "noiseaware_activity_zone")] + NoiseawareActivityZone = 33, + + [EnumMember(Value = "minut_sensor")] + MinutSensor = 34, + + [EnumMember(Value = "ecobee_thermostat")] + EcobeeThermostat = 35, + + [EnumMember(Value = "nest_thermostat")] + NestThermostat = 36, + + [EnumMember(Value = "honeywell_resideo_thermostat")] + HoneywellResideoThermostat = 37, + + [EnumMember(Value = "tado_thermostat")] + TadoThermostat = 38, + + [EnumMember(Value = "sensi_thermostat")] + SensiThermostat = 39, + + [EnumMember(Value = "smartthings_thermostat")] + SmartthingsThermostat = 40, + + [EnumMember(Value = "ios_phone")] + IosPhone = 41, + + [EnumMember(Value = "android_phone")] + AndroidPhone = 42, + + [EnumMember(Value = "ring_camera")] + RingCamera = 43, + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("account_disconnected", typeof(UnmanagedDeviceErrorsAccountDisconnected))] + [SeamUnionVariant( + "salto_ks_subscription_limit_exceeded", + typeof(UnmanagedDeviceErrorsSaltoKsSubscriptionLimitExceeded) + )] + [SeamUnionVariant( + "insufficient_permissions", + typeof(UnmanagedDeviceErrorsInsufficientPermissions) + )] + [SeamUnionVariant( + "dormakaba_sites_disconnected", + typeof(UnmanagedDeviceErrorsDormakabaSitesDisconnected) + )] + [SeamUnionVariant("device_offline", typeof(UnmanagedDeviceErrorsDeviceOffline))] + [SeamUnionVariant("device_removed", typeof(UnmanagedDeviceErrorsDeviceRemoved))] + [SeamUnionVariant("hub_disconnected", typeof(UnmanagedDeviceErrorsHubDisconnected))] + [SeamUnionVariant("device_disconnected", typeof(UnmanagedDeviceErrorsDeviceDisconnected))] + [SeamUnionVariant( + "empty_backup_access_code_pool", + typeof(UnmanagedDeviceErrorsEmptyBackupAccessCodePool) + )] + [SeamUnionVariant( + "august_lock_not_authorized", + typeof(UnmanagedDeviceErrorsAugustLockNotAuthorized) + )] + [SeamUnionVariant( + "missing_device_credentials", + typeof(UnmanagedDeviceErrorsMissingDeviceCredentials) + )] + [SeamUnionVariant( + "auxiliary_heat_running", + typeof(UnmanagedDeviceErrorsAuxiliaryHeatRunning) + )] + [SeamUnionVariant( + "subscription_required", + typeof(UnmanagedDeviceErrorsSubscriptionRequired) + )] + [SeamUnionVariant("bridge_disconnected", typeof(UnmanagedDeviceErrorsBridgeDisconnected))] + [SeamUnionFallback(typeof(UnmanagedDeviceErrorsUnrecognized))] + public abstract record UnmanagedDeviceErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsAccountDisconnected : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "account_disconnected"; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsSaltoKsSubscriptionLimitExceeded + : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsInsufficientPermissions : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "insufficient_permissions"; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsDormakabaSitesDisconnected : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; + + /// + /// Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. + /// + [JsonPropertyName("is_connected_account_error")] + public bool IsConnectedAccountError { get; init; } = default!; + + /// + /// Indicates that the error is not a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsDeviceOffline : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_offline"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsDeviceRemoved : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_removed"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsHubDisconnected : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "hub_disconnected"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsDeviceDisconnected : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "device_disconnected"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsEmptyBackupAccessCodePool : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "empty_backup_access_code_pool"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsAugustLockNotAuthorized : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "august_lock_not_authorized"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsMissingDeviceCredentials : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "missing_device_credentials"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsAuxiliaryHeatRunning : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "auxiliary_heat_running"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsSubscriptionRequired : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "subscription_required"; + + /// + /// Indicates that the error is a device error. + /// + [JsonPropertyName("is_device_error")] + public bool IsDeviceError { get; init; } = default!; + } + + public sealed record UnmanagedDeviceErrorsBridgeDisconnected : UnmanagedDeviceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "bridge_disconnected"; + + /// + /// Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). + /// + [JsonPropertyName("is_bridge_error")] + public bool? IsBridgeError { get; init; } + + /// + /// Indicates whether the error is related specifically to the connected account. + /// + [JsonPropertyName("is_connected_account_error")] + public bool? IsConnectedAccountError { get; init; } + } + + public sealed record UnmanagedDeviceErrorsUnrecognized + : UnmanagedDeviceErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant( + "partial_backup_access_code_pool", + typeof(UnmanagedDeviceWarningsPartialBackupAccessCodePool) + )] + [SeamUnionVariant( + "many_active_backup_codes", + typeof(UnmanagedDeviceWarningsManyActiveBackupCodes) + )] + [SeamUnionVariant( + "third_party_integration_detected", + typeof(UnmanagedDeviceWarningsThirdPartyIntegrationDetected) + )] + [SeamUnionVariant( + "ttlock_lock_gateway_unlocking_not_enabled", + typeof(UnmanagedDeviceWarningsTtlockLockGatewayUnlockingNotEnabled) + )] + [SeamUnionVariant( + "ttlock_weak_gateway_signal", + typeof(UnmanagedDeviceWarningsTtlockWeakGatewaySignal) + )] + [SeamUnionVariant("power_saving_mode", typeof(UnmanagedDeviceWarningsPowerSavingMode))] + [SeamUnionVariant( + "temperature_threshold_exceeded", + typeof(UnmanagedDeviceWarningsTemperatureThresholdExceeded) + )] + [SeamUnionVariant( + "device_communication_degraded", + typeof(UnmanagedDeviceWarningsDeviceCommunicationDegraded) + )] + [SeamUnionVariant( + "scheduled_maintenance_window", + typeof(UnmanagedDeviceWarningsScheduledMaintenanceWindow) + )] + [SeamUnionVariant( + "device_has_flaky_connection", + typeof(UnmanagedDeviceWarningsDeviceHasFlakyConnection) + )] + [SeamUnionVariant("salto_ks_office_mode", typeof(UnmanagedDeviceWarningsSaltoKsOfficeMode))] + [SeamUnionVariant( + "salto_ks_privacy_mode", + typeof(UnmanagedDeviceWarningsSaltoKsPrivacyMode) + )] + [SeamUnionVariant("privacy_mode", typeof(UnmanagedDeviceWarningsPrivacyMode))] + [SeamUnionVariant( + "salto_ks_subscription_limit_almost_reached", + typeof(UnmanagedDeviceWarningsSaltoKsSubscriptionLimitAlmostReached) + )] + [SeamUnionVariant( + "salto_ks_lock_access_code_support_removed", + typeof(UnmanagedDeviceWarningsSaltoKsLockAccessCodeSupportRemoved) + )] + [SeamUnionVariant( + "unknown_issue_with_phone", + typeof(UnmanagedDeviceWarningsUnknownIssueWithPhone) + )] + [SeamUnionVariant( + "lockly_time_zone_not_configured", + typeof(UnmanagedDeviceWarningsLocklyTimeZoneNotConfigured) + )] + [SeamUnionVariant( + "ultraloq_time_zone_unknown", + typeof(UnmanagedDeviceWarningsUltraloqTimeZoneUnknown) + )] + [SeamUnionVariant("time_zone_unknown", typeof(UnmanagedDeviceWarningsTimeZoneUnknown))] + [SeamUnionVariant("time_zone_mismatch", typeof(UnmanagedDeviceWarningsTimeZoneMismatch))] + [SeamUnionVariant( + "two_n_device_missing_timezone", + typeof(UnmanagedDeviceWarningsTwoNDeviceMissingTimezone) + )] + [SeamUnionVariant( + "hub_required_for_additional_capabilities", + typeof(UnmanagedDeviceWarningsHubRequiredForAdditionalCapabilities) + )] + [SeamUnionVariant("provider_issue", typeof(UnmanagedDeviceWarningsProviderIssue))] + [SeamUnionVariant( + "keynest_unsupported_locker", + typeof(UnmanagedDeviceWarningsKeynestUnsupportedLocker) + )] + [SeamUnionVariant( + "accessory_keypad_setup_required", + typeof(UnmanagedDeviceWarningsAccessoryKeypadSetupRequired) + )] + [SeamUnionVariant( + "accessory_keypad_low_battery", + typeof(UnmanagedDeviceWarningsAccessoryKeypadLowBattery) + )] + [SeamUnionVariant( + "unreliable_online_status", + typeof(UnmanagedDeviceWarningsUnreliableOnlineStatus) + )] + [SeamUnionVariant( + "max_access_codes_reached", + typeof(UnmanagedDeviceWarningsMaxAccessCodesReached) + )] + [SeamUnionFallback(typeof(UnmanagedDeviceWarningsUnrecognized))] + public abstract record UnmanagedDeviceWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedDeviceWarningsPartialBackupAccessCodePool + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "partial_backup_access_code_pool"; + } + + public sealed record UnmanagedDeviceWarningsManyActiveBackupCodes : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "many_active_backup_codes"; + } + + public sealed record UnmanagedDeviceWarningsThirdPartyIntegrationDetected + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "third_party_integration_detected"; + } + + public sealed record UnmanagedDeviceWarningsTtlockLockGatewayUnlockingNotEnabled + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "ttlock_lock_gateway_unlocking_not_enabled"; + } + + public sealed record UnmanagedDeviceWarningsTtlockWeakGatewaySignal + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "ttlock_weak_gateway_signal"; + } + + public sealed record UnmanagedDeviceWarningsPowerSavingMode : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "power_saving_mode"; + } + + public sealed record UnmanagedDeviceWarningsTemperatureThresholdExceeded + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "temperature_threshold_exceeded"; + } + + public sealed record UnmanagedDeviceWarningsDeviceCommunicationDegraded + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_communication_degraded"; + } + + public sealed record UnmanagedDeviceWarningsScheduledMaintenanceWindow + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "scheduled_maintenance_window"; + } + + public sealed record UnmanagedDeviceWarningsDeviceHasFlakyConnection + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_has_flaky_connection"; + } + + public sealed record UnmanagedDeviceWarningsSaltoKsOfficeMode : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "salto_ks_office_mode"; + } + + public sealed record UnmanagedDeviceWarningsSaltoKsPrivacyMode : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "salto_ks_privacy_mode"; + } + + public sealed record UnmanagedDeviceWarningsPrivacyMode : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "privacy_mode"; + } + + public sealed record UnmanagedDeviceWarningsSaltoKsSubscriptionLimitAlmostReached + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "salto_ks_subscription_limit_almost_reached"; + } + + public sealed record UnmanagedDeviceWarningsSaltoKsLockAccessCodeSupportRemoved + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "salto_ks_lock_access_code_support_removed"; + } + + public sealed record UnmanagedDeviceWarningsUnknownIssueWithPhone : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unknown_issue_with_phone"; + } + + public sealed record UnmanagedDeviceWarningsLocklyTimeZoneNotConfigured + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "lockly_time_zone_not_configured"; + } + + public sealed record UnmanagedDeviceWarningsUltraloqTimeZoneUnknown + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "ultraloq_time_zone_unknown"; + } + + public sealed record UnmanagedDeviceWarningsTimeZoneUnknown : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "time_zone_unknown"; + } + + public sealed record UnmanagedDeviceWarningsTimeZoneMismatch : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "time_zone_mismatch"; + } + + public sealed record UnmanagedDeviceWarningsTwoNDeviceMissingTimezone + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "two_n_device_missing_timezone"; + } + + public sealed record UnmanagedDeviceWarningsHubRequiredForAdditionalCapabilities + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "hub_required_for_additional_capabilities"; + } + + public sealed record UnmanagedDeviceWarningsProviderIssue : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "provider_issue"; + } + + public sealed record UnmanagedDeviceWarningsKeynestUnsupportedLocker + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "keynest_unsupported_locker"; + } + + public sealed record UnmanagedDeviceWarningsAccessoryKeypadSetupRequired + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "accessory_keypad_setup_required"; + } + + public sealed record UnmanagedDeviceWarningsAccessoryKeypadLowBattery + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "accessory_keypad_low_battery"; + } + + public sealed record UnmanagedDeviceWarningsUnreliableOnlineStatus : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unreliable_online_status"; + } + + public sealed record UnmanagedDeviceWarningsMaxAccessCodesReached : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "max_access_codes_reached"; + + /// + /// Number of active access codes on the device when the warning was set. + /// + [JsonPropertyName("active_access_code_count")] + public int ActiveAccessCodeCount { get; init; } = default!; + + /// + /// Maximum number of active access codes supported by the device. + /// + [JsonPropertyName("max_active_access_code_count")] + public int MaxActiveAccessCodeCount { get; init; } = default!; + } + + public sealed record UnmanagedDeviceWarningsUnrecognized + : UnmanagedDeviceWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Indicates whether the lock supports configuring automatic locking. + /// + [JsonPropertyName("can_configure_auto_lock")] + public bool? CanConfigureAutoLock { get; init; } + + /// + /// Indicates whether the thermostat supports cooling. + /// + [JsonPropertyName("can_hvac_cool")] + public bool? CanHvacCool { get; init; } + + /// + /// Indicates whether the thermostat supports heating. + /// + [JsonPropertyName("can_hvac_heat")] + public bool? CanHvacHeat { get; init; } + + /// + /// Indicates whether the thermostat supports simultaneous heating and cooling. + /// + [JsonPropertyName("can_hvac_heat_cool")] + public bool? CanHvacHeatCool { get; init; } + + /// + /// Indicates whether the device supports programming offline access codes. + /// + [JsonPropertyName("can_program_offline_access_codes")] + public bool? CanProgramOfflineAccessCodes { get; init; } + + /// + /// Indicates whether the device supports programming online access codes. + /// + [JsonPropertyName("can_program_online_access_codes")] + public bool? CanProgramOnlineAccessCodes { get; init; } + + /// + /// Indicates whether the thermostat supports different climate programs for each day of the week. + /// + [JsonPropertyName("can_program_thermostat_programs_as_different_each_day")] + public bool? CanProgramThermostatProgramsAsDifferentEachDay { get; init; } + + /// + /// Indicates whether the thermostat supports a single climate program applied to every day. + /// + [JsonPropertyName("can_program_thermostat_programs_as_same_each_day")] + public bool? CanProgramThermostatProgramsAsSameEachDay { get; init; } + + /// + /// Indicates whether the thermostat supports weekday/weekend climate programs. + /// + [JsonPropertyName("can_program_thermostat_programs_as_weekday_weekend")] + public bool? CanProgramThermostatProgramsAsWeekdayWeekend { get; init; } + + /// + /// Indicates whether the device supports remote locking. + /// + [JsonPropertyName("can_remotely_lock")] + public bool? CanRemotelyLock { get; init; } + + /// + /// Indicates whether the device supports remote unlocking. + /// + [JsonPropertyName("can_remotely_unlock")] + public bool? CanRemotelyUnlock { get; init; } + + /// + /// Indicates whether the thermostat supports running climate programs. + /// + [JsonPropertyName("can_run_thermostat_programs")] + public bool? CanRunThermostatPrograms { get; init; } + + /// + /// Indicates whether the device supports simulating connection in a sandbox. + /// + [JsonPropertyName("can_simulate_connection")] + public bool? CanSimulateConnection { get; init; } + + /// + /// Indicates whether the device supports simulating disconnection in a sandbox. + /// + [JsonPropertyName("can_simulate_disconnection")] + public bool? CanSimulateDisconnection { get; init; } + + /// + /// Indicates whether the hub supports simulating connection in a sandbox. + /// + [JsonPropertyName("can_simulate_hub_connection")] + public bool? CanSimulateHubConnection { get; init; } + + /// + /// Indicates whether the hub supports simulating disconnection in a sandbox. + /// + [JsonPropertyName("can_simulate_hub_disconnection")] + public bool? CanSimulateHubDisconnection { get; init; } + + /// + /// Indicates whether the device supports simulating a paid subscription in a sandbox. + /// + [JsonPropertyName("can_simulate_paid_subscription")] + public bool? CanSimulatePaidSubscription { get; init; } + + /// + /// Indicates whether the device supports simulating removal in a sandbox. + /// + [JsonPropertyName("can_simulate_removal")] + public bool? CanSimulateRemoval { get; init; } + + /// + /// Indicates whether the thermostat can be turned off. + /// + [JsonPropertyName("can_turn_off_hvac")] + public bool? CanTurnOffHvac { get; init; } + + /// + /// Indicates whether the lock supports unlocking with an access code. + /// + [JsonPropertyName("can_unlock_with_code")] + public bool? CanUnlockWithCode { get; init; } + + /// + /// Collection of capabilities that the device supports when connected to Seam. Values are `access_code`, which indicates that the device can manage and utilize digital PIN codes for secure access; `lock`, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; `noise_detection`, which indicates that the device supports monitoring and responding to ambient noise levels; `thermostat`, which indicates that the device can regulate and adjust indoor temperatures; `battery`, which indicates that the device can manage battery life and health; and `phone`, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). + /// + [JsonPropertyName("capabilities_supported")] + public List CapabilitiesSupported { get; init; } = + default!; + + /// + /// Unique identifier for the account associated with the device. + /// + [JsonPropertyName("connected_account_id")] + public string ConnectedAccountId { get; init; } = default!; + + /// + /// Date and time at which the device object was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. + /// + [JsonPropertyName("custom_metadata")] + public object CustomMetadata { get; init; } = default!; + + /// + /// ID of the device. + /// + [JsonPropertyName("device_id")] + public string DeviceId { get; init; } = default!; + + /// + /// Type of the device. + /// + [JsonPropertyName("device_type")] + public UnmanagedDevice.DeviceTypeEnum DeviceType { get; init; } = default!; + + /// + /// Display name of the device, defaults to nickname (if it is set) or `properties.appearance.name`, otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Array of errors associated with the device. Each error object within the array contains two fields: `error_code` and `message`. `error_code` is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Indicates that Seam does not manage the device. + /// + [JsonPropertyName("is_managed")] + public bool IsManaged { get; init; } = default!; + + /// + /// Location information for the device. + /// + [JsonPropertyName("location")] + public UnmanagedDeviceLocation? Location { get; init; } + + /// + /// properties of the device. + /// + [JsonPropertyName("properties")] + public UnmanagedDeviceProperties Properties { get; init; } = default!; + + /// + /// Array of warnings associated with the device. Each warning object within the array contains two fields: `warning_code` and `message`. `warning_code` is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// Unique identifier for the Seam workspace associated with the device. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record UnmanagedDeviceLocation + { + /// + /// Name of the device location. + /// + [JsonPropertyName("location_name")] + public string? LocationName { get; init; } + + /// + /// Name of the room within the device location, when the provider reports one. + /// + [JsonPropertyName("room_name")] + public string? RoomName { get; init; } + + /// + /// Time zone of the device location. + /// + [JsonPropertyName("time_zone")] + public string? TimeZone { get; init; } + + /// + /// Time zone of the device location. + /// + [Obsolete("Use `time_zone` instead.")] + [JsonPropertyName("timezone")] + public string? Timezone { get; init; } + } + + public sealed record UnmanagedDeviceProperties + { + /// + /// Accessory keypad properties and state. + /// + [JsonPropertyName("accessory_keypad")] + public UnmanagedDevicePropertiesAccessoryKeypad? AccessoryKeypad { get; init; } + + /// + /// Represents the current status of the battery charge level. + /// + [JsonPropertyName("battery")] + public UnmanagedDevicePropertiesBattery? Battery { get; init; } + + /// + /// Indicates the battery level of the device as a decimal value between 0 and 1, inclusive. + /// + [JsonPropertyName("battery_level")] + public float? BatteryLevel { get; init; } + + /// + /// Alt text for the device image. + /// + [JsonPropertyName("image_alt_text")] + public string? ImageAltText { get; init; } + + /// + /// Image URL for the device. + /// + [JsonPropertyName("image_url")] + public string? ImageUrl { get; init; } + + /// + /// Manufacturer of the device. When a device, such as a smart lock, is connected through a smart hub, the manufacturer of the device might be different from that of the smart hub. + /// + [JsonPropertyName("manufacturer")] + public string? Manufacturer { get; init; } + + /// + /// Device model-related properties. + /// + [JsonPropertyName("model")] + public UnmanagedDevicePropertiesModel Model { get; init; } = default!; + + /// + /// Name of the device. + /// + [Obsolete("use device.display_name instead")] + [JsonPropertyName("name")] + public string Name { get; init; } = default!; + + /// + /// Indicates whether it is currently possible to use offline access codes for the device. + /// + [Obsolete("use device.can_program_offline_access_codes")] + [JsonPropertyName("offline_access_codes_enabled")] + public bool? OfflineAccessCodesEnabled { get; init; } + + /// + /// Indicates whether the device is online. + /// + [JsonPropertyName("online")] + public bool Online { get; init; } = default!; + + /// + /// Indicates whether it is currently possible to use online access codes for the device. + /// + [Obsolete("use device.can_program_online_access_codes")] + [JsonPropertyName("online_access_codes_enabled")] + public bool? OnlineAccessCodesEnabled { get; init; } + } + + public sealed record UnmanagedDevicePropertiesAccessoryKeypad + { + /// + /// Keypad battery properties. + /// + [JsonPropertyName("battery")] + public UnmanagedDevicePropertiesAccessoryKeypadBattery? Battery { get; init; } + + /// + /// Indicates if an accessory keypad is connected to the device. + /// + [JsonPropertyName("is_connected")] + public bool IsConnected { get; init; } = default!; + } + + public sealed record UnmanagedDevicePropertiesAccessoryKeypadBattery + { + [JsonPropertyName("level")] + public float Level { get; init; } = default!; + } + + public sealed record UnmanagedDevicePropertiesBattery + { + /// + /// Represents the current status of the battery charge level. Values are `critical`, which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; `low`, which signifies that the battery is under the preferred threshold and should be charged soon; `good`, which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and `full`, which represents a battery that is fully charged, providing the maximum duration of usage. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum StatusEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "critical")] + Critical = 1, + + [EnumMember(Value = "low")] + Low = 2, + + [EnumMember(Value = "good")] + Good = 3, + + [EnumMember(Value = "full")] + Full = 4, + } + + /// + /// Battery charge level as a value between 0 and 1, inclusive. + /// + [JsonPropertyName("level")] + public float Level { get; init; } = default!; + + /// + /// Represents the current status of the battery charge level. Values are `critical`, which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; `low`, which signifies that the battery is under the preferred threshold and should be charged soon; `good`, which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and `full`, which represents a battery that is fully charged, providing the maximum duration of usage. + /// + [JsonPropertyName("status")] + public UnmanagedDevicePropertiesBattery.StatusEnum Status { get; init; } = default!; + } + + public sealed record UnmanagedDevicePropertiesModel + { + [Obsolete("use device.properties.model.can_connect_accessory_keypad")] + [JsonPropertyName("accessory_keypad_supported")] + public bool? AccessoryKeypadSupported { get; init; } + + /// + /// Indicates whether the device can connect a accessory keypad. + /// + [JsonPropertyName("can_connect_accessory_keypad")] + public bool? CanConnectAccessoryKeypad { get; init; } + + /// + /// Display name of the device model. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Indicates whether the device has a built in accessory keypad. + /// + [JsonPropertyName("has_built_in_keypad")] + public bool? HasBuiltInKeypad { get; init; } + + /// + /// Display name that corresponds to the manufacturer-specific terminology for the device. + /// + [JsonPropertyName("manufacturer_display_name")] + public string ManufacturerDisplayName { get; init; } = default!; + + [Obsolete("use device.can_program_offline_access_codes.")] + [JsonPropertyName("offline_access_codes_supported")] + public bool? OfflineAccessCodesSupported { get; init; } + + [Obsolete("use device.can_program_online_access_codes.")] + [JsonPropertyName("online_access_codes_supported")] + public bool? OnlineAccessCodesSupported { get; init; } + } +} diff --git a/src/Seam/Models/UnmanagedUserIdentity.cs b/src/Seam/Models/UnmanagedUserIdentity.cs new file mode 100644 index 00000000..4abcc412 --- /dev/null +++ b/src/Seam/Models/UnmanagedUserIdentity.cs @@ -0,0 +1,198 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents an unmanaged user identity. Unmanaged user identities do not have keys. + /// + public sealed record UnmanagedUserIdentity + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant( + "issue_with_acs_user", + typeof(UnmanagedUserIdentityErrorsIssueWithAcsUser) + )] + [SeamUnionFallback(typeof(UnmanagedUserIdentityErrorsUnrecognized))] + public abstract record UnmanagedUserIdentityErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// ID of the access system that the user identity is associated with. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the access system user that has an issue. + /// + [JsonPropertyName("acs_user_id")] + public string AcsUserId { get; init; } = default!; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedUserIdentityErrorsIssueWithAcsUser + : UnmanagedUserIdentityErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "issue_with_acs_user"; + } + + public sealed record UnmanagedUserIdentityErrorsUnrecognized + : UnmanagedUserIdentityErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant("being_deleted", typeof(UnmanagedUserIdentityWarningsBeingDeleted))] + [SeamUnionVariant( + "acs_user_profile_does_not_match_user_identity", + typeof(UnmanagedUserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity) + )] + [SeamUnionFallback(typeof(UnmanagedUserIdentityWarningsUnrecognized))] + public abstract record UnmanagedUserIdentityWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UnmanagedUserIdentityWarningsBeingDeleted + : UnmanagedUserIdentityWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record UnmanagedUserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity + : UnmanagedUserIdentityWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "acs_user_profile_does_not_match_user_identity"; + } + + public sealed record UnmanagedUserIdentityWarningsUnrecognized + : UnmanagedUserIdentityWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Array of access system user IDs associated with the user identity. + /// + [JsonPropertyName("acs_user_ids")] + public List AcsUserIds { get; init; } = default!; + + /// + /// Date and time at which the user identity was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name for the user identity. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Unique email address for the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Array of errors associated with the user identity. Each error object within the array contains fields like "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Full name of the user associated with the user identity. + /// + [JsonPropertyName("full_name")] + public string? FullName { get; init; } + + /// + /// IDs that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. + /// + [JsonPropertyName("merged_user_identity_ids")] + public List MergedUserIdentityIds { get; init; } = default!; + + /// + /// Keys that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. + /// + [JsonPropertyName("merged_user_identity_keys")] + public List MergedUserIdentityKeys { get; init; } = default!; + + /// + /// Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// ID of the user identity. + /// + [JsonPropertyName("user_identity_id")] + public string UserIdentityId { get; init; } = default!; + + /// + /// Array of warnings associated with the user identity. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the workspace that contains the user identity. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } +} diff --git a/src/Seam/Models/UserIdentity.cs b/src/Seam/Models/UserIdentity.cs new file mode 100644 index 00000000..1727f430 --- /dev/null +++ b/src/Seam/Models/UserIdentity.cs @@ -0,0 +1,199 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with an application user account. + /// + public sealed record UserIdentity + { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("issue_with_acs_user", typeof(UserIdentityErrorsIssueWithAcsUser))] + [SeamUnionFallback(typeof(UserIdentityErrorsUnrecognized))] + public abstract record UserIdentityErrors + { + /// The value of the error_code discriminator. + public abstract string ErrorCode { get; } + + /// + /// ID of the access system that the user identity is associated with. + /// + [JsonPropertyName("acs_system_id")] + public string AcsSystemId { get; init; } = default!; + + /// + /// ID of the access system user that has an issue. + /// + [JsonPropertyName("acs_user_id")] + public string AcsUserId { get; init; } = default!; + + /// + /// Date and time at which Seam created the error. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UserIdentityErrorsIssueWithAcsUser : UserIdentityErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "issue_with_acs_user"; + } + + public sealed record UserIdentityErrorsUnrecognized + : UserIdentityErrors, + ISeamUnrecognizedVariant + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant("being_deleted", typeof(UserIdentityWarningsBeingDeleted))] + [SeamUnionVariant( + "acs_user_profile_does_not_match_user_identity", + typeof(UserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity) + )] + [SeamUnionFallback(typeof(UserIdentityWarningsUnrecognized))] + public abstract record UserIdentityWarnings + { + /// The value of the warning_code discriminator. + public abstract string WarningCode { get; } + + /// + /// Date and time at which Seam created the warning. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("message")] + public string Message { get; init; } = default!; + } + + public sealed record UserIdentityWarningsBeingDeleted : UserIdentityWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record UserIdentityWarningsAcsUserProfileDoesNotMatchUserIdentity + : UserIdentityWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "acs_user_profile_does_not_match_user_identity"; + } + + public sealed record UserIdentityWarningsUnrecognized + : UserIdentityWarnings, + ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + + /// + /// Array of access system user IDs associated with the user identity. + /// + [JsonPropertyName("acs_user_ids")] + public List AcsUserIds { get; init; } = default!; + + /// + /// Date and time at which the user identity was created. + /// + [JsonPropertyName("created_at")] + public string CreatedAt { get; init; } = default!; + + /// + /// Display name for the user identity. + /// + [JsonPropertyName("display_name")] + public string DisplayName { get; init; } = default!; + + /// + /// Unique email address for the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Array of errors associated with the user identity. Each error object within the array contains fields like "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("errors")] + public List Errors { get; init; } = default!; + + /// + /// Full name of the user associated with the user identity. + /// + [JsonPropertyName("full_name")] + public string? FullName { get; init; } + + /// + /// IDs that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. + /// + [JsonPropertyName("merged_user_identity_ids")] + public List MergedUserIdentityIds { get; init; } = default!; + + /// + /// Keys that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. + /// + [JsonPropertyName("merged_user_identity_keys")] + public List MergedUserIdentityKeys { get; init; } = default!; + + /// + /// Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// ID of the user identity. + /// + [JsonPropertyName("user_identity_id")] + public string UserIdentityId { get; init; } = default!; + + /// + /// Unique key for the user identity. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + + /// + /// Array of warnings associated with the user identity. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + + /// + /// ID of the workspace that contains the user identity. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } +} diff --git a/src/Seam/Models/Webhook.cs b/src/Seam/Models/Webhook.cs new file mode 100644 index 00000000..7e4440f4 --- /dev/null +++ b/src/Seam/Models/Webhook.cs @@ -0,0 +1,41 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a [webhook](https://docs.seam.co/developer-tools/webhooks) that enables you to receive notifications of events. When you create a webhook, specify the endpoint URL at which you want to receive events and the set of event types that you want to receive. + /// + public sealed record Webhook + { + /// + /// Types of events that the [webhook](https://docs.seam.co/developer-tools/webhooks) should receive. + /// + [JsonPropertyName("event_types")] + public List? EventTypes { get; init; } + + /// + /// Secret associated with the [webhook](https://docs.seam.co/developer-tools/webhooks). + /// + [JsonPropertyName("secret")] + public string? Secret { get; init; } + + /// + /// URL for the [webhook](https://docs.seam.co/developer-tools/webhooks). + /// + [JsonPropertyName("url")] + public string Url { get; init; } = default!; + + /// + /// ID of the webhook. + /// + [JsonPropertyName("webhook_id")] + public string WebhookId { get; init; } = default!; + } +} diff --git a/src/Seam/Models/Workspace.cs b/src/Seam/Models/Workspace.cs new file mode 100644 index 00000000..ae1d4b17 --- /dev/null +++ b/src/Seam/Models/Workspace.cs @@ -0,0 +1,125 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam.Models +{ + /// + /// Represents a Seam [workspace](https://docs.seam.co/core-concepts/workspaces). A workspace is a top-level entity that encompasses all other resources below it, such as devices, connected accounts, and Connect Webviews. Seam provides two types of workspaces. A [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) is a special type of workspace designed for testing code. Sandbox workspaces offer test device accounts and virtual devices that you can connect and control. This ability to work with virtual devices is quite handy because it removes the need to own physical devices from multiple brands. To connect real devices and systems to Seam, use a [production workspace](https://docs.seam.co/core-concepts/workspaces#production-workspaces). + /// + public sealed record Workspace + { + /// + /// Company name associated with the [workspace](https://docs.seam.co/core-concepts/workspaces). + /// + [Obsolete("Use `connect_partner_name` instead.")] + [JsonPropertyName("company_name")] + public string CompanyName { get; init; } = default!; + + /// + /// Seam Connect partner name associated with the [workspace](https://docs.seam.co/core-concepts/workspaces). + /// + [JsonPropertyName("connect_partner_name")] + public string? ConnectPartnerName { get; init; } + + [JsonPropertyName("connect_webview_customization")] + public WorkspaceConnectWebviewCustomization ConnectWebviewCustomization { get; init; } = + default!; + + /// + /// Indicates whether publishable key authentication is enabled for this workspace. + /// + [JsonPropertyName("is_publishable_key_auth_enabled")] + public bool IsPublishableKeyAuthEnabled { get; init; } = default!; + + /// + /// Indicates whether the workspace is a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + [JsonPropertyName("is_sandbox")] + public bool IsSandbox { get; init; } = default!; + + /// + /// Indicates whether the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) is suspended. Seam suspends sandbox workspaces that have not been accessed in 14 days. + /// + [JsonPropertyName("is_suspended")] + public bool IsSuspended { get; init; } = default!; + + /// + /// Name of the [workspace](https://docs.seam.co/core-concepts/workspaces). + /// + [JsonPropertyName("name")] + public string Name { get; init; } = default!; + + /// + /// ID of the organization to which the workspace belongs, or `null` if the workspace is not assigned to an organization. + /// + [JsonPropertyName("organization_id")] + public string? OrganizationId { get; init; } + + /// + /// Publishable key for the [workspace](https://docs.seam.co/core-concepts/workspaces). This key is used to identify the workspace in client-side applications. + /// + [JsonPropertyName("publishable_key")] + public string? PublishableKey { get; init; } + + /// + /// ID of the workspace. + /// + [JsonPropertyName("workspace_id")] + public string WorkspaceId { get; init; } = default!; + } + + public sealed record WorkspaceConnectWebviewCustomization + { + /// + /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum LogoShapeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "circle")] + Circle = 1, + + [EnumMember(Value = "square")] + Square = 2, + } + + /// + /// URL of the inviter logo for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("inviter_logo_url")] + public string? InviterLogoUrl { get; init; } + + /// + /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("logo_shape")] + public WorkspaceConnectWebviewCustomization.LogoShapeEnum? LogoShape { get; init; } + + /// + /// Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("primary_button_color")] + public string? PrimaryButtonColor { get; init; } + + /// + /// Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("primary_button_text_color")] + public string? PrimaryButtonTextColor { get; init; } + + /// + /// Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("success_message")] + public string? SuccessMessage { get; init; } + } +} diff --git a/src/Seam/Pagination/Pagination.cs b/src/Seam/Pagination/Pagination.cs new file mode 100644 index 00000000..0e7e3e6f --- /dev/null +++ b/src/Seam/Pagination/Pagination.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; + +namespace Seam +{ + /// + /// The pagination metadata a paginated list endpoint returns alongside its items. + /// + public sealed record Pagination + { + [JsonPropertyName("has_next_page")] + public required bool HasNextPage { get; init; } + + [JsonPropertyName("next_page_cursor")] + public string? NextPageCursor { get; init; } + + [JsonPropertyName("next_page_url")] + public string? NextPageUrl { get; init; } + } +} diff --git a/src/Seam/Pagination/SeamPage.cs b/src/Seam/Pagination/SeamPage.cs new file mode 100644 index 00000000..b41ae273 --- /dev/null +++ b/src/Seam/Pagination/SeamPage.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace Seam +{ + /// + /// One page of results from a paginated list endpoint. + /// + public sealed record SeamPage(IReadOnlyList Items, Pagination Pagination); +} diff --git a/src/Seam/Pagination/SeamPaginator.cs b/src/Seam/Pagination/SeamPaginator.cs new file mode 100644 index 00000000..851e41b9 --- /dev/null +++ b/src/Seam/Pagination/SeamPaginator.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +namespace Seam +{ + /// + /// Fetches one page of a paginated list endpoint. + /// + /// + /// The cursor of the page to fetch, or null for the first page. + /// + /// Cancels the fetch. + public delegate Task> FetchPage( + string? pageCursor, + CancellationToken cancellationToken + ); + + /// + /// Iterates the pages of a paginated list endpoint. + /// + /// + /// Created by the ListPager method every paginated endpoint offers, e.g. + /// seam.Devices.ListPager(new() { Limit = 20 }), or from any page-fetching function + /// via . + /// + public sealed class SeamPaginator + { + private readonly FetchPage _fetchPage; + + public SeamPaginator(FetchPage fetchPage) + { + _fetchPage = fetchPage; + } + + /// Fetches the first page. + public Task> FirstPageAsync(CancellationToken cancellationToken = default) + { + return _fetchPage(null, cancellationToken); + } + + /// Fetches the page after the given cursor. + public Task> NextPageAsync( + string nextPageCursor, + CancellationToken cancellationToken = default + ) + { + if (string.IsNullOrEmpty(nextPageCursor)) + throw new ArgumentException( + "The next page cursor cannot be null or empty", + nameof(nextPageCursor) + ); + + return _fetchPage(nextPageCursor, cancellationToken); + } + + /// Fetches every page and returns all items as one list. + public async Task> FlattenToListAsync( + CancellationToken cancellationToken = default + ) + { + var items = new List(); + + await foreach (var item in Flatten(cancellationToken).ConfigureAwait(false)) + { + items.Add(item); + } + + return items; + } + + /// Lazily iterates every item across all pages. + public async IAsyncEnumerable Flatten( + [EnumeratorCancellation] CancellationToken cancellationToken = default + ) + { + await foreach (var page in Pages(cancellationToken).ConfigureAwait(false)) + { + foreach (var item in page.Items) + { + yield return item; + } + } + } + + /// Lazily iterates every page. + public async IAsyncEnumerable> Pages( + [EnumeratorCancellation] CancellationToken cancellationToken = default + ) + { + var page = await FirstPageAsync(cancellationToken).ConfigureAwait(false); + yield return page; + + while (page.Pagination.HasNextPage) + { + page = await NextPageAsync(page.Pagination.NextPageCursor!, cancellationToken) + .ConfigureAwait(false); + yield return page; + } + } + } +} diff --git a/src/Seam/Routes/AccessCodes.cs b/src/Seam/Routes/AccessCodes.cs new file mode 100644 index 00000000..05a88047 --- /dev/null +++ b/src/Seam/Routes/AccessCodes.cs @@ -0,0 +1,901 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AccessCodes + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AccessCodes( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + Simulate = new AccessCodesSimulate(transport, waitForActionAttemptDefault); + Unmanaged = new AccessCodesUnmanaged(transport, waitForActionAttemptDefault); + } + + public AccessCodesSimulate Simulate { get; } + + public AccessCodesUnmanaged Unmanaged { get; } + + /// + /// Request parameters for Create an Access Code. + /// + public sealed record CreateRequest + { + /// + /// Maximum rounding adjustment. To create a daily-bound [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) for devices that support this feature, set this parameter to `1d`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum MaxTimeRoundingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "1hour")] + _1hour = 1, + + [EnumMember(Value = "1day")] + _1day = 2, + + [EnumMember(Value = "1h")] + _1h = 3, + + [EnumMember(Value = "1d")] + _1d = 4, + } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. + /// + [JsonPropertyName("allow_external_modification")] + public bool? AllowExternalModification { get; init; } + + [JsonPropertyName("attempt_for_offline_device")] + public bool? AttemptForOfflineDevice { get; init; } + + /// + /// Code to be used for access. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Key to identify access codes that should have the same code. Any two access codes with the same `common_code_key` are guaranteed to have the same `code`. See also [Creating and Updating Multiple Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes). + /// + [JsonPropertyName("common_code_key")] + public string? CommonCodeKey { get; init; } + + /// + /// ID of the device for which you want to create the new access code. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. + /// + [JsonPropertyName("is_external_modification_allowed")] + public bool? IsExternalModificationAllowed { get; init; } + + /// + /// Indicates whether the access code is an [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes). + /// + [JsonPropertyName("is_offline_access_code")] + public bool? IsOfflineAccessCode { get; init; } + + /// + /// Indicates whether the [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) is a single-use access code. + /// + [JsonPropertyName("is_one_time_use")] + public bool? IsOneTimeUse { get; init; } + + /// + /// Maximum rounding adjustment. To create a daily-bound [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) for devices that support this feature, set this parameter to `1d`. + /// + [JsonPropertyName("max_time_rounding")] + public CreateRequest.MaxTimeRoundingEnum? MaxTimeRounding { get; init; } + + /// + /// Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + /// + /// Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. + /// + /// To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + /// + /// To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`. + /// + [JsonPropertyName("prefer_native_scheduling")] + public bool? PreferNativeScheduling { get; init; } + + /// + /// Preferred code length. Only applicable if you do not specify a `code`. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length. + /// + [JsonPropertyName("preferred_code_length")] + public float? PreferredCodeLength { get; init; } + + /// + /// Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code). + /// + [JsonPropertyName("use_backup_access_code_pool")] + public bool? UseBackupAccessCodePool { get; init; } + + [Obsolete("Use `is_offline_access_code` instead.")] + [JsonPropertyName("use_offline_access_code")] + public bool? UseOfflineAccessCode { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("access_code")] + public AccessCode? AccessCode { get; init; } + } + + /// + /// Creates a new [access code](https://docs.seam.co/low-level-apis/access-codes). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they work across both standalone smart locks and access control systems and manage the underlying codes for you. Use this low-level endpoint only when you need direct control over a code on a single device, such as setting a custom PIN value. + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/access_codes/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessCode + ?? throw new HttpRequestException( + "Seam returned no access_code for /access_codes/create" + ); + } + + /// + /// Request parameters for Create Multiple Linked Access Codes. + /// + public sealed record CreateMultipleRequest + { + /// + /// Desired behavior if any device cannot share a code. If `throw` (default), no access codes will be created if any device cannot share a code. If `create_random_code`, a random code will be created on devices that cannot share a code. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum BehaviorWhenCodeCannotBeSharedEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "throw")] + Throw = 1, + + [EnumMember(Value = "create_random_code")] + CreateRandomCode = 2, + } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. + /// + [JsonPropertyName("allow_external_modification")] + public bool? AllowExternalModification { get; init; } + + [JsonPropertyName("attempt_for_offline_device")] + public bool? AttemptForOfflineDevice { get; init; } + + /// + /// Desired behavior if any device cannot share a code. If `throw` (default), no access codes will be created if any device cannot share a code. If `create_random_code`, a random code will be created on devices that cannot share a code. + /// + [JsonPropertyName("behavior_when_code_cannot_be_shared")] + public CreateMultipleRequest.BehaviorWhenCodeCannotBeSharedEnum? BehaviorWhenCodeCannotBeShared { get; init; } + + /// + /// Code to be used for access. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// IDs of the devices for which you want to create the new access codes. + /// + [JsonPropertyName("device_ids")] + public required List DeviceIds { get; init; } + + /// + /// Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. + /// + [JsonPropertyName("is_external_modification_allowed")] + public bool? IsExternalModificationAllowed { get; init; } + + /// + /// Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + /// + /// Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. + /// + /// To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + /// + /// To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`. + /// + [JsonPropertyName("prefer_native_scheduling")] + public bool? PreferNativeScheduling { get; init; } + + /// + /// Preferred code length. If the affected devices do not support the preferred code length, Seam reverts to using the shortest supported code length. + /// + [JsonPropertyName("preferred_code_length")] + public float? PreferredCodeLength { get; init; } + + /// + /// Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code). + /// + [JsonPropertyName("use_backup_access_code_pool")] + public bool? UseBackupAccessCodePool { get; init; } + } + + public sealed record CreateMultipleResponse + { + /// + /// OK + /// + [JsonPropertyName("access_codes")] + public List? AccessCodes { get; init; } + } + + /// + /// Creates new [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. + /// + /// Users with more than one door lock in a property may want to create groups of linked access codes, all of which have the same code (PIN). For example, a short-term rental host may want to provide guests the same PIN for both a front door lock and a back door lock. + /// + /// If you specify a custom code, Seam assigns this custom code to each of the resulting access codes. However, in this case, Seam does not link these access codes together with a `common_code_key`. That is, `common_code_key` remains null for these access codes. + /// + /// If you want to change these access codes that are not linked by a `common_code_key`, you cannot use `/access_codes/update_multiple`. However, you can update each of these access codes individually, using `/access_codes/update`. + /// + /// See also [Creating and Updating Multiple Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes). + /// + /// For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. + /// + public async Task> CreateMultipleAsync( + CreateMultipleRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Put, + "/access_codes/create_multiple", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessCodes + ?? throw new HttpRequestException( + "Seam returned no access_codes for /access_codes/create_multiple" + ); + } + + /// + /// Request parameters for Delete an Access Code. + /// + public sealed record DeleteRequest + { + /// + /// ID of the access code that you want to delete. + /// + [JsonPropertyName("access_code_id")] + public required string AccessCodeId { get; init; } + + /// + /// ID of the device for which you want to delete the access code. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + } + + /// + /// Deletes an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/access_codes/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Generate a Code. + /// + public sealed record GenerateCodeRequest + { + /// + /// ID of the device for which you want to generate a code. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record GenerateCodeResponse + { + /// + /// OK + /// + [JsonPropertyName("generated_code")] + public AccessCode? GeneratedCode { get; init; } + } + + /// + /// Generates a code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes), given a device ID. + /// + public async Task GenerateCodeAsync( + GenerateCodeRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_codes/generate_code", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.GeneratedCode + ?? throw new HttpRequestException( + "Seam returned no generated_code for /access_codes/generate_code" + ); + } + + /// + /// Request parameters for Get an Access Code. + /// + public sealed record GetRequest + { + /// + /// ID of the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. + /// + [JsonPropertyName("access_code_id")] + public string? AccessCodeId { get; init; } + + /// + /// Code of the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// ID of the device containing the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + internal void Validate() + { + if (AccessCodeId == null && Code == null && DeviceId == null) + { + throw new ArgumentException( + "At least one parameter is required for /access_codes/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("access_code")] + public AccessCode? AccessCode { get; init; } + } + + /// + /// Returns a specified [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + /// You must specify either `access_code_id` or both `device_id` and `code`. + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_codes/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessCode + ?? throw new HttpRequestException( + "Seam returned no access_code for /access_codes/get" + ); + } + + /// + /// Request parameters for List Access Codes. + /// + public sealed record ListRequest + { + /// + /// IDs of the access codes that you want to retrieve. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. + /// + [JsonPropertyName("access_code_ids")] + public List? AccessCodeIds { get; init; } + + /// + /// ID of the access grant for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. + /// + [JsonPropertyName("access_grant_id")] + public string? AccessGrantId { get; init; } + + /// + /// Key of the access grant for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + /// + /// ID of the access method for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. + /// + [JsonPropertyName("access_method_id")] + public string? AccessMethodId { get; init; } + + /// + /// Customer key for which you want to list access codes. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// ID of the device for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Numerical limit on the number of access codes to return. + /// + [JsonPropertyName("limit")] + public float? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned access codes to include all records that satisfy a partial match using `name`, `code` or `access_code_id`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// Your user ID for the user by which to filter access codes. + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + + internal void Validate() + { + if ( + AccessCodeIds == null + && AccessGrantId == null + && AccessGrantKey == null + && AccessMethodId == null + && CustomerKey == null + && DeviceId == null + && Limit == null + && !PageCursor.IsSet + && Search == null + && UserIdentifierKey == null + ) + { + throw new ArgumentException( + "At least one parameter is required for /access_codes/list" + ); + } + } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("access_codes")] + public List? AccessCodes { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + /// Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. + /// + public async Task> ListAsync( + ListRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_codes/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessCodes + ?? throw new HttpRequestException( + "Seam returned no access_codes for /access_codes/list" + ); + } + + /// Fetches one page of /access_codes/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_codes/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.AccessCodes + ?? throw new HttpRequestException( + "Seam returned no access_codes for /access_codes/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /access_codes/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /access_codes/list. + public SeamPaginator ListPager(ListRequest request) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null ? request : request with { PageCursor = pageCursor }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Pull a Backup Access Code. + /// + public sealed record PullBackupAccessCodeRequest + { + /// + /// ID of the access code for which you want to pull a backup access code. + /// + [JsonPropertyName("access_code_id")] + public required string AccessCodeId { get; init; } + } + + public sealed record PullBackupAccessCodeResponse + { + /// + /// OK + /// + [JsonPropertyName("access_code")] + public AccessCode? AccessCode { get; init; } + } + + /// + /// Retrieves a backup access code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). See also [Managing Backup Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes). + /// + /// A backup access code pool is a collection of pre-programmed access codes stored on a device, ready for use. These codes are programmed in addition to the regular access codes on Seam, serving as a safety net for any issues with the primary codes. If there's ever a complication with a primary access code—be it due to intermittent connectivity, manual removal from a device, or provider outages—a backup code can be retrieved. Its end time can then be adjusted to align with the original code, facilitating seamless and uninterrupted access. + /// + /// You can pull a backup access code from the pool at any time. These backup codes are guaranteed to work immediately and automatically programmed to be removed from the device after the access code ends. + /// + /// You can only pull backup access codes for time-bound access codes. + /// + /// Before pulling a backup access code, make sure that the device's `properties.supports_backup_access_code_pool` is `true`. Then, to activate the backup pool, set `use_backup_access_code_pool` to `true` when creating an access code. + /// + public async Task PullBackupAccessCodeAsync( + PullBackupAccessCodeRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/access_codes/pull_backup_access_code", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessCode + ?? throw new HttpRequestException( + "Seam returned no access_code for /access_codes/pull_backup_access_code" + ); + } + + /// + /// Request parameters for Report Device Access Code Constraints. + /// + public sealed record ReportDeviceConstraintsRequest + { + /// + /// ID of the device for which you want to report constraints. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Maximum supported code length as an integer between 4 and 20, inclusive. You can specify either `min_code_length`/`max_code_length` or `supported_code_lengths`. + /// + [JsonPropertyName("max_code_length")] + public int? MaxCodeLength { get; init; } + + /// + /// Minimum supported code length as an integer between 4 and 20, inclusive. You can specify either `min_code_length`/`max_code_length` or `supported_code_lengths`. + /// + [JsonPropertyName("min_code_length")] + public int? MinCodeLength { get; init; } + + /// + /// Array of supported code lengths as integers between 4 and 20, inclusive. You can specify either `supported_code_lengths` or `min_code_length`/`max_code_length`. + /// + [JsonPropertyName("supported_code_lengths")] + public List? SupportedCodeLengths { get; init; } + } + + /// + /// Enables you to report access code-related constraints for a device. Currently, supports reporting supported code length constraints for SmartThings devices. + /// + /// Specify either `supported_code_lengths` or `min_code_length`/`max_code_length`. + /// + public async Task ReportDeviceConstraintsAsync( + ReportDeviceConstraintsRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/access_codes/report_device_constraints", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update an Access Code. + /// + public sealed record UpdateRequest + { + /// + /// Type to which you want to convert the access code. To convert a time-bound access code to an ongoing access code, set `type` to `ongoing`. See also [Changing a time-bound access code to permanent access](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes#special-case-2-changing-a-time-bound-access-code-to-permanent-access). + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum TypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "ongoing")] + Ongoing = 1, + + [EnumMember(Value = "time_bound")] + TimeBound = 2, + } + + /// + /// ID of the access code that you want to update. + /// + [JsonPropertyName("access_code_id")] + public required string AccessCodeId { get; init; } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. + /// + [JsonPropertyName("allow_external_modification")] + public bool? AllowExternalModification { get; init; } + + [JsonPropertyName("attempt_for_offline_device")] + public bool? AttemptForOfflineDevice { get; init; } + + /// + /// Code to be used for access. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// ID of the device containing the access code that you want to update. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. + /// + [JsonPropertyName("is_external_modification_allowed")] + public bool? IsExternalModificationAllowed { get; init; } + + /// + /// Indicates whether the access code is managed through Seam. Note that to convert an unmanaged access code into a managed access code, use `/access_codes/unmanaged/convert_to_managed`. + /// + [JsonPropertyName("is_managed")] + public bool? IsManaged { get; init; } + + /// + /// Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + /// + /// Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. + /// + /// To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + /// + /// To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Type to which you want to convert the access code. To convert a time-bound access code to an ongoing access code, set `type` to `ongoing`. See also [Changing a time-bound access code to permanent access](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes#special-case-2-changing-a-time-bound-access-code-to-permanent-access). + /// + [JsonPropertyName("type")] + public UpdateRequest.TypeEnum? Type { get; init; } + } + + /// + /// Updates a specified active or upcoming [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + /// See also [Modifying Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Put, "/access_codes/update", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update Multiple Linked Access Codes. + /// + public sealed record UpdateMultipleRequest + { + /// + /// Key that links the group of access codes, assigned on creation by `/access_codes/create_multiple`. + /// + [JsonPropertyName("common_code_key")] + public required string CommonCodeKey { get; init; } + + /// + /// Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + /// + /// Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. + /// + /// To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + /// + /// To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + /// + /// Updates [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices. + /// + /// Specify the `common_code_key` to identify the set of access codes that you want to update. + /// + /// See also [Update Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes#update-linked-access-codes). + /// + public async Task UpdateMultipleAsync( + UpdateMultipleRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/access_codes/update_multiple", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AccessCodesSimulate.cs b/src/Seam/Routes/AccessCodesSimulate.cs new file mode 100644 index 00000000..89ff4222 --- /dev/null +++ b/src/Seam/Routes/AccessCodesSimulate.cs @@ -0,0 +1,83 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AccessCodesSimulate + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AccessCodesSimulate( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Simulate Creating an Unmanaged Access Code. + /// + public sealed record CreateUnmanagedAccessCodeRequest + { + /// + /// Code of the simulated unmanaged access code. + /// + [JsonPropertyName("code")] + public required string Code { get; init; } + + /// + /// ID of the device for which you want to simulate the creation of an unmanaged access code. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Name of the simulated unmanaged access code. + /// + [JsonPropertyName("name")] + public required string Name { get; init; } + } + + public sealed record CreateUnmanagedAccessCodeResponse + { + /// + /// OK + /// + [JsonPropertyName("access_code")] + public UnmanagedAccessCode? AccessCode { get; init; } + } + + /// + /// Simulates the creation of an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + public async Task CreateUnmanagedAccessCodeAsync( + CreateUnmanagedAccessCodeRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/access_codes/simulate/create_unmanaged_access_code", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessCode + ?? throw new HttpRequestException( + "Seam returned no access_code for /access_codes/simulate/create_unmanaged_access_code" + ); + } + } +} diff --git a/src/Seam/Routes/AccessCodesUnmanaged.cs b/src/Seam/Routes/AccessCodesUnmanaged.cs new file mode 100644 index 00000000..2eab729e --- /dev/null +++ b/src/Seam/Routes/AccessCodesUnmanaged.cs @@ -0,0 +1,341 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AccessCodesUnmanaged + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AccessCodesUnmanaged( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Convert an Unmanaged Access Code. + /// + public sealed record ConvertToManagedRequest + { + /// + /// ID of the unmanaged access code that you want to convert to a managed access code. + /// + [JsonPropertyName("access_code_id")] + public required string AccessCodeId { get; init; } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the access code is allowed. + /// + [JsonPropertyName("allow_external_modification")] + public bool? AllowExternalModification { get; init; } + + /// + /// Indicates whether to force the access code conversion. To switch management of an access code from one Seam workspace to another, set `force` to `true`. + /// + [JsonPropertyName("force")] + public bool? Force { get; init; } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the access code is allowed. + /// + [JsonPropertyName("is_external_modification_allowed")] + public bool? IsExternalModificationAllowed { get; init; } + } + + /// + /// Converts an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) to an [access code managed through Seam](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + /// + /// An unmanaged access code has a limited set of operations that you can perform on it. Once you convert an unmanaged access code to a managed access code, the full set of access code operations and lifecycle events becomes available for it. + /// + /// Note that not all device providers support converting an unmanaged access code to a managed access code. + /// + public async Task ConvertToManagedAsync( + ConvertToManagedRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/access_codes/unmanaged/convert_to_managed", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Delete an Unmanaged Access Code. + /// + public sealed record DeleteRequest + { + /// + /// ID of the unmanaged access code that you want to delete. + /// + [JsonPropertyName("access_code_id")] + public required string AccessCodeId { get; init; } + } + + /// + /// Deletes an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/access_codes/unmanaged/delete", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get an Unmanaged Access Code. + /// + public sealed record GetRequest + { + /// + /// ID of the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. + /// + [JsonPropertyName("access_code_id")] + public string? AccessCodeId { get; init; } + + /// + /// Code of the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// ID of the device containing the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + internal void Validate() + { + if (AccessCodeId == null && Code == null && DeviceId == null) + { + throw new ArgumentException( + "At least one parameter is required for /access_codes/unmanaged/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("access_code")] + public UnmanagedAccessCode? AccessCode { get; init; } + } + + /// + /// Returns a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + /// + /// You must specify either `access_code_id` or both `device_id` and `code`. + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_codes/unmanaged/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessCode + ?? throw new HttpRequestException( + "Seam returned no access_code for /access_codes/unmanaged/get" + ); + } + + /// + /// Request parameters for List Unmanaged Access Codes. + /// + public sealed record ListRequest + { + /// + /// ID of the device for which you want to list unmanaged access codes. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Numerical limit on the number of unmanaged access codes to return. + /// + [JsonPropertyName("limit")] + public float? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned access codes to include all records that satisfy a partial match using `name`, `code` or `access_code_id`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// Your user ID for the user by which to filter unmanaged access codes. + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("access_codes")] + public List? AccessCodes { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [unmanaged access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + /// + public async Task> ListAsync( + ListRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_codes/unmanaged/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessCodes + ?? throw new HttpRequestException( + "Seam returned no access_codes for /access_codes/unmanaged/list" + ); + } + + /// Fetches one page of /access_codes/unmanaged/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_codes/unmanaged/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.AccessCodes + ?? throw new HttpRequestException( + "Seam returned no access_codes for /access_codes/unmanaged/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /access_codes/unmanaged/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /access_codes/unmanaged/list. + public SeamPaginator ListPager(ListRequest request) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null ? request : request with { PageCursor = pageCursor }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Update an Unmanaged Access Code. + /// + public sealed record UpdateRequest + { + /// + /// ID of the unmanaged access code that you want to update. + /// + [JsonPropertyName("access_code_id")] + public required string AccessCodeId { get; init; } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. + /// + [JsonPropertyName("allow_external_modification")] + public bool? AllowExternalModification { get; init; } + + /// + /// Indicates whether to force the unmanaged access code update. + /// + [JsonPropertyName("force")] + public bool? Force { get; init; } + + /// + /// Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. + /// + [JsonPropertyName("is_external_modification_allowed")] + public bool? IsExternalModificationAllowed { get; init; } + + [JsonPropertyName("is_managed")] + public required bool IsManaged { get; init; } + } + + /// + /// Updates a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/access_codes/unmanaged/update", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AccessGrants.cs b/src/Seam/Routes/AccessGrants.cs new file mode 100644 index 00000000..cda514b4 --- /dev/null +++ b/src/Seam/Routes/AccessGrants.cs @@ -0,0 +1,777 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AccessGrants + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AccessGrants( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + Unmanaged = new AccessGrantsUnmanaged(transport, waitForActionAttemptDefault); + } + + public AccessGrantsUnmanaged Unmanaged { get; } + + /// + /// Request parameters for Create an Access Grant. + /// + public sealed record CreateRequest + { + /// + /// ID of user identity for whom access is being granted. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// When used, creates a new user identity with the given details, and grants them access. + /// + [JsonPropertyName("user_identity")] + public CreateRequestUserIdentity? UserIdentity { get; init; } + + /// + /// Unique key for the access grant within the workspace. + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + /// + /// Set of IDs of the [entrances](https://docs.seam.co/api/acs/systems/list) to which access is being granted. + /// + [JsonPropertyName("acs_entrance_ids")] + public List? AcsEntranceIds { get; init; } + + /// + /// ID of the customization profile to apply to the Access Grant and its access methods. + /// + [JsonPropertyName("customization_profile_id")] + public string? CustomizationProfileId { get; init; } + + /// + /// Set of IDs of the [devices](https://docs.seam.co/api/devices/list) to which access is being granted. + /// + [JsonPropertyName("device_ids")] + public List? DeviceIds { get; init; } + + /// + /// Date and time at which the validity of the new grant ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public Optional EndsAt { get; init; } + + [Obsolete("Create a space first, then reference it using `space_ids`.")] + [JsonPropertyName("location")] + public CreateRequestLocation? Location { get; init; } + + [Obsolete("Use `space_ids`.")] + [JsonPropertyName("location_ids")] + public List? LocationIds { get; init; } + + /// + /// Name for the access grant. + /// + [JsonPropertyName("name")] + public Optional Name { get; init; } + + [JsonPropertyName("requested_access_methods")] + public required List RequestedAccessMethods { get; init; } + + /// + /// Reservation key for the access grant. + /// + [JsonPropertyName("reservation_key")] + public string? ReservationKey { get; init; } + + /// + /// Set of IDs of existing spaces to which access is being granted. + /// + [JsonPropertyName("space_ids")] + public List? SpaceIds { get; init; } + + /// + /// Set of keys of existing spaces to which access is being granted. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// Date and time at which the validity of the new grant starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record CreateRequestUserIdentity + { + /// + /// Unique email address for the user identity. + /// + [JsonPropertyName("email_address")] + public Optional EmailAddress { get; init; } + + /// + /// Full name of the user associated with the user identity. + /// + [JsonPropertyName("full_name")] + public Optional FullName { get; init; } + + /// + /// Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). + /// + [JsonPropertyName("phone_number")] + public Optional PhoneNumber { get; init; } + + /// + /// Unique key for the user identity. + /// + [JsonPropertyName("user_identity_key")] + public Optional UserIdentityKey { get; init; } + } + + public sealed record CreateRequestLocation + { + [Obsolete("Use `acs_entrance_ids` at the top level.")] + [JsonPropertyName("acs_entrance_ids")] + public List? AcsEntranceIds { get; init; } + + [Obsolete("Use `device_ids` at the top level.")] + [JsonPropertyName("device_ids")] + public List? DeviceIds { get; init; } + + /// + /// Name of the location. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record CreateRequestRequestedAccessMethods + { + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// Specific PIN code to use for this access method. Only applicable when mode is 'code'. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Maximum number of times the instant key can be used. Only applicable when mode is 'mobile_key'. Defaults to 1 if not specified. + /// + [JsonPropertyName("instant_key_max_use_count")] + public int? InstantKeyMaxUseCount { get; init; } + + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("mode")] + public CreateRequestRequestedAccessMethods.ModeEnum? Mode { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("access_grant")] + public AccessGrant? AccessGrant { get; init; } + } + + /// + /// Creates a new [Access Grant](https://docs.seam.co/use-cases/granting-access/access-grants). Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using `device_ids`) and access control systems (using `acs_entrance_ids` or `space_ids`), and can issue PIN codes, key cards, and mobile keys through a single request. + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/access_grants/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessGrant + ?? throw new HttpRequestException( + "Seam returned no access_grant for /access_grants/create" + ); + } + + /// + /// Request parameters for Delete an Access Grant. + /// + public sealed record DeleteRequest + { + /// + /// ID of Access Grant to delete. + /// + [JsonPropertyName("access_grant_id")] + public required string AccessGrantId { get; init; } + } + + /// + /// Delete an Access Grant. + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/access_grants/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get an Access Grant. + /// + public sealed record GetRequest + { + /// + /// ID of Access Grant to get. + /// + [JsonPropertyName("access_grant_id")] + public string? AccessGrantId { get; init; } + + /// + /// Unique key of Access Grant to get. + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + internal void Validate() + { + if (AccessGrantId == null && AccessGrantKey == null) + { + throw new ArgumentException( + "At least one parameter is required for /access_grants/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("access_grant")] + public AccessGrant? AccessGrant { get; init; } + } + + /// + /// Get an Access Grant. + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_grants/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessGrant + ?? throw new HttpRequestException( + "Seam returned no access_grant for /access_grants/get" + ); + } + + /// + /// Request parameters for Get related Access Grant resources. + /// + public sealed record GetRelatedRequest + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExcludeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "spaces")] + Spaces = 1, + + [EnumMember(Value = "devices")] + Devices = 2, + + [EnumMember(Value = "acs_entrances")] + AcsEntrances = 3, + + [EnumMember(Value = "connected_accounts")] + ConnectedAccounts = 4, + + [EnumMember(Value = "acs_systems")] + AcsSystems = 5, + + [EnumMember(Value = "user_identities")] + UserIdentities = 6, + + [EnumMember(Value = "acs_access_groups")] + AcsAccessGroups = 7, + + [EnumMember(Value = "access_methods")] + AccessMethods = 8, + } + + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum IncludeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "spaces")] + Spaces = 1, + + [EnumMember(Value = "devices")] + Devices = 2, + + [EnumMember(Value = "acs_entrances")] + AcsEntrances = 3, + + [EnumMember(Value = "connected_accounts")] + ConnectedAccounts = 4, + + [EnumMember(Value = "acs_systems")] + AcsSystems = 5, + + [EnumMember(Value = "user_identities")] + UserIdentities = 6, + + [EnumMember(Value = "acs_access_groups")] + AcsAccessGroups = 7, + + [EnumMember(Value = "access_methods")] + AccessMethods = 8, + } + + /// + /// IDs of the access grants that you want to get along with their related resources. + /// + [JsonPropertyName("access_grant_ids")] + public List? AccessGrantIds { get; init; } + + /// + /// Keys of the access grants that you want to get along with their related resources. + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + [JsonPropertyName("exclude")] + public List? Exclude { get; init; } + + [JsonPropertyName("include")] + public List? Include { get; init; } + + internal void Validate() + { + if ( + AccessGrantIds == null + && AccessGrantKeys == null + && Exclude == null + && Include == null + ) + { + throw new ArgumentException( + "At least one parameter is required for /access_grants/get_related" + ); + } + } + } + + public sealed record GetRelatedResponse + { + /// + /// OK + /// + [JsonPropertyName("batch")] + public Batch? Batch { get; init; } + } + + /// + /// Gets all related resources for one or more Access Grants. + /// + public async Task GetRelatedAsync( + GetRelatedRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_grants/get_related", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Batch + ?? throw new HttpRequestException( + "Seam returned no batch for /access_grants/get_related" + ); + } + + /// + /// Request parameters for List Access Grants. + /// + public sealed record ListRequest + { + /// + /// ID of the access code by which you want to filter the list of Access Grants. + /// + [JsonPropertyName("access_code_id")] + public string? AccessCodeId { get; init; } + + /// + /// IDs of the access grants to retrieve. + /// + [JsonPropertyName("access_grant_ids")] + public List? AccessGrantIds { get; init; } + + /// + /// Filter Access Grants by access_grant_key. Use null to filter for Access Grants without an access_grant_key. + /// + [JsonPropertyName("access_grant_key")] + public Optional AccessGrantKey { get; init; } + + /// + /// ID of the entrance by which you want to filter the list of Access Grants. + /// + [JsonPropertyName("acs_entrance_id")] + public string? AcsEntranceId { get; init; } + + /// + /// ID of the access system by which you want to filter the list of Access Grants. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// Customer key for which you want to list access grants. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// ID of the device by which you want to filter the list of Access Grants. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Numerical limit on the number of access grants to return. + /// + [JsonPropertyName("limit")] + public float? Limit { get; init; } + + [Obsolete("Use `space_id`.")] + [JsonPropertyName("location_id")] + public string? LocationId { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// Filter Access Grants by reservation_key. + /// + [JsonPropertyName("reservation_key")] + public string? ReservationKey { get; init; } + + /// + /// ID of the space by which you want to filter the list of Access Grants. + /// + [JsonPropertyName("space_id")] + public string? SpaceId { get; init; } + + /// + /// ID of user identity by which you want to filter the list of Access Grants. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("access_grants")] + public List? AccessGrants { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Gets an Access Grant. + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_grants/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessGrants + ?? throw new HttpRequestException( + "Seam returned no access_grants for /access_grants/list" + ); + } + + /// Fetches one page of /access_grants/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_grants/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.AccessGrants + ?? throw new HttpRequestException( + "Seam returned no access_grants for /access_grants/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /access_grants/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /access_grants/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Add Requested Access Methods to Access Grant. + /// + public sealed record RequestAccessMethodsRequest + { + /// + /// ID of the Access Grant to add access methods to. + /// + [JsonPropertyName("access_grant_id")] + public required string AccessGrantId { get; init; } + + /// + /// Array of requested access methods to add to the access grant. + /// + [JsonPropertyName("requested_access_methods")] + public required List RequestedAccessMethods { get; init; } + } + + public sealed record RequestAccessMethodsRequestRequestedAccessMethods + { + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// Specific PIN code to use for this access method. Only applicable when mode is 'code'. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Maximum number of times the instant key can be used. Only applicable when mode is 'mobile_key'. Defaults to 1 if not specified. + /// + [JsonPropertyName("instant_key_max_use_count")] + public int? InstantKeyMaxUseCount { get; init; } + + /// + /// Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("mode")] + public RequestAccessMethodsRequestRequestedAccessMethods.ModeEnum? Mode { get; init; } + } + + public sealed record RequestAccessMethodsResponse + { + /// + /// OK + /// + [JsonPropertyName("access_grant")] + public AccessGrant? AccessGrant { get; init; } + } + + /// + /// Adds additional requested access methods to an existing Access Grant. + /// + public async Task RequestAccessMethodsAsync( + RequestAccessMethodsRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/access_grants/request_access_methods", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessGrant + ?? throw new HttpRequestException( + "Seam returned no access_grant for /access_grants/request_access_methods" + ); + } + + /// + /// Request parameters for Update an Access Grant. + /// + public sealed record UpdateRequest + { + /// + /// ID of the Access Grant to update. Provide either `access_grant_id` or `access_grant_key`. + /// + [JsonPropertyName("access_grant_id")] + public string? AccessGrantId { get; init; } + + /// + /// Key of the Access Grant to update. Provide either `access_grant_id` or `access_grant_key`. + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + /// + /// Date and time at which the validity of the grant ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public Optional EndsAt { get; init; } + + /// + /// Display name for the access grant. + /// + [JsonPropertyName("name")] + public Optional Name { get; init; } + + /// + /// Date and time at which the validity of the grant starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + internal void Validate() + { + if ( + AccessGrantId == null + && AccessGrantKey == null + && !EndsAt.IsSet + && !Name.IsSet + && StartsAt == null + ) + { + throw new ArgumentException( + "At least one parameter is required for /access_grants/update" + ); + } + } + } + + /// + /// Updates an existing Access Grant's time window. + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + await _transport + .SendAsync(HttpMethod.Patch, "/access_grants/update", request, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AccessGrantsUnmanaged.cs b/src/Seam/Routes/AccessGrantsUnmanaged.cs new file mode 100644 index 00000000..438873a2 --- /dev/null +++ b/src/Seam/Routes/AccessGrantsUnmanaged.cs @@ -0,0 +1,240 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AccessGrantsUnmanaged + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AccessGrantsUnmanaged( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Get an Unmanaged Access Grant. + /// + public sealed record GetRequest + { + /// + /// ID of unmanaged Access Grant to get. + /// + [JsonPropertyName("access_grant_id")] + public required string AccessGrantId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("access_grant")] + public UnmanagedAccessGrant? AccessGrant { get; init; } + } + + /// + /// Get an unmanaged Access Grant (where is_managed = false). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_grants/unmanaged/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessGrant + ?? throw new HttpRequestException( + "Seam returned no access_grant for /access_grants/unmanaged/get" + ); + } + + /// + /// Request parameters for List Unmanaged Access Grants. + /// + public sealed record ListRequest + { + /// + /// ID of the entrance by which you want to filter the list of unmanaged Access Grants. + /// + [JsonPropertyName("acs_entrance_id")] + public string? AcsEntranceId { get; init; } + + /// + /// ID of the access system by which you want to filter the list of unmanaged Access Grants. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// Numerical limit on the number of unmanaged access grants to return. + /// + [JsonPropertyName("limit")] + public float? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// Filter unmanaged Access Grants by reservation_key. + /// + [JsonPropertyName("reservation_key")] + public string? ReservationKey { get; init; } + + /// + /// ID of user identity by which you want to filter the list of unmanaged Access Grants. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("access_grants")] + public List? AccessGrants { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Gets unmanaged Access Grants (where is_managed = false). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_grants/unmanaged/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessGrants + ?? throw new HttpRequestException( + "Seam returned no access_grants for /access_grants/unmanaged/list" + ); + } + + /// Fetches one page of /access_grants/unmanaged/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_grants/unmanaged/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.AccessGrants + ?? throw new HttpRequestException( + "Seam returned no access_grants for /access_grants/unmanaged/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /access_grants/unmanaged/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /access_grants/unmanaged/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Update an Unmanaged Access Grant. + /// + public sealed record UpdateRequest + { + /// + /// ID of the unmanaged Access Grant to update. + /// + [JsonPropertyName("access_grant_id")] + public required string AccessGrantId { get; init; } + + /// + /// Unique key for the access grant. If not provided, the existing key will be preserved. + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + /// + /// Must be set to true to convert the unmanaged access grant to managed. + /// + [JsonPropertyName("is_managed")] + public required bool IsManaged { get; init; } + } + + /// + /// Updates an unmanaged Access Grant to make it managed. + /// + /// This endpoint can only be used to convert unmanaged access grants to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed access grants back to unmanaged. + /// + /// When converting an unmanaged access grant to managed, all associated access methods will also be converted to managed. + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/access_grants/unmanaged/update", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AccessMethods.cs b/src/Seam/Routes/AccessMethods.cs new file mode 100644 index 00000000..5d610cc5 --- /dev/null +++ b/src/Seam/Routes/AccessMethods.cs @@ -0,0 +1,560 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AccessMethods + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AccessMethods( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + Unmanaged = new AccessMethodsUnmanaged(transport, waitForActionAttemptDefault); + } + + public AccessMethodsUnmanaged Unmanaged { get; } + + /// + /// Request parameters for Assign a Card Credential to an Access Method. + /// + public sealed record AssignCardRequest + { + /// + /// ID of the `access_method` to assign the credential to. + /// + [JsonPropertyName("access_method_id")] + public required string AccessMethodId { get; init; } + + /// + /// Card number of the credential to assign. + /// + [JsonPropertyName("card_number")] + public required string CardNumber { get; init; } + } + + public sealed record AssignCardResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Assigns a pre-registered card credential, identified by `card_number`, to a card-mode access method. Use this endpoint for access systems that use pre-registered cards, where a physical card must be associated with an access method before it can be used for access. Assigning a card credential also triggers issuance of the access method. + /// + public async Task AssignCardAsync( + AssignCardRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/access_methods/assign_card", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /access_methods/assign_card" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Delete an Access Method. + /// + public sealed record DeleteRequest + { + /// + /// ID of access method to delete. + /// + [JsonPropertyName("access_method_id")] + public string? AccessMethodId { get; init; } + + /// + /// ID of access grant whose access methods should be deleted. + /// + [JsonPropertyName("access_grant_id")] + public string? AccessGrantId { get; init; } + + /// + /// Reservation key of the access grant whose access methods should be deleted. + /// + [JsonPropertyName("reservation_key")] + public string? ReservationKey { get; init; } + + internal void Validate() + { + if (AccessMethodId == null && AccessGrantId == null && ReservationKey == null) + { + throw new ArgumentException( + "At least one parameter is required for /access_methods/delete" + ); + } + } + } + + /// + /// Deletes an access method. + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + await _transport + .SendAsync(HttpMethod.Delete, "/access_methods/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Encode an Access Method. + /// + public sealed record EncodeRequest + { + /// + /// ID of the `access_method` to encode onto a card. + /// + [JsonPropertyName("access_method_id")] + public required string AccessMethodId { get; init; } + + /// + /// ID of the `acs_encoder` to use to encode the `access_method`. + /// + [JsonPropertyName("acs_encoder_id")] + public required string AcsEncoderId { get; init; } + } + + public sealed record EncodeResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Encodes an existing access method onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + public async Task EncodeAsync( + EncodeRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/access_methods/encode", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /access_methods/encode" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get an Access Method. + /// + public sealed record GetRequest + { + /// + /// ID of access method to get. + /// + [JsonPropertyName("access_method_id")] + public required string AccessMethodId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("access_method")] + public AccessMethod? AccessMethod { get; init; } + } + + /// + /// Gets an access method. + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_methods/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessMethod + ?? throw new HttpRequestException( + "Seam returned no access_method for /access_methods/get" + ); + } + + /// + /// Request parameters for Get related Access Method resources. + /// + public sealed record GetRelatedRequest + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExcludeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "spaces")] + Spaces = 1, + + [EnumMember(Value = "devices")] + Devices = 2, + + [EnumMember(Value = "acs_entrances")] + AcsEntrances = 3, + + [EnumMember(Value = "access_grants")] + AccessGrants = 4, + + [EnumMember(Value = "access_methods")] + AccessMethods = 5, + + [EnumMember(Value = "instant_keys")] + InstantKeys = 6, + + [EnumMember(Value = "client_sessions")] + ClientSessions = 7, + + [EnumMember(Value = "acs_credentials")] + AcsCredentials = 8, + } + + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum IncludeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "spaces")] + Spaces = 1, + + [EnumMember(Value = "devices")] + Devices = 2, + + [EnumMember(Value = "acs_entrances")] + AcsEntrances = 3, + + [EnumMember(Value = "access_grants")] + AccessGrants = 4, + + [EnumMember(Value = "access_methods")] + AccessMethods = 5, + + [EnumMember(Value = "instant_keys")] + InstantKeys = 6, + + [EnumMember(Value = "client_sessions")] + ClientSessions = 7, + + [EnumMember(Value = "acs_credentials")] + AcsCredentials = 8, + } + + /// + /// IDs of the access methods that you want to get along with their related resources. + /// + [JsonPropertyName("access_method_ids")] + public required List AccessMethodIds { get; init; } + + [JsonPropertyName("exclude")] + public List? Exclude { get; init; } + + [JsonPropertyName("include")] + public List? Include { get; init; } + } + + public sealed record GetRelatedResponse + { + /// + /// OK + /// + [JsonPropertyName("batch")] + public Batch? Batch { get; init; } + } + + /// + /// Gets all related resources for one or more Access Methods. + /// + public async Task GetRelatedAsync( + GetRelatedRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_methods/get_related", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Batch + ?? throw new HttpRequestException( + "Seam returned no batch for /access_methods/get_related" + ); + } + + /// + /// Request parameters for List Access Methods. + /// + public sealed record ListRequest + { + /// + /// ID of the access code by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. + /// + [JsonPropertyName("access_code_id")] + public string? AccessCodeId { get; init; } + + /// + /// ID of Access Grant to list access methods for. + /// + [JsonPropertyName("access_grant_id")] + public string? AccessGrantId { get; init; } + + /// + /// Key of Access Grant to list access methods for. + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + /// + /// ID of the entrance for which you want to retrieve all access methods that grant access to it. + /// + [JsonPropertyName("acs_entrance_id")] + public string? AcsEntranceId { get; init; } + + /// + /// ID of the device by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Maximum number of records to return per page. + /// + [JsonPropertyName("limit")] + public int? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// ID of the space by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. + /// + [JsonPropertyName("space_id")] + public string? SpaceId { get; init; } + + internal void Validate() + { + if ( + AccessCodeId == null + && AccessGrantId == null + && AccessGrantKey == null + && AcsEntranceId == null + && DeviceId == null + && Limit == null + && !PageCursor.IsSet + && SpaceId == null + ) + { + throw new ArgumentException( + "At least one parameter is required for /access_methods/list" + ); + } + } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("access_methods")] + public List? AccessMethods { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Lists all access methods, usually filtered by Access Grant. + /// + public async Task> ListAsync( + ListRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_methods/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessMethods + ?? throw new HttpRequestException( + "Seam returned no access_methods for /access_methods/list" + ); + } + + /// Fetches one page of /access_methods/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_methods/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.AccessMethods + ?? throw new HttpRequestException( + "Seam returned no access_methods for /access_methods/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /access_methods/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /access_methods/list. + public SeamPaginator ListPager(ListRequest request) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null ? request : request with { PageCursor = pageCursor }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Unlock a Door with an Access Method. + /// + public sealed record UnlockDoorRequest + { + /// + /// ID of the cloud_key `access_method` to use for the unlock operation. + /// + [JsonPropertyName("access_method_id")] + public required string AccessMethodId { get; init; } + + /// + /// ID of the entrance to unlock. + /// + [JsonPropertyName("acs_entrance_id")] + public required string AcsEntranceId { get; init; } + } + + public sealed record UnlockDoorResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using the cloud key credential associated with an access method. Returns an action attempt that tracks the progress of the unlock operation. + /// + public async Task UnlockDoorAsync( + UnlockDoorRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/access_methods/unlock_door", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /access_methods/unlock_door" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AccessMethodsUnmanaged.cs b/src/Seam/Routes/AccessMethodsUnmanaged.cs new file mode 100644 index 00000000..18f9c736 --- /dev/null +++ b/src/Seam/Routes/AccessMethodsUnmanaged.cs @@ -0,0 +1,132 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AccessMethodsUnmanaged + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AccessMethodsUnmanaged( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Get an Unmanaged Access Method. + /// + public sealed record GetRequest + { + /// + /// ID of unmanaged access method to get. + /// + [JsonPropertyName("access_method_id")] + public required string AccessMethodId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("access_method")] + public UnmanagedAccessMethod? AccessMethod { get; init; } + } + + /// + /// Gets an unmanaged access method (where is_managed = false). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_methods/unmanaged/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessMethod + ?? throw new HttpRequestException( + "Seam returned no access_method for /access_methods/unmanaged/get" + ); + } + + /// + /// Request parameters for List Unmanaged Access Methods. + /// + public sealed record ListRequest + { + /// + /// ID of Access Grant to list unmanaged access methods for. + /// + [JsonPropertyName("access_grant_id")] + public required string AccessGrantId { get; init; } + + /// + /// ID of the entrance for which you want to retrieve all unmanaged access methods. + /// + [JsonPropertyName("acs_entrance_id")] + public string? AcsEntranceId { get; init; } + + /// + /// ID of the device for which you want to retrieve all unmanaged access methods. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// ID of the space for which you want to retrieve all unmanaged access methods. + /// + [JsonPropertyName("space_id")] + public string? SpaceId { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("access_methods")] + public List? AccessMethods { get; init; } + } + + /// + /// Lists all unmanaged access methods (where is_managed = false), usually filtered by Access Grant. + /// + public async Task> ListAsync( + ListRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/access_methods/unmanaged/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AccessMethods + ?? throw new HttpRequestException( + "Seam returned no access_methods for /access_methods/unmanaged/list" + ); + } + } +} diff --git a/src/Seam/Routes/Acs.cs b/src/Seam/Routes/Acs.cs new file mode 100644 index 00000000..5094521b --- /dev/null +++ b/src/Seam/Routes/Acs.cs @@ -0,0 +1,43 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class Acs + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal Acs(SeamHttpTransport transport, ActionAttemptWait waitForActionAttemptDefault) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + AccessGroups = new AcsAccessGroups(transport, waitForActionAttemptDefault); + Credentials = new AcsCredentials(transport, waitForActionAttemptDefault); + Encoders = new AcsEncoders(transport, waitForActionAttemptDefault); + Entrances = new AcsEntrances(transport, waitForActionAttemptDefault); + Systems = new AcsSystems(transport, waitForActionAttemptDefault); + Users = new AcsUsers(transport, waitForActionAttemptDefault); + } + + public AcsAccessGroups AccessGroups { get; } + + public AcsCredentials Credentials { get; } + + public AcsEncoders Encoders { get; } + + public AcsEntrances Entrances { get; } + + public AcsSystems Systems { get; } + + public AcsUsers Users { get; } + } +} diff --git a/src/Seam/Routes/AcsAccessGroups.cs b/src/Seam/Routes/AcsAccessGroups.cs new file mode 100644 index 00000000..5f560b01 --- /dev/null +++ b/src/Seam/Routes/AcsAccessGroups.cs @@ -0,0 +1,332 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AcsAccessGroups + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AcsAccessGroups( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Add an ACS User to an Access Group. + /// + public sealed record AddUserRequest + { + /// + /// ID of the access group to which you want to add an access system user. + /// + [JsonPropertyName("acs_access_group_id")] + public required string AcsAccessGroupId { get; init; } + + /// + /// ID of the access system user that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the desired user identity that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + /// + /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + /// + public async Task AddUserAsync( + AddUserRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Put, + "/acs/access_groups/add_user", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Delete an Access Group. + /// + public sealed record DeleteRequest + { + /// + /// ID of the access group that you want to delete. + /// + [JsonPropertyName("acs_access_group_id")] + public required string AcsAccessGroupId { get; init; } + } + + /// + /// Deletes a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/acs/access_groups/delete", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get an Access Group. + /// + public sealed record GetRequest + { + /// + /// ID of the access group that you want to get. + /// + [JsonPropertyName("acs_access_group_id")] + public required string AcsAccessGroupId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_access_group")] + public AcsAccessGroup? AcsAccessGroup { get; init; } + } + + /// + /// Returns a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/access_groups/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsAccessGroup + ?? throw new HttpRequestException( + "Seam returned no acs_access_group for /acs/access_groups/get" + ); + } + + /// + /// Request parameters for List Access Groups. + /// + public sealed record ListRequest + { + /// + /// ID of the access system for which you want to retrieve all access groups. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user for which you want to retrieve all access groups. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// String for which to search. Filters returned access groups to include all records that satisfy a partial match using `name` or `acs_access_group_id`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// ID of the user identity for which you want to retrieve all access groups. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_access_groups")] + public List? AcsAccessGroups { get; init; } + } + + /// + /// Returns a list of all [access groups](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/access_groups/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsAccessGroups + ?? throw new HttpRequestException( + "Seam returned no acs_access_groups for /acs/access_groups/list" + ); + } + + /// + /// Request parameters for List Entrances Accessible to an Access Group. + /// + public sealed record ListAccessibleEntrancesRequest + { + /// + /// ID of the access group for which you want to retrieve all accessible entrances. + /// + [JsonPropertyName("acs_access_group_id")] + public required string AcsAccessGroupId { get; init; } + } + + public sealed record ListAccessibleEntrancesResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_entrances")] + public List? AcsEntrances { get; init; } + } + + /// + /// Returns a list of all accessible entrances for a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + /// + public async Task> ListAccessibleEntrancesAsync( + ListAccessibleEntrancesRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/access_groups/list_accessible_entrances", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsEntrances + ?? throw new HttpRequestException( + "Seam returned no acs_entrances for /acs/access_groups/list_accessible_entrances" + ); + } + + /// + /// Request parameters for List ACS Users in an Access Group. + /// + public sealed record ListUsersRequest + { + /// + /// ID of the access group for which you want to retrieve all access system users. + /// + [JsonPropertyName("acs_access_group_id")] + public required string AcsAccessGroupId { get; init; } + } + + public sealed record ListUsersResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_users")] + public List? AcsUsers { get; init; } + } + + /// + /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + /// + public async Task> ListUsersAsync( + ListUsersRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/access_groups/list_users", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsUsers + ?? throw new HttpRequestException( + "Seam returned no acs_users for /acs/access_groups/list_users" + ); + } + + /// + /// Request parameters for Remove an ACS User from an Access Group. + /// + public sealed record RemoveUserRequest + { + /// + /// ID of the access group from which you want to remove an access system user. + /// + [JsonPropertyName("acs_access_group_id")] + public required string AcsAccessGroupId { get; init; } + + /// + /// ID of the access system user that you want to remove from an access group. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity associated with the user that you want to remove from an access group. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + /// + /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + /// + public async Task RemoveUserAsync( + RemoveUserRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/acs/access_groups/remove_user", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AcsCredentials.cs b/src/Seam/Routes/AcsCredentials.cs new file mode 100644 index 00000000..5549f755 --- /dev/null +++ b/src/Seam/Routes/AcsCredentials.cs @@ -0,0 +1,595 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AcsCredentials + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AcsCredentials( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Assign a Credential to an ACS User. + /// + public sealed record AssignRequest + { + /// + /// ID of the credential that you want to assign to an access system user. + /// + [JsonPropertyName("acs_credential_id")] + public required string AcsCredentialId { get; init; } + + /// + /// ID of the access system user to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the credential belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + /// + /// Assigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) to a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + public async Task AssignAsync( + AssignRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Patch, "/acs/credentials/assign", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Create a Credential for an ACS User. + /// + public sealed record CreateRequest + { + /// + /// Access method for the new credential. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AccessMethodEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "code")] + Code = 1, + + [EnumMember(Value = "card")] + Card = 2, + + [EnumMember(Value = "mobile_key")] + MobileKey = 3, + + [EnumMember(Value = "cloud_key")] + CloudKey = 4, + } + + /// + /// Access method for the new credential. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + /// + [JsonPropertyName("access_method")] + public required CreateRequest.AccessMethodEnum AccessMethod { get; init; } + + /// + /// ID of the access system to which the new credential belongs. You must provide either `acs_user_id` or the combination of `user_identity_id` and `acs_system_id`. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user to whom the new credential belongs. You must provide either `acs_user_id` or the combination of `user_identity_id` and `acs_system_id`. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// Set of IDs of the [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) for which the new credential grants access. + /// + [JsonPropertyName("allowed_acs_entrance_ids")] + public List? AllowedAcsEntranceIds { get; init; } + + /// + /// Vostio-specific metadata for the new credential. + /// + [JsonPropertyName("assa_abloy_vostio_metadata")] + public CreateRequestAssaAbloyVostioMetadata? AssaAbloyVostioMetadata { get; init; } + + /// + /// Access (PIN) code for the new credential. There may be manufacturer-specific code restrictions. For details, see the applicable [device or system integration guide](https://docs.seam.co/device-and-system-integration-guides). + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// ACS system ID of the credential manager for the new credential. + /// + [JsonPropertyName("credential_manager_acs_system_id")] + public string? CredentialManagerAcsSystemId { get; init; } + + /// + /// Date and time at which the validity of the new credential ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Indicates whether the new credential is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). + /// + [JsonPropertyName("is_multi_phone_sync_credential")] + public bool? IsMultiPhoneSyncCredential { get; init; } + + /// + /// Salto Space-specific metadata for the new credential. + /// + [JsonPropertyName("salto_space_metadata")] + public CreateRequestSaltoSpaceMetadata? SaltoSpaceMetadata { get; init; } + + /// + /// Date and time at which the validity of the new credential starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// ID of the user identity to whom the new credential belongs. You must provide either `acs_user_id` or the combination of `user_identity_id` and `acs_system_id`. If the access system contains a user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the credential belongs to the access system user. If the access system does not have a corresponding user, one is created. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Visionline-specific metadata for the new credential. + /// + [JsonPropertyName("visionline_metadata")] + public CreateRequestVisionlineMetadata? VisionlineMetadata { get; init; } + } + + public sealed record CreateRequestAssaAbloyVostioMetadata + { + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + [JsonPropertyName("join_all_guest_acs_entrances")] + public bool? JoinAllGuestAcsEntrances { get; init; } + + [JsonPropertyName("override_all_guest_acs_entrances")] + public bool? OverrideAllGuestAcsEntrances { get; init; } + + [JsonPropertyName("override_guest_acs_entrance_ids")] + public List? OverrideGuestAcsEntranceIds { get; init; } + } + + public sealed record CreateRequestSaltoSpaceMetadata + { + /// + /// Indicates whether to assign a first, new card to a user. See also [Programming Salto Space Card-based Credentials](https://docs.seam.co/device-and-system-integration-guides/salto-proaccess-space-access-system/programming-salto-space-card-based-credentials). + /// + [JsonPropertyName("assign_new_key")] + public bool? AssignNewKey { get; init; } + } + + public sealed record CreateRequestVisionlineMetadata + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum CardFormatEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "TLCode")] + TlCode = 1, + + [EnumMember(Value = "rfid48")] + Rfid48 = 2, + } + + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum CardFunctionTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "guest")] + Guest = 1, + + [EnumMember(Value = "staff")] + Staff = 2, + } + + [JsonPropertyName("auto_join")] + public bool? AutoJoin { get; init; } + + [JsonPropertyName("card_format")] + public CreateRequestVisionlineMetadata.CardFormatEnum? CardFormat { get; init; } + + [JsonPropertyName("card_function_type")] + public CreateRequestVisionlineMetadata.CardFunctionTypeEnum? CardFunctionType { get; init; } + + [JsonPropertyName("joiner_acs_credential_ids")] + public List? JoinerAcsCredentialIds { get; init; } + + [JsonPropertyName("override")] + public bool? Override { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_credential")] + public AcsCredential? AcsCredential { get; init; } + } + + /// + /// Creates a new [credential](https://docs.seam.co/low-level-apis/managing-credentials) for a specified [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they create and manage the underlying credentials for you, across access systems and standalone smart locks alike. Use this low-level endpoint only when you need direct control over an individual ACS credential. + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/acs/credentials/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsCredential + ?? throw new HttpRequestException( + "Seam returned no acs_credential for /acs/credentials/create" + ); + } + + /// + /// Request parameters for Delete a Credential. + /// + public sealed record DeleteRequest + { + /// + /// ID of the credential that you want to delete. + /// + [JsonPropertyName("acs_credential_id")] + public required string AcsCredentialId { get; init; } + } + + /// + /// Deletes a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/acs/credentials/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Credential. + /// + public sealed record GetRequest + { + /// + /// ID of the credential that you want to get. + /// + [JsonPropertyName("acs_credential_id")] + public required string AcsCredentialId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_credential")] + public AcsCredential? AcsCredential { get; init; } + } + + /// + /// Returns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/credentials/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsCredential + ?? throw new HttpRequestException( + "Seam returned no acs_credential for /acs/credentials/get" + ); + } + + /// + /// Request parameters for List Credentials. + /// + public sealed record ListRequest + { + /// + /// ID of the access system for which you want to retrieve all credentials. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user for which you want to retrieve all credentials. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// Date and time, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format, before which events to return were created. + /// + [JsonPropertyName("created_before")] + public string? CreatedBefore { get; init; } + + /// + /// Indicates whether you want to retrieve only multi-phone sync credentials or non-multi-phone sync credentials. + /// + [JsonPropertyName("is_multi_phone_sync_credential")] + public bool? IsMultiPhoneSyncCredential { get; init; } + + /// + /// Number of credentials to return. + /// + [JsonPropertyName("limit")] + public float? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned credentials to include all records that satisfy a partial match using `display_name`, `code`, `card_number`, `acs_user_id` or `acs_credential_id`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// ID of the user identity for which you want to retrieve all credentials. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_credentials")] + public List? AcsCredentials { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/credentials/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsCredentials + ?? throw new HttpRequestException( + "Seam returned no acs_credentials for /acs/credentials/list" + ); + } + + /// Fetches one page of /acs/credentials/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/credentials/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.AcsCredentials + ?? throw new HttpRequestException( + "Seam returned no acs_credentials for /acs/credentials/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /acs/credentials/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /acs/credentials/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for List Accessible Entrances. + /// + public sealed record ListAccessibleEntrancesRequest + { + /// + /// ID of the credential for which you want to retrieve all entrances to which the credential grants access. + /// + [JsonPropertyName("acs_credential_id")] + public required string AcsCredentialId { get; init; } + } + + public sealed record ListAccessibleEntrancesResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_entrances")] + public List? AcsEntrances { get; init; } + } + + /// + /// Returns a list of all [entrances](https://docs.seam.co/api/acs/entrances) to which a [credential](https://docs.seam.co/api/acs/credentials) grants access. + /// + public async Task> ListAccessibleEntrancesAsync( + ListAccessibleEntrancesRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/credentials/list_accessible_entrances", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsEntrances + ?? throw new HttpRequestException( + "Seam returned no acs_entrances for /acs/credentials/list_accessible_entrances" + ); + } + + /// + /// Request parameters for Unassign a Credential from an ACS User. + /// + public sealed record UnassignRequest + { + /// + /// ID of the credential that you want to unassign from an access system user. + /// + [JsonPropertyName("acs_credential_id")] + public required string AcsCredentialId { get; init; } + + /// + /// ID of the access system user from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + /// + /// Unassigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + public async Task UnassignAsync( + UnassignRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/acs/credentials/unassign", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update a Credential. + /// + public sealed record UpdateRequest + { + /// + /// ID of the credential that you want to update. + /// + [JsonPropertyName("acs_credential_id")] + public required string AcsCredentialId { get; init; } + + /// + /// Replacement access (PIN) code for the credential that you want to update. + /// + [JsonPropertyName("code")] + public string? Code { get; init; } + + /// + /// Replacement date and time at which the validity of the credential ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after the `starts_at` value that you set when creating the credential. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + } + + /// + /// Updates the code and ends at date and time for a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Patch, "/acs/credentials/update", request, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AcsEncoders.cs b/src/Seam/Routes/AcsEncoders.cs new file mode 100644 index 00000000..82403c61 --- /dev/null +++ b/src/Seam/Routes/AcsEncoders.cs @@ -0,0 +1,404 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AcsEncoders + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AcsEncoders( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + Simulate = new AcsEncodersSimulate(transport, waitForActionAttemptDefault); + } + + public AcsEncodersSimulate Simulate { get; } + + /// + /// Request parameters for Encode a Credential. + /// + public sealed record EncodeCredentialRequest + { + /// + /// ID of the `access_method` to encode onto a card. + /// + [JsonPropertyName("access_method_id")] + public string? AccessMethodId { get; init; } + + /// + /// ID of the `acs_credential` to encode onto a card. + /// + [JsonPropertyName("acs_credential_id")] + public string? AcsCredentialId { get; init; } + + /// + /// ID of the `acs_encoder` to use to encode the `acs_credential`. + /// + [JsonPropertyName("acs_encoder_id")] + public required string AcsEncoderId { get; init; } + } + + public sealed record EncodeCredentialResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Encodes an existing [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). Either provide an `acs_credential_id` or an `access_method_id` + /// + public async Task EncodeCredentialAsync( + EncodeCredentialRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/acs/encoders/encode_credential", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /acs/encoders/encode_credential" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get an Encoder. + /// + public sealed record GetRequest + { + /// + /// ID of the encoder that you want to get. + /// + [JsonPropertyName("acs_encoder_id")] + public required string AcsEncoderId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_encoder")] + public AcsEncoder? AcsEncoder { get; init; } + } + + /// + /// Returns a specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/encoders/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsEncoder + ?? throw new HttpRequestException( + "Seam returned no acs_encoder for /acs/encoders/get" + ); + } + + /// + /// Request parameters for List Encoders. + /// + public sealed record ListRequest + { + /// + /// IDs of the encoders that you want to retrieve. + /// + [JsonPropertyName("acs_encoder_ids")] + public List? AcsEncoderIds { get; init; } + + /// + /// ID of the access system for which you want to retrieve all encoders. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// IDs of the access systems for which you want to retrieve all encoders. + /// + [JsonPropertyName("acs_system_ids")] + public List? AcsSystemIds { get; init; } + + /// + /// Number of encoders to return. + /// + [JsonPropertyName("limit")] + public float? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_encoders")] + public List? AcsEncoders { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [encoders](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/encoders/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsEncoders + ?? throw new HttpRequestException( + "Seam returned no acs_encoders for /acs/encoders/list" + ); + } + + /// Fetches one page of /acs/encoders/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/encoders/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.AcsEncoders + ?? throw new HttpRequestException( + "Seam returned no acs_encoders for /acs/encoders/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /acs/encoders/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /acs/encoders/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Scan a Credential. + /// + public sealed record ScanCredentialRequest + { + /// + /// ID of the encoder to use for the scan. + /// + [JsonPropertyName("acs_encoder_id")] + public required string AcsEncoderId { get; init; } + + /// + /// Salto KS-specific metadata for the scan action. + /// + [JsonPropertyName("salto_ks_metadata")] + public ScanCredentialRequestSaltoKsMetadata? SaltoKsMetadata { get; init; } + } + + public sealed record ScanCredentialRequestSaltoKsMetadata + { + /// + /// When true, activates tag registration mode on the encoder to detect new, unregistered tags. When false, only detects existing tags already registered in the system. Defaults to false. + /// + [JsonPropertyName("detect_new_tags")] + public bool? DetectNewTags { get; init; } + } + + public sealed record ScanCredentialResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Scans an encoded [acs_credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + /// + public async Task ScanCredentialAsync( + ScanCredentialRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/acs/encoders/scan_credential", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /acs/encoders/scan_credential" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Scan to Assign a Credential. + /// + public sealed record ScanToAssignCredentialRequest + { + /// + /// ID of the `acs_encoder` to use to scan the credential. + /// + [JsonPropertyName("acs_encoder_id")] + public required string AcsEncoderId { get; init; } + + /// + /// ID of the `acs_user` to assign the scanned credential to. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// Salto KS-specific metadata for the scan action. + /// + [JsonPropertyName("salto_ks_metadata")] + public ScanToAssignCredentialRequestSaltoKsMetadata? SaltoKsMetadata { get; init; } + + /// + /// ID of the `user_identity` to assign the scanned credential to. If the ACS system contains an ACS user linked to this user identity, it is used. Otherwise, one is created. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + public sealed record ScanToAssignCredentialRequestSaltoKsMetadata + { + /// + /// When true, activates tag registration mode on the encoder to detect new, unregistered tags. When false, only detects existing tags already registered in the system. Defaults to false. + /// + [JsonPropertyName("detect_new_tags")] + public bool? DetectNewTags { get; init; } + } + + public sealed record ScanToAssignCredentialResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Scans a physical card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) and assigns the scanned credential to an ACS user. Provide either an `acs_user_id` or a `user_identity_id`. + /// + public async Task ScanToAssignCredentialAsync( + ScanToAssignCredentialRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/acs/encoders/scan_to_assign_credential", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /acs/encoders/scan_to_assign_credential" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AcsEncodersSimulate.cs b/src/Seam/Routes/AcsEncodersSimulate.cs new file mode 100644 index 00000000..b941a4ac --- /dev/null +++ b/src/Seam/Routes/AcsEncodersSimulate.cs @@ -0,0 +1,257 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AcsEncodersSimulate + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AcsEncodersSimulate( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Simulate that the Next Credential Encoding Will Fail. + /// + public sealed record NextCredentialEncodeWillFailRequest + { + /// + /// Code of the error to simulate. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ErrorCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "no_credential_on_encoder")] + NoCredentialOnEncoder = 1, + + [EnumMember(Value = "encoding_interrupted")] + EncodingInterrupted = 2, + + [EnumMember(Value = "uncategorized_error")] + UncategorizedError = 3, + + [EnumMember(Value = "action_attempt_expired")] + ActionAttemptExpired = 4, + } + + /// + /// ID of the `acs_encoder` that will be used in the next request to encode the `acs_credential`. + /// + [JsonPropertyName("acs_encoder_id")] + public required string AcsEncoderId { get; init; } + + /// + /// Code of the error to simulate. + /// + [JsonPropertyName("error_code")] + public NextCredentialEncodeWillFailRequest.ErrorCodeEnum? ErrorCode { get; init; } + + /// + /// ID of the `acs_credential` that will fail to be encoded onto a card in the next request. + /// + [JsonPropertyName("acs_credential_id")] + public string? AcsCredentialId { get; init; } + } + + /// + /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + public async Task NextCredentialEncodeWillFailAsync( + NextCredentialEncodeWillFailRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/acs/encoders/simulate/next_credential_encode_will_fail", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Simulate that the Next Credential Encoding Will Succeed. + /// + public sealed record NextCredentialEncodeWillSucceedRequest + { + /// + /// Scenario to simulate. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ScenarioEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "credential_is_issued")] + CredentialIsIssued = 1, + } + + /// + /// ID of the `acs_encoder` that will be used in the next request to encode the `acs_credential`. + /// + [JsonPropertyName("acs_encoder_id")] + public required string AcsEncoderId { get; init; } + + /// + /// Scenario to simulate. + /// + [JsonPropertyName("scenario")] + public NextCredentialEncodeWillSucceedRequest.ScenarioEnum? Scenario { get; init; } + } + + /// + /// Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + public async Task NextCredentialEncodeWillSucceedAsync( + NextCredentialEncodeWillSucceedRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/acs/encoders/simulate/next_credential_encode_will_succeed", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Simulate that the Next Credential Scan Will Fail. + /// + public sealed record NextCredentialScanWillFailRequest + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ErrorCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "no_credential_on_encoder")] + NoCredentialOnEncoder = 1, + + [EnumMember(Value = "uncategorized_error")] + UncategorizedError = 2, + + [EnumMember(Value = "action_attempt_expired")] + ActionAttemptExpired = 3, + } + + /// + /// ID of the `acs_encoder` that will fail to scan the `acs_credential` in the next request. + /// + [JsonPropertyName("acs_encoder_id")] + public required string AcsEncoderId { get; init; } + + [JsonPropertyName("error_code")] + public NextCredentialScanWillFailRequest.ErrorCodeEnum? ErrorCode { get; init; } + + [JsonPropertyName("acs_credential_id_on_seam")] + public string? AcsCredentialIdOnSeam { get; init; } + } + + /// + /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + public async Task NextCredentialScanWillFailAsync( + NextCredentialScanWillFailRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/acs/encoders/simulate/next_credential_scan_will_fail", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Simulate that the Next Credential Scan Will Succeed. + /// + public sealed record NextCredentialScanWillSucceedRequest + { + /// + /// Scenario to simulate. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ScenarioEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "credential_exists_on_seam")] + CredentialExistsOnSeam = 1, + + [EnumMember(Value = "credential_on_encoder_needs_update")] + CredentialOnEncoderNeedsUpdate = 2, + + [EnumMember(Value = "credential_does_not_exist_on_seam")] + CredentialDoesNotExistOnSeam = 3, + + [EnumMember(Value = "credential_on_encoder_is_empty")] + CredentialOnEncoderIsEmpty = 4, + } + + /// + /// ID of the Seam `acs_credential` that matches the `acs_credential` on the encoder in this simulation. + /// + [JsonPropertyName("acs_credential_id_on_seam")] + public string? AcsCredentialIdOnSeam { get; init; } + + /// + /// ID of the `acs_encoder` that will be used in the next request to scan the `acs_credential`. + /// + [JsonPropertyName("acs_encoder_id")] + public required string AcsEncoderId { get; init; } + + /// + /// Scenario to simulate. + /// + [JsonPropertyName("scenario")] + public NextCredentialScanWillSucceedRequest.ScenarioEnum? Scenario { get; init; } + } + + /// + /// Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + public async Task NextCredentialScanWillSucceedAsync( + NextCredentialScanWillSucceedRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/acs/encoders/simulate/next_credential_scan_will_succeed", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AcsEntrances.cs b/src/Seam/Routes/AcsEntrances.cs new file mode 100644 index 00000000..b2d7da73 --- /dev/null +++ b/src/Seam/Routes/AcsEntrances.cs @@ -0,0 +1,385 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AcsEntrances + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AcsEntrances( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Get an Entrance. + /// + public sealed record GetRequest + { + /// + /// ID of the entrance that you want to get. + /// + [JsonPropertyName("acs_entrance_id")] + public required string AcsEntranceId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_entrance")] + public AcsEntrance? AcsEntrance { get; init; } + } + + /// + /// Returns a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/entrances/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsEntrance + ?? throw new HttpRequestException( + "Seam returned no acs_entrance for /acs/entrances/get" + ); + } + + /// + /// Request parameters for Grant an ACS User Access to an Entrance. + /// + public sealed record GrantAccessRequest + { + /// + /// ID of the entrance to which you want to grant an access system user access. + /// + [JsonPropertyName("acs_entrance_id")] + public required string AcsEntranceId { get; init; } + + /// + /// ID of the access system user to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + /// + /// Grants a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) access to a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + public async Task GrantAccessAsync( + GrantAccessRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/acs/entrances/grant_access", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for List Entrances. + /// + public sealed record ListRequest + { + /// + /// ID of the access method for which you want to retrieve all entrances to which it grants access. + /// + [JsonPropertyName("access_method_id")] + public string? AccessMethodId { get; init; } + + /// + /// ID of the credential for which you want to retrieve all entrances. + /// + [JsonPropertyName("acs_credential_id")] + public string? AcsCredentialId { get; init; } + + /// + /// IDs of the entrances for which you want to retrieve all entrances. + /// + [JsonPropertyName("acs_entrance_ids")] + public List? AcsEntranceIds { get; init; } + + /// + /// ID of the access system for which you want to retrieve all entrances. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the connected account for which you want to retrieve all entrances. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// Customer key for which you want to list entrances. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Maximum number of records to return per page. + /// + [JsonPropertyName("limit")] + public int? Limit { get; init; } + + [Obsolete("Use `space_id`.")] + [JsonPropertyName("location_id")] + public Optional LocationId { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned entrances to include all records that satisfy a partial match using `display_name`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// ID of the space for which you want to list entrances. + /// + [JsonPropertyName("space_id")] + public string? SpaceId { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_entrances")] + public List? AcsEntrances { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [access system entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/entrances/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsEntrances + ?? throw new HttpRequestException( + "Seam returned no acs_entrances for /acs/entrances/list" + ); + } + + /// Fetches one page of /acs/entrances/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/entrances/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.AcsEntrances + ?? throw new HttpRequestException( + "Seam returned no acs_entrances for /acs/entrances/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /acs/entrances/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /acs/entrances/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for List Credentials with Access to an Entrance. + /// + public sealed record ListCredentialsWithAccessRequest + { + /// + /// Conditions that credentials must meet to be included in the returned list. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum IncludeIfEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "visionline_metadata.is_valid")] + VisionlineMetadataIsValid = 1, + } + + /// + /// ID of the entrance for which you want to list all credentials that grant access. + /// + [JsonPropertyName("acs_entrance_id")] + public required string AcsEntranceId { get; init; } + + /// + /// Conditions that credentials must meet to be included in the returned list. + /// + [JsonPropertyName("include_if")] + public List? IncludeIf { get; init; } + } + + public sealed record ListCredentialsWithAccessResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_credentials")] + public List? AcsCredentials { get; init; } + } + + /// + /// Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) with access to a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + /// + public async Task> ListCredentialsWithAccessAsync( + ListCredentialsWithAccessRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/entrances/list_credentials_with_access", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsCredentials + ?? throw new HttpRequestException( + "Seam returned no acs_credentials for /acs/entrances/list_credentials_with_access" + ); + } + + /// + /// Request parameters for Unlock an Entrance. + /// + public sealed record UnlockRequest + { + /// + /// ID of the cloud_key credential to use for the unlock operation. + /// + [JsonPropertyName("acs_credential_id")] + public required string AcsCredentialId { get; init; } + + /// + /// ID of the entrance to unlock. + /// + [JsonPropertyName("acs_entrance_id")] + public required string AcsEntranceId { get; init; } + } + + public sealed record UnlockResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using a cloud_key credential. Returns an action attempt that tracks the progress of the unlock operation. + /// + public async Task UnlockAsync( + UnlockRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/acs/entrances/unlock", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /acs/entrances/unlock" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AcsSystems.cs b/src/Seam/Routes/AcsSystems.cs new file mode 100644 index 00000000..b3e2aa76 --- /dev/null +++ b/src/Seam/Routes/AcsSystems.cs @@ -0,0 +1,275 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AcsSystems + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AcsSystems( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Get an ACS System. + /// + public sealed record GetRequest + { + /// + /// ID of the access system that you want to get. + /// + [JsonPropertyName("acs_system_id")] + public required string AcsSystemId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_system")] + public AcsSystem? AcsSystem { get; init; } + } + + /// + /// Returns a specified [access system](https://docs.seam.co/low-level-apis/access-systems). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/systems/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsSystem + ?? throw new HttpRequestException( + "Seam returned no acs_system for /acs/systems/get" + ); + } + + /// + /// Request parameters for List ACS Systems. + /// + public sealed record ListRequest + { + /// + /// ID of the connected account by which you want to filter the list of access systems. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// Customer key for which you want to list access systems. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// String for which to search. Filters returned access systems to include all records that satisfy a partial match using `name` or `acs_system_id`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_systems")] + public List? AcsSystems { get; init; } + } + + /// + /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems). + /// + /// To filter the list of returned access systems by a specific connected account ID, include the `connected_account_id` in the request body. If you omit the `connected_account_id` parameter, the response includes all access systems connected to your workspace. + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/systems/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsSystems + ?? throw new HttpRequestException( + "Seam returned no acs_systems for /acs/systems/list" + ); + } + + /// + /// Request parameters for List Compatible Credential Manager ACS Systems. + /// + public sealed record ListCompatibleCredentialManagerAcsSystemsRequest + { + /// + /// ID of the access system for which you want to retrieve all compatible credential manager systems. + /// + [JsonPropertyName("acs_system_id")] + public required string AcsSystemId { get; init; } + } + + public sealed record ListCompatibleCredentialManagerAcsSystemsResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_systems")] + public List? AcsSystems { get; init; } + } + + /// + /// Returns a list of all credential manager systems that are compatible with a specified [access system](https://docs.seam.co/low-level-apis/access-systems). + /// + /// Specify the access system for which you want to retrieve all compatible credential manager systems by including the corresponding `acs_system_id` in the request body. + /// + public async Task> ListCompatibleCredentialManagerAcsSystemsAsync( + ListCompatibleCredentialManagerAcsSystemsRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/systems/list_compatible_credential_manager_acs_systems", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsSystems + ?? throw new HttpRequestException( + "Seam returned no acs_systems for /acs/systems/list_compatible_credential_manager_acs_systems" + ); + } + + /// + /// Request parameters for Report Devices. + /// + public sealed record ReportDevicesRequest + { + /// + /// Array of ACS encoders to report + /// + [JsonPropertyName("acs_encoders")] + public List? AcsEncoders { get; init; } + + /// + /// Array of ACS entrances to report + /// + [JsonPropertyName("acs_entrances")] + public List? AcsEntrances { get; init; } + + /// + /// ID of the ACS system to report resources for + /// + [JsonPropertyName("acs_system_id")] + public required string AcsSystemId { get; init; } + } + + public sealed record ReportDevicesRequestAcsEncoders + { + /// + /// Hotek-specific metadata associated with the entrance. + /// + [JsonPropertyName("hotek_metadata")] + public ReportDevicesRequestAcsEncodersHotekMetadata? HotekMetadata { get; init; } + + /// + /// Whether the encoder is removed + /// + [JsonPropertyName("is_removed")] + public bool? IsRemoved { get; init; } + } + + public sealed record ReportDevicesRequestAcsEncodersHotekMetadata + { + /// + /// The encoder number determined by the USB port connection. + /// + [JsonPropertyName("encoder_number")] + public string? EncoderNumber { get; init; } + } + + public sealed record ReportDevicesRequestAcsEntrances + { + /// + /// Hotek-specific metadata associated with the entrance. + /// + [JsonPropertyName("hotek_metadata")] + public ReportDevicesRequestAcsEntrancesHotekMetadata? HotekMetadata { get; init; } + + /// + /// Whether the entrance is removed + /// + [JsonPropertyName("is_removed")] + public bool? IsRemoved { get; init; } + } + + public sealed record ReportDevicesRequestAcsEntrancesHotekMetadata + { + /// + /// The common area name + /// + [JsonPropertyName("common_area_name")] + public string? CommonAreaName { get; init; } + + /// + /// The room number identifier + /// + [JsonPropertyName("common_area_number")] + public string? CommonAreaNumber { get; init; } + + /// + /// The room number identifier + /// + [JsonPropertyName("room_number")] + public string? RoomNumber { get; init; } + } + + /// + /// Reports ACS system device status including encoders and entrances. + /// + public async Task ReportDevicesAsync( + ReportDevicesRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/acs/systems/report_devices", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/AcsUsers.cs b/src/Seam/Routes/AcsUsers.cs new file mode 100644 index 00000000..f37a45e9 --- /dev/null +++ b/src/Seam/Routes/AcsUsers.cs @@ -0,0 +1,769 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class AcsUsers + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal AcsUsers( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Add an ACS User to an Access Group. + /// + public sealed record AddToAccessGroupRequest + { + /// + /// ID of the access group to which you want to add an access system user. + /// + [JsonPropertyName("acs_access_group_id")] + public required string AcsAccessGroupId { get; init; } + + /// + /// ID of the access system user that you want to add to an access group. + /// + [JsonPropertyName("acs_user_id")] + public required string AcsUserId { get; init; } + } + + /// + /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + /// + public async Task AddToAccessGroupAsync( + AddToAccessGroupRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Put, + "/acs/users/add_to_access_group", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Create an ACS User. + /// + public sealed record CreateRequest + { + /// + /// `starts_at` and `ends_at` timestamps for the new access system user's access. If you specify an `access_schedule`, you may include both `starts_at` and `ends_at`. If you omit `starts_at`, it defaults to the current time. `ends_at` is optional and must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("access_schedule")] + public CreateRequestAccessSchedule? AccessSchedule { get; init; } + + /// + /// Array of access group IDs to indicate the access groups to which you want to add the new access system user. + /// + [JsonPropertyName("acs_access_group_ids")] + public List? AcsAccessGroupIds { get; init; } + + /// + /// ID of the access system to which you want to add the new access system user. + /// + [JsonPropertyName("acs_system_id")] + public required string AcsSystemId { get; init; } + + [Obsolete("use email_address.")] + [JsonPropertyName("email")] + public string? Email { get; init; } + + /// + /// Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Full name of the new access system user. + /// + [JsonPropertyName("full_name")] + public required string FullName { get; init; } + + /// + /// Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// ID of the user identity with which you want to associate the new access system user. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + public sealed record CreateRequestAccessSchedule + { + /// + /// Ending timestamp for the new access system user's access. + /// + [JsonPropertyName("ends_at")] + public Optional EndsAt { get; init; } + + /// + /// Starting timestamp for the new access system user's access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_user")] + public AcsUser? AcsUser { get; init; } + } + + /// + /// Creates a new [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/acs/users/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsUser + ?? throw new HttpRequestException( + "Seam returned no acs_user for /acs/users/create" + ); + } + + /// + /// Request parameters for Delete an ACS User. + /// + public sealed record DeleteRequest + { + /// + /// ID of the access system that you want to delete. You must provide acs_system_id with user_identity_id. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user that you want to delete. You must provide either acs_user_id or user_identity_id + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity that you want to delete. You must provide either acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + internal void Validate() + { + if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + { + throw new ArgumentException( + "At least one parameter is required for /acs/users/delete" + ); + } + } + } + + /// + /// Deletes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) and invalidates the access system user's [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + await _transport + .SendAsync(HttpMethod.Delete, "/acs/users/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get an ACS User. + /// + public sealed record GetRequest + { + /// + /// ID of the access system that you want to get. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user that you want to get. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity that you want to get. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + internal void Validate() + { + if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + { + throw new ArgumentException( + "At least one parameter is required for /acs/users/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_user")] + public AcsUser? AcsUser { get; init; } + } + + /// + /// Returns a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/users/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsUser + ?? throw new HttpRequestException("Seam returned no acs_user for /acs/users/get"); + } + + /// + /// Request parameters for List ACS Users. + /// + public sealed record ListRequest + { + /// + /// ID of the `acs_system` for which you want to retrieve all access system users. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// Timestamp by which to limit returned access system users. Returns users created before this timestamp. + /// + [JsonPropertyName("created_before")] + public string? CreatedBefore { get; init; } + + /// + /// Maximum number of records to return per page. + /// + [JsonPropertyName("limit")] + public int? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned access system users to include all records that satisfy a partial match using `full_name`, `phone_number`, `email_address`, `acs_user_id`, `user_identity_id`, `user_identity_full_name` or `user_identity_phone_number`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// Email address of the user identity for which you want to retrieve all access system users. Specify `null` to retrieve access system users whose user identity has no email address. + /// + [JsonPropertyName("user_identity_email_address")] + public Optional UserIdentityEmailAddress { get; init; } + + /// + /// ID of the user identity for which you want to retrieve all access system users. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Phone number of the user identity for which you want to retrieve all access system users, in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, `+15555550100`). Specify `null` to retrieve access system users whose user identity has no phone number. + /// + [JsonPropertyName("user_identity_phone_number")] + public Optional UserIdentityPhoneNumber { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_users")] + public List? AcsUsers { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/users/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsUsers + ?? throw new HttpRequestException("Seam returned no acs_users for /acs/users/list"); + } + + /// Fetches one page of /acs/users/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/users/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.AcsUsers + ?? throw new HttpRequestException("Seam returned no acs_users for /acs/users/list"); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /acs/users/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /acs/users/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for List ACS User-Accessible Entrances. + /// + public sealed record ListAccessibleEntrancesRequest + { + /// + /// ID of the access system for which you want to list accessible entrances. You can only provide acs_system_id with user_identity_id. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + internal void Validate() + { + if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + { + throw new ArgumentException( + "At least one parameter is required for /acs/users/list_accessible_entrances" + ); + } + } + } + + public sealed record ListAccessibleEntrancesResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_entrances")] + public List? AcsEntrances { get; init; } + } + + /// + /// Lists the [entrances](https://docs.seam.co/api/acs/entrances) to which a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) has access. + /// + public async Task> ListAccessibleEntrancesAsync( + ListAccessibleEntrancesRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/acs/users/list_accessible_entrances", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsEntrances + ?? throw new HttpRequestException( + "Seam returned no acs_entrances for /acs/users/list_accessible_entrances" + ); + } + + /// + /// Request parameters for Remove an ACS User from an Access Group. + /// + public sealed record RemoveFromAccessGroupRequest + { + /// + /// ID of the access group from which you want to remove an access system user. + /// + [JsonPropertyName("acs_access_group_id")] + public required string AcsAccessGroupId { get; init; } + + /// + /// ID of the access system user that you want to remove from an access group. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity that you want to remove from an access group. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + /// + /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + /// + public async Task RemoveFromAccessGroupAsync( + RemoveFromAccessGroupRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/acs/users/remove_from_access_group", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Revoke ACS User Access to All Entrances. + /// + public sealed record RevokeAccessToAllEntrancesRequest + { + /// + /// ID of the access system for which you want to revoke access. You can only provide acs_system_id with user_identity_id. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user for whom you want to revoke access. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity for whom you want to revoke access. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + internal void Validate() + { + if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + { + throw new ArgumentException( + "At least one parameter is required for /acs/users/revoke_access_to_all_entrances" + ); + } + } + } + + /// + /// Revokes access to all [entrances](https://docs.seam.co/api/acs/entrances) for a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + public async Task RevokeAccessToAllEntrancesAsync( + RevokeAccessToAllEntrancesRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + await _transport + .SendAsync( + HttpMethod.Post, + "/acs/users/revoke_access_to_all_entrances", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Suspend an ACS User. + /// + public sealed record SuspendRequest + { + /// + /// ID of the access system that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + internal void Validate() + { + if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + { + throw new ArgumentException( + "At least one parameter is required for /acs/users/suspend" + ); + } + } + } + + /// + /// [Suspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#suspend-an-acs-user) a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can [unsuspend](https://docs.seam.co/api/acs/users/unsuspend) them. + /// + public async Task SuspendAsync( + SuspendRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + await _transport + .SendAsync(HttpMethod.Post, "/acs/users/suspend", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Unsuspend an ACS User. + /// + public sealed record UnsuspendRequest + { + /// + /// ID of the access system of the user that you want to unsuspend. You can only provide acs_system_id with user_identity_id. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + /// + /// ID of the user identity that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + internal void Validate() + { + if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + { + throw new ArgumentException( + "At least one parameter is required for /acs/users/unsuspend" + ); + } + } + } + + /// + /// [Unsuspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#unsuspend-an-acs-user) a specified suspended [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). While [suspending an access system user](https://docs.seam.co/api/acs/users/suspend) revokes their access temporarily, unsuspending the access system user restores their access. + /// + public async Task UnsuspendAsync( + UnsuspendRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + await _transport + .SendAsync(HttpMethod.Post, "/acs/users/unsuspend", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update an ACS User. + /// + public sealed record UpdateRequest + { + /// + /// `starts_at` and `ends_at` timestamps for the access system user's access. If you specify an `access_schedule`, you may include both `starts_at` and `ends_at`. If you omit `starts_at`, it defaults to the current time. `ends_at` is optional and must be a time in the future and after `starts_at`. + /// + [JsonPropertyName("access_schedule")] + public Optional AccessSchedule { get; init; } + + /// + /// ID of the access system that you want to update. You can only provide acs_system_id with user_identity_id. + /// + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } + + /// + /// ID of the access system user that you want to update. You can only provide acs_user_id or user_identity_id. + /// + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } + + [Obsolete("use email_address.")] + [JsonPropertyName("email")] + public string? Email { get; init; } + + /// + /// Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Full name of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + [JsonPropertyName("full_name")] + public string? FullName { get; init; } + + /// + /// ID of the HID access control system associated with the user. + /// + [JsonPropertyName("hid_acs_system_id")] + public string? HidAcsSystemId { get; init; } + + /// + /// Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// ID of the user identity that you want to update. You can only provide acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + internal void Validate() + { + if ( + !AccessSchedule.IsSet + && AcsSystemId == null + && AcsUserId == null + && Email == null + && EmailAddress == null + && FullName == null + && HidAcsSystemId == null + && PhoneNumber == null + && UserIdentityId == null + ) + { + throw new ArgumentException( + "At least one parameter is required for /acs/users/update" + ); + } + } + } + + public sealed record UpdateRequestAccessSchedule + { + /// + /// Ending timestamp for the access system user's access. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Starting timestamp for the access system user's access. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + } + + /// + /// Updates the properties of a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + await _transport + .SendAsync(HttpMethod.Patch, "/acs/users/update", request, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/ActionAttempts.cs b/src/Seam/Routes/ActionAttempts.cs new file mode 100644 index 00000000..7057d1f5 --- /dev/null +++ b/src/Seam/Routes/ActionAttempts.cs @@ -0,0 +1,192 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class ActionAttempts + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal ActionAttempts( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Get an Action Attempt. + /// + public sealed record GetRequest + { + /// + /// ID of the action attempt that you want to get. + /// + [JsonPropertyName("action_attempt_id")] + public required string ActionAttemptId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Returns a specified [action attempt](https://docs.seam.co/core-concepts/action-attempts). + /// + public async Task GetAsync( + GetRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/action_attempts/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /action_attempts/get" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for List Action Attempts. + /// + public sealed record ListRequest + { + /// + /// IDs of the action attempts that you want to retrieve. + /// + [JsonPropertyName("action_attempt_ids")] + public List? ActionAttemptIds { get; init; } + + /// + /// ID of the device to filter action attempts by. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Maximum number of records to return per page. + /// + [JsonPropertyName("limit")] + public int? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempts")] + public List? ActionAttempts { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of the [action attempts](https://docs.seam.co/core-concepts/action-attempts) that you specify as an array of `action_attempt_id`s. + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/action_attempts/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ActionAttempts + ?? throw new HttpRequestException( + "Seam returned no action_attempts for /action_attempts/list" + ); + } + + /// Fetches one page of /action_attempts/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/action_attempts/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.ActionAttempts + ?? throw new HttpRequestException( + "Seam returned no action_attempts for /action_attempts/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /action_attempts/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /action_attempts/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + } +} diff --git a/src/Seam/Routes/ClientSessions.cs b/src/Seam/Routes/ClientSessions.cs new file mode 100644 index 00000000..43fae57d --- /dev/null +++ b/src/Seam/Routes/ClientSessions.cs @@ -0,0 +1,435 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class ClientSessions + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal ClientSessions( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Create a Client Session. + /// + public sealed record CreateRequest + { + /// + /// IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) for which you want to create a client session. + /// + [JsonPropertyName("connect_webview_ids")] + public List? ConnectWebviewIds { get; init; } + + /// + /// IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) for which you want to create a client session. + /// + [JsonPropertyName("connected_account_ids")] + public List? ConnectedAccountIds { get; init; } + + /// + /// Customer ID that you want to associate with the new client session. + /// + [JsonPropertyName("customer_id")] + public string? CustomerId { get; init; } + + /// + /// Customer key that you want to associate with the new client session. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Date and time at which the client session should expire, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("expires_at")] + public string? ExpiresAt { get; init; } + + /// + /// Your user ID for the user for whom you want to create a client session. + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + + /// + /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to create a client session. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. + /// + [Obsolete("Use `user_identity_id` instead.")] + [JsonPropertyName("user_identity_ids")] + public List? UserIdentityIds { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("client_session")] + public ClientSession? ClientSession { get; init; } + } + + /// + /// Creates a new [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + public async Task CreateAsync( + CreateRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Put, + "/client_sessions/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ClientSession + ?? throw new HttpRequestException( + "Seam returned no client_session for /client_sessions/create" + ); + } + + /// + /// Request parameters for Delete a Client Session. + /// + public sealed record DeleteRequest + { + /// + /// ID of the client session that you want to delete. + /// + [JsonPropertyName("client_session_id")] + public required string ClientSessionId { get; init; } + } + + /// + /// Deletes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/client_sessions/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Client Session. + /// + public sealed record GetRequest + { + /// + /// ID of the client session that you want to get. + /// + [JsonPropertyName("client_session_id")] + public string? ClientSessionId { get; init; } + + /// + /// User identifier key associated with the client session that you want to get. + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("client_session")] + public ClientSession? ClientSession { get; init; } + } + + /// + /// Returns a specified [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + public async Task GetAsync( + GetRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/client_sessions/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ClientSession + ?? throw new HttpRequestException( + "Seam returned no client_session for /client_sessions/get" + ); + } + + /// + /// Request parameters for Get or Create a Client Session. + /// + public sealed record GetOrCreateRequest + { + /// + /// IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) that you want to associate with the client session (or that are already associated with the existing client session). + /// + [JsonPropertyName("connect_webview_ids")] + public List? ConnectWebviewIds { get; init; } + + /// + /// IDs of the [connected accounts](https://docs.seam.co/api/connected_accounts) that you want to associate with the client session (or that are already associated with the existing client session). + /// + [JsonPropertyName("connected_account_ids")] + public List? ConnectedAccountIds { get; init; } + + /// + /// Date and time at which the client session should expire in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. If the client session already exists, this will update the expiration before returning it. + /// + [JsonPropertyName("expires_at")] + public string? ExpiresAt { get; init; } + + /// + /// Your user ID for the user that you want to associate with the client session (or that is already associated with the existing client session). + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + + /// + /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session (or that are already associated with the existing client session). + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. + /// + [Obsolete("Use `user_identity_id`.")] + [JsonPropertyName("user_identity_ids")] + public List? UserIdentityIds { get; init; } + } + + public sealed record GetOrCreateResponse + { + /// + /// OK + /// + [JsonPropertyName("client_session")] + public ClientSession? ClientSession { get; init; } + } + + /// + /// Returns a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) with specific characteristics or creates a new client session with these characteristics if it does not yet exist. + /// + public async Task GetOrCreateAsync( + GetOrCreateRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/client_sessions/get_or_create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ClientSession + ?? throw new HttpRequestException( + "Seam returned no client_session for /client_sessions/get_or_create" + ); + } + + /// + /// Request parameters for Grant Access to a Client Session. + /// + public sealed record GrantAccessRequest + { + /// + /// ID of the client session to which you want to grant access to resources. + /// + [JsonPropertyName("client_session_id")] + public string? ClientSessionId { get; init; } + + /// + /// IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) that you want to associate with the client session. + /// + [JsonPropertyName("connect_webview_ids")] + public List? ConnectWebviewIds { get; init; } + + /// + /// IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) that you want to associate with the client session. + /// + [JsonPropertyName("connected_account_ids")] + public List? ConnectedAccountIds { get; init; } + + /// + /// Your user ID for the user that you want to associate with the client session. + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + + /// + /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. + /// + [Obsolete("Use `user_identity_id`.")] + [JsonPropertyName("user_identity_ids")] + public List? UserIdentityIds { get; init; } + + internal void Validate() + { + if ( + ClientSessionId == null + && ConnectWebviewIds == null + && ConnectedAccountIds == null + && UserIdentifierKey == null + && UserIdentityId == null + && UserIdentityIds == null + ) + { + throw new ArgumentException( + "At least one parameter is required for /client_sessions/grant_access" + ); + } + } + } + + /// + /// Grants a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews), [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), and so on. + /// + public async Task GrantAccessAsync( + GrantAccessRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + await _transport + .SendAsync( + HttpMethod.Patch, + "/client_sessions/grant_access", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for List Client Sessions. + /// + public sealed record ListRequest + { + /// + /// ID of the client session that you want to retrieve. + /// + [JsonPropertyName("client_session_id")] + public string? ClientSessionId { get; init; } + + /// + /// ID of the [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) for which you want to retrieve client sessions. Specify `null` to retrieve client sessions that are not associated with a Connect Webview. + /// + [JsonPropertyName("connect_webview_id")] + public Optional ConnectWebviewId { get; init; } + + /// + /// Your user ID for the user by which you want to filter client sessions. + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + + /// + /// ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to retrieve client sessions. Specify `null` to retrieve client sessions that are not associated with a user identity. + /// + [JsonPropertyName("user_identity_id")] + public Optional UserIdentityId { get; init; } + + /// + /// Indicates whether to retrieve only client sessions without associated user identifier keys. + /// + [JsonPropertyName("without_user_identifier_key")] + public bool? WithoutUserIdentifierKey { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("client_sessions")] + public List? ClientSessions { get; init; } + } + + /// + /// Returns a list of all [client sessions](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/client_sessions/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ClientSessions + ?? throw new HttpRequestException( + "Seam returned no client_sessions for /client_sessions/list" + ); + } + + /// + /// Request parameters for Revoke a Client Session. + /// + public sealed record RevokeRequest + { + /// + /// ID of the client session that you want to revoke. + /// + [JsonPropertyName("client_session_id")] + public required string ClientSessionId { get; init; } + } + + /// + /// Revokes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + /// + /// Note that [deleting a client session](https://docs.seam.co/api/client_sessions/delete) is a separate action. + /// + public async Task RevokeAsync( + RevokeRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Post, "/client_sessions/revoke", request, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/ConnectWebviews.cs b/src/Seam/Routes/ConnectWebviews.cs new file mode 100644 index 00000000..f1e93e3e --- /dev/null +++ b/src/Seam/Routes/ConnectWebviews.cs @@ -0,0 +1,607 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class ConnectWebviews + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal ConnectWebviews( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Create a Connect Webview. + /// + public sealed record CreateRequest + { + /// + /// List of accepted device capabilities that restrict the types of devices that can be connected through the Connect Webview. If not provided, defaults will be determined based on the accepted providers. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AcceptedCapabilitiesEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "lock")] + Lock = 1, + + [EnumMember(Value = "thermostat")] + Thermostat = 2, + + [EnumMember(Value = "noise_sensor")] + NoiseSensor = 3, + + [EnumMember(Value = "access_control")] + AccessControl = 4, + + [EnumMember(Value = "camera")] + Camera = 5, + } + + /// + /// Accepted device provider keys as an alternative to `provider_category`. Use this parameter to specify accepted providers explicitly. See [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). To list all provider keys, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with no filters. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AcceptedProvidersEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "hotek")] + Hotek = 1, + + [EnumMember(Value = "dormakaba_community")] + DormakabaCommunity = 2, + + [EnumMember(Value = "legic_connect")] + LegicConnect = 3, + + [EnumMember(Value = "akuvox")] + Akuvox = 4, + + [EnumMember(Value = "august")] + August = 5, + + [EnumMember(Value = "avigilon_alta")] + AvigilonAlta = 6, + + [EnumMember(Value = "brivo")] + Brivo = 7, + + [EnumMember(Value = "butterflymx")] + Butterflymx = 8, + + [EnumMember(Value = "schlage")] + Schlage = 9, + + [EnumMember(Value = "smartthings")] + Smartthings = 10, + + [EnumMember(Value = "yale")] + Yale = 11, + + [EnumMember(Value = "genie")] + Genie = 12, + + [EnumMember(Value = "doorking")] + Doorking = 13, + + [EnumMember(Value = "salto")] + Salto = 14, + + [EnumMember(Value = "salto_ks")] + SaltoKs = 15, + + [EnumMember(Value = "salto_ks_accept")] + SaltoKsAccept = 16, + + [EnumMember(Value = "lockly")] + Lockly = 17, + + [EnumMember(Value = "ttlock")] + Ttlock = 18, + + [EnumMember(Value = "linear")] + Linear = 19, + + [EnumMember(Value = "noiseaware")] + Noiseaware = 20, + + [EnumMember(Value = "nuki")] + Nuki = 21, + + [EnumMember(Value = "igloo")] + Igloo = 22, + + [EnumMember(Value = "kwikset")] + Kwikset = 23, + + [EnumMember(Value = "minut")] + Minut = 24, + + [EnumMember(Value = "my_2n")] + My_2n = 25, + + [EnumMember(Value = "controlbyweb")] + Controlbyweb = 26, + + [EnumMember(Value = "nest")] + Nest = 27, + + [EnumMember(Value = "igloohome")] + Igloohome = 28, + + [EnumMember(Value = "ecobee")] + Ecobee = 29, + + [EnumMember(Value = "four_suites")] + FourSuites = 30, + + [EnumMember(Value = "dormakaba_oracode")] + DormakabaOracode = 31, + + [EnumMember(Value = "pti")] + Pti = 32, + + [EnumMember(Value = "wyze")] + Wyze = 33, + + [EnumMember(Value = "seam_passport")] + SeamPassport = 34, + + [EnumMember(Value = "visionline")] + Visionline = 35, + + [EnumMember(Value = "assa_abloy_credential_service")] + AssaAbloyCredentialService = 36, + + [EnumMember(Value = "tedee")] + Tedee = 37, + + [EnumMember(Value = "honeywell_resideo")] + HoneywellResideo = 38, + + [EnumMember(Value = "first_alert")] + FirstAlert = 39, + + [EnumMember(Value = "latch")] + Latch = 40, + + [EnumMember(Value = "akiles")] + Akiles = 41, + + [EnumMember(Value = "assa_abloy_vostio")] + AssaAbloyVostio = 42, + + [EnumMember(Value = "assa_abloy_vostio_credential_service")] + AssaAbloyVostioCredentialService = 43, + + [EnumMember(Value = "tado")] + Tado = 44, + + [EnumMember(Value = "salto_space")] + SaltoSpace = 45, + + [EnumMember(Value = "sensi")] + Sensi = 46, + + [EnumMember(Value = "keynest")] + Keynest = 47, + + [EnumMember(Value = "korelock")] + Korelock = 48, + + [EnumMember(Value = "keyincode")] + Keyincode = 49, + + [EnumMember(Value = "dormakaba_ambiance")] + DormakabaAmbiance = 50, + + [EnumMember(Value = "ultraloq")] + Ultraloq = 51, + + [EnumMember(Value = "yacan")] + Yacan = 52, + + [EnumMember(Value = "dusaw")] + Dusaw = 53, + + [EnumMember(Value = "sifely")] + Sifely = 54, + + [EnumMember(Value = "thirty_three_lock")] + ThirtyThreeLock = 55, + + [EnumMember(Value = "ring")] + Ring = 56, + + [EnumMember(Value = "ical")] + Ical = 57, + + [EnumMember(Value = "lodgify")] + Lodgify = 58, + + [EnumMember(Value = "hostaway")] + Hostaway = 59, + + [EnumMember(Value = "guesty")] + Guesty = 60, + + [EnumMember(Value = "acuity_scheduling")] + AcuityScheduling = 61, + + [EnumMember(Value = "omnitec")] + Omnitec = 62, + + [EnumMember(Value = "kisi")] + Kisi = 63, + + [EnumMember(Value = "aqara")] + Aqara = 64, + + [EnumMember(Value = "yale_access")] + YaleAccess = 65, + + [EnumMember(Value = "hid_cm")] + HidCm = 66, + + [EnumMember(Value = "google_nest")] + GoogleNest = 67, + + [EnumMember(Value = "slack")] + Slack = 68, + } + + /// + /// Specifies the category of providers that you want to include. To list all providers within a category, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with the desired `provider_category` filter. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ProviderCategoryEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "stable")] + Stable = 1, + + [EnumMember(Value = "consumer_smartlocks")] + ConsumerSmartlocks = 2, + + [EnumMember(Value = "beta")] + Beta = 3, + + [EnumMember(Value = "thermostats")] + Thermostats = 4, + + [EnumMember(Value = "noise_sensors")] + NoiseSensors = 5, + + [EnumMember(Value = "access_control_systems")] + AccessControlSystems = 6, + + [EnumMember(Value = "cameras")] + Cameras = 7, + + [EnumMember(Value = "connectors")] + Connectors = 8, + + [EnumMember(Value = "internal_beta")] + InternalBeta = 9, + } + + /// + /// List of accepted device capabilities that restrict the types of devices that can be connected through the Connect Webview. If not provided, defaults will be determined based on the accepted providers. + /// + [JsonPropertyName("accepted_capabilities")] + public List? AcceptedCapabilities { get; init; } + + /// + /// Accepted device provider keys as an alternative to `provider_category`. Use this parameter to specify accepted providers explicitly. See [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). To list all provider keys, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with no filters. + /// + [JsonPropertyName("accepted_providers")] + public List? AcceptedProviders { get; init; } + + /// + /// Indicates whether newly-added devices should appear as [managed devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). See also: [Customize the Behavior Settings of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-behavior-settings-of-your-connect-webviews). + /// + [JsonPropertyName("automatically_manage_new_devices")] + public bool? AutomaticallyManageNewDevices { get; init; } + + /// + /// Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview) enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) that were connected using the Connect Webview, making it easy to find and filter these resources in your [workspace](https://docs.seam.co/core-concepts/workspaces). You can also [filter Connect Webviews by custom metadata](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata. + /// + [JsonPropertyName("custom_metadata")] + public object? CustomMetadata { get; init; } + + /// + /// Alternative URL that you want to redirect the user to on an error. If you do not set this parameter, the Connect Webview falls back to the `custom_redirect_url`. + /// + [JsonPropertyName("custom_redirect_failure_url")] + public string? CustomRedirectFailureUrl { get; init; } + + /// + /// URL that you want to redirect the user to after the provider login is complete. + /// + [JsonPropertyName("custom_redirect_url")] + public string? CustomRedirectUrl { get; init; } + + /// + /// Associate the Connect Webview, the connected account, and all resources under the connected account with a customer. If the connected account already exists, it will be associated with the customer. If the connected account already exists, but is already associated with a customer, the Connect Webview will show an error. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// List of provider keys to exclude from the Connect Webview. These providers will not be shown when the user tries to connect an account. + /// + [JsonPropertyName("excluded_providers")] + public List? ExcludedProviders { get; init; } + + /// + /// Specifies the category of providers that you want to include. To list all providers within a category, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with the desired `provider_category` filter. + /// + [JsonPropertyName("provider_category")] + public CreateRequest.ProviderCategoryEnum? ProviderCategory { get; init; } + + /// + /// Indicates whether Seam should finish syncing all devices in a newly-connected account before completing the associated Connect Webview. See also: [Customize the Behavior Settings of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-behavior-settings-of-your-connect-webviews). + /// + [JsonPropertyName("wait_for_device_creation")] + public bool? WaitForDeviceCreation { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("connect_webview")] + public ConnectWebview? ConnectWebview { get; init; } + } + + /// + /// Creates a new [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). + /// + /// To enable a user to connect their devices or systems to Seam, they must sign in to their device or system account. To enable a user to sign in, you create a `connect_webview`. After creating the Connect Webview, you receive a URL that you can use to display the visual component of this Connect Webview for your user. You can open an iframe or new window to display the Connect Webview. + /// + /// You should make a new `connect_webview` for each unique login request. Each `connect_webview` tracks the user that signed in with it. You receive an error if you reuse a Connect Webview for the same user twice or if you use the same Connect Webview for multiple users. + /// + /// See also: [Connect Webview Process](https://docs.seam.co/core-concepts/connect-webviews/connect-webview-process). + /// + public async Task CreateAsync( + CreateRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/connect_webviews/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ConnectWebview + ?? throw new HttpRequestException( + "Seam returned no connect_webview for /connect_webviews/create" + ); + } + + /// + /// Request parameters for Delete a Connect Webview. + /// + public sealed record DeleteRequest + { + /// + /// ID of the Connect Webview that you want to delete. + /// + [JsonPropertyName("connect_webview_id")] + public required string ConnectWebviewId { get; init; } + } + + /// + /// Deletes a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). + /// + /// You do not need to delete a Connect Webview once a user completes it. Instead, you can simply ignore completed Connect Webviews. + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/connect_webviews/delete", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Connect Webview. + /// + public sealed record GetRequest + { + /// + /// ID of the Connect Webview that you want to get. + /// + [JsonPropertyName("connect_webview_id")] + public required string ConnectWebviewId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("connect_webview")] + public ConnectWebview? ConnectWebview { get; init; } + } + + /// + /// Returns a specified [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). + /// + /// Unless you're using a `custom_redirect_url`, you should poll a newly-created `connect_webview` to find out if the user has signed in or to get details about what devices they've connected. + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/connect_webviews/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ConnectWebview + ?? throw new HttpRequestException( + "Seam returned no connect_webview for /connect_webviews/get" + ); + } + + /// + /// Request parameters for List Connect Webviews. + /// + public sealed record ListRequest + { + /// + /// Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. + /// + [JsonPropertyName("custom_metadata_has")] + public object? CustomMetadataHas { get; init; } + + /// + /// Customer key for which you want to list connect webviews. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Maximum number of records to return per page. + /// + [JsonPropertyName("limit")] + public float? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned Connect Webviews to include all records that satisfy a partial match using `connect_webview_id`, `accepted_providers`, `custom_metadata`, or `customer_key`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// Your user ID for the user by which you want to filter Connect Webviews. + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("connect_webviews")] + public List? ConnectWebviews { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/connect_webviews/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ConnectWebviews + ?? throw new HttpRequestException( + "Seam returned no connect_webviews for /connect_webviews/list" + ); + } + + /// Fetches one page of /connect_webviews/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/connect_webviews/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.ConnectWebviews + ?? throw new HttpRequestException( + "Seam returned no connect_webviews for /connect_webviews/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /connect_webviews/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /connect_webviews/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + } +} diff --git a/src/Seam/Routes/ConnectedAccounts.cs b/src/Seam/Routes/ConnectedAccounts.cs new file mode 100644 index 00000000..7115a9d0 --- /dev/null +++ b/src/Seam/Routes/ConnectedAccounts.cs @@ -0,0 +1,364 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class ConnectedAccounts + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal ConnectedAccounts( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + Simulate = new ConnectedAccountsSimulate(transport, waitForActionAttemptDefault); + } + + public ConnectedAccountsSimulate Simulate { get; } + + /// + /// Request parameters for Delete a Connected Account. + /// + public sealed record DeleteRequest + { + /// + /// ID of the connected account that you want to delete. + /// + [JsonPropertyName("connected_account_id")] + public required string ConnectedAccountId { get; init; } + } + + /// + /// Deletes a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). + /// + /// Deleting a connected account triggers a `connected_account.deleted` event and removes the connected account and all data associated with the connected account from Seam, including devices, events, access codes, and so on. For every deleted resource, Seam sends a corresponding deleted event, but the resource is not deleted from the provider. + /// + /// For example, if you delete a connected account with a device that has an access code, Seam sends a `connected_account.deleted` event, a `device.deleted` event, and an `access_code.deleted` event, but Seam does not remove the access code from the device. + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/connected_accounts/delete", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Connected Account. + /// + public sealed record GetRequest + { + /// + /// ID of the connected account that you want to get. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// Email address associated with the connected account that you want to get. + /// + [JsonPropertyName("email")] + public string? Email { get; init; } + + internal void Validate() + { + if (ConnectedAccountId == null && Email == null) + { + throw new ArgumentException( + "At least one parameter is required for /connected_accounts/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("connected_account")] + public ConnectedAccount? ConnectedAccount { get; init; } + } + + /// + /// Returns a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/connected_accounts/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ConnectedAccount + ?? throw new HttpRequestException( + "Seam returned no connected_account for /connected_accounts/get" + ); + } + + /// + /// Request parameters for List Connected Accounts. + /// + public sealed record ListRequest + { + /// + /// Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. + /// + [JsonPropertyName("custom_metadata_has")] + public object? CustomMetadataHas { get; init; } + + /// + /// Customer key by which you want to filter connected accounts. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Maximum number of records to return per page. + /// + [JsonPropertyName("limit")] + public int? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned connected accounts to include all records that satisfy a partial match using `connected_account_id`, `account_type`, `customer_key`, `custom_metadata`, `user_identifier.username`, `user_identifier.email` or `user_identifier.phone`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// ID of the space by which you want to filter connected accounts. + /// + [JsonPropertyName("space_id")] + public string? SpaceId { get; init; } + + /// + /// Your user ID for the user by which you want to filter connected accounts. + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("connected_accounts")] + public List? ConnectedAccounts { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [connected accounts](https://docs.seam.co/core-concepts/connected-accounts). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/connected_accounts/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ConnectedAccounts + ?? throw new HttpRequestException( + "Seam returned no connected_accounts for /connected_accounts/list" + ); + } + + /// Fetches one page of /connected_accounts/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/connected_accounts/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.ConnectedAccounts + ?? throw new HttpRequestException( + "Seam returned no connected_accounts for /connected_accounts/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /connected_accounts/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /connected_accounts/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Sync a Connected Account. + /// + public sealed record SyncRequest + { + /// + /// ID of the connected account that you want to sync. + /// + [JsonPropertyName("connected_account_id")] + public required string ConnectedAccountId { get; init; } + } + + /// + /// Request a [connected account](https://docs.seam.co/core-concepts/connected-accounts) sync attempt for the specified `connected_account_id`. + /// + public async Task SyncAsync( + SyncRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Post, "/connected_accounts/sync", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update a Connected Account. + /// + public sealed record UpdateRequest + { + /// + /// List of accepted device capabilities that restrict the types of devices that can be connected through this connected account. Valid values are `lock`, `thermostat`, `noise_sensor`, and `access_control`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum AcceptedCapabilitiesEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "lock")] + Lock = 1, + + [EnumMember(Value = "thermostat")] + Thermostat = 2, + + [EnumMember(Value = "noise_sensor")] + NoiseSensor = 3, + + [EnumMember(Value = "access_control")] + AccessControl = 4, + + [EnumMember(Value = "camera")] + Camera = 5, + } + + /// + /// List of accepted device capabilities that restrict the types of devices that can be connected through this connected account. Valid values are `lock`, `thermostat`, `noise_sensor`, and `access_control`. + /// + [JsonPropertyName("accepted_capabilities")] + public List? AcceptedCapabilities { get; init; } + + /// + /// Indicates whether newly-added devices should appear as [managed devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). + /// + [JsonPropertyName("automatically_manage_new_devices")] + public bool? AutomaticallyManageNewDevices { get; init; } + + /// + /// ID of the connected account that you want to update. + /// + [JsonPropertyName("connected_account_id")] + public required string ConnectedAccountId { get; init; } + + /// + /// Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter connected accounts by the desired metadata](https://docs.seam.co/core-concepts/connected-accounts/filtering-connected-accounts-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata. + /// + [JsonPropertyName("custom_metadata")] + public object? CustomMetadata { get; init; } + + /// + /// The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Human-readable name for the connected account, shown in the dashboard. For example, `Booking from Airbnb House 1`. + /// + [JsonPropertyName("display_name")] + public string? DisplayName { get; init; } + } + + /// + /// Updates a [connected account](https://docs.seam.co/core-concepts/connected-accounts). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/connected_accounts/update", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/ConnectedAccountsSimulate.cs b/src/Seam/Routes/ConnectedAccountsSimulate.cs new file mode 100644 index 00000000..0ea2b937 --- /dev/null +++ b/src/Seam/Routes/ConnectedAccountsSimulate.cs @@ -0,0 +1,58 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class ConnectedAccountsSimulate + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal ConnectedAccountsSimulate( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Simulate Connected Account Disconnection. + /// + public sealed record DisconnectRequest + { + /// + /// ID of the connected account you want to simulate as disconnected. + /// + [JsonPropertyName("connected_account_id")] + public required string ConnectedAccountId { get; init; } + } + + /// + /// Simulates a connected account becoming disconnected from Seam. Only applicable for [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + public async Task DisconnectAsync( + DisconnectRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/connected_accounts/simulate/disconnect", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/Customers.cs b/src/Seam/Routes/Customers.cs new file mode 100644 index 00000000..8133bcca --- /dev/null +++ b/src/Seam/Routes/Customers.cs @@ -0,0 +1,2472 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class Customers + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal Customers( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Create Customer Portal. + /// + public sealed record CreatePortalRequest + { + /// + /// The locale to use for the portal. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum LocaleEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "en-US")] + EnUs = 1, + + [EnumMember(Value = "pt-PT")] + PtPt = 2, + + [EnumMember(Value = "fr-FR")] + FrFr = 3, + + [EnumMember(Value = "it-IT")] + ItIt = 4, + + [EnumMember(Value = "es-ES")] + EsEs = 5, + + [EnumMember(Value = "de-DE")] + DeDe = 6, + + [EnumMember(Value = "nl-NL")] + NlNl = 7, + + [EnumMember(Value = "el-GR")] + ElGr = 8, + + [EnumMember(Value = "pl-PL")] + PlPl = 9, + + [EnumMember(Value = "ru-RU")] + RuRu = 10, + } + + /// + /// Navigation mode for the portal. 'restricted' tells frontend to hide navigation UI, typically used for embedded deep links. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum NavigationModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "full")] + Full = 1, + + [EnumMember(Value = "restricted")] + Restricted = 2, + } + + /// + /// Filter configuration for resources based on their custom_metadata. Each filter specifies a field, operation, and value to match against resource custom_metadata. + /// + [JsonPropertyName("customer_resources_filters")] + public List? CustomerResourcesFilters { get; init; } + + /// + /// The ID of the customization profile to use for the portal. + /// + [JsonPropertyName("customization_profile_id")] + public string? CustomizationProfileId { get; init; } + + /// + /// Deep link target resource for initial redirect. When set, the portal will navigate directly to the specified resource. + /// + [JsonPropertyName("deep_link")] + public CreatePortalRequestDeepLink? DeepLink { get; init; } + + /// + /// Whether to exclude the option to select a locale within the portal UI. + /// + [JsonPropertyName("exclude_locale_picker")] + public bool? ExcludeLocalePicker { get; init; } + + [JsonPropertyName("features")] + public CreatePortalRequestFeatures? Features { get; init; } + + /// + /// Whether the portal is embedded in another application. + /// + [JsonPropertyName("is_embedded")] + public bool? IsEmbedded { get; init; } + + /// + /// Configuration for the landing page when the portal loads. + /// + [JsonPropertyName("landing_page")] + public CreatePortalRequestLandingPage? LandingPage { get; init; } + + /// + /// The locale to use for the portal. + /// + [JsonPropertyName("locale")] + public CreatePortalRequest.LocaleEnum? Locale { get; init; } + + /// + /// Navigation mode for the portal. 'restricted' tells frontend to hide navigation UI, typically used for embedded deep links. + /// + [JsonPropertyName("navigation_mode")] + public CreatePortalRequest.NavigationModeEnum? NavigationMode { get; init; } + + /// + /// Whether the portal is read-only. When true, the customer can browse the portal but cannot perform any mutating action; write requests made with the portal's client session are rejected. + /// + [JsonPropertyName("read_only")] + public bool? ReadOnly { get; init; } + + [JsonPropertyName("customer_data")] + public CreatePortalRequestCustomerData? CustomerData { get; init; } + } + + public sealed record CreatePortalRequestCustomerResourcesFilters + { + /// + /// The comparison operation. Currently only '=' is supported. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum OperationEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "=")] + empty = 1, + } + + /// + /// The custom_metadata field name to filter on. + /// + [JsonPropertyName("field")] + public string? Field { get; init; } + + /// + /// The comparison operation. Currently only '=' is supported. + /// + [JsonPropertyName("operation")] + public CreatePortalRequestCustomerResourcesFilters.OperationEnum? Operation { get; init; } + + /// + /// The value to compare against. + /// + [JsonPropertyName("value")] + public string? Value { get; init; } + } + + public sealed record CreatePortalRequestDeepLink + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ResourceTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "reservation")] + Reservation = 1, + + [EnumMember(Value = "space")] + Space = 2, + + [EnumMember(Value = "device")] + Device = 3, + } + + [JsonPropertyName("resource_key")] + public string? ResourceKey { get; init; } + + [JsonPropertyName("resource_type")] + public CreatePortalRequestDeepLink.ResourceTypeEnum? ResourceType { get; init; } + + [JsonPropertyName("resource_id")] + public string? ResourceId { get; init; } + } + + public sealed record CreatePortalRequestFeatures + { + /// + /// Configuration for the configure feature. + /// + [JsonPropertyName("configure")] + public CreatePortalRequestFeaturesConfigure? Configure { get; init; } + + /// + /// Configuration for the connect accounts feature. + /// + [JsonPropertyName("connect")] + public CreatePortalRequestFeaturesConnect? Connect { get; init; } + + /// + /// Configuration for the manage feature. + /// + [JsonPropertyName("manage")] + public CreatePortalRequestFeaturesManage? Manage { get; init; } + + /// + /// Configuration for the manage devices feature. + /// --- + /// deprecated: Use `manage` instead. + /// --- + /// + [JsonPropertyName("manage_devices")] + public CreatePortalRequestFeaturesManageDevices? ManageDevices { get; init; } + + /// + /// Configuration for the organize feature. + /// + [JsonPropertyName("organize")] + public CreatePortalRequestFeaturesOrganize? Organize { get; init; } + } + + public sealed record CreatePortalRequestFeaturesConfigure + { + /// + /// Indicates whether the customer can customize the access automation rules for their properties. + /// + [JsonPropertyName("allow_access_automation_rule_customization")] + public bool? AllowAccessAutomationRuleCustomization { get; init; } + + /// + /// Indicates whether the customer can customize the climate automation rules for their properties. + /// + [JsonPropertyName("allow_climate_automation_rule_customization")] + public bool? AllowClimateAutomationRuleCustomization { get; init; } + + /// + /// Indicates whether the customer can customize the Instant Key profile for their properties. + /// + [JsonPropertyName("allow_instant_key_customization")] + public bool? AllowInstantKeyCustomization { get; init; } + + /// + /// Whether to exclude this feature from the portal. + /// + [JsonPropertyName("exclude")] + public bool? Exclude { get; init; } + } + + public sealed record CreatePortalRequestFeaturesConnect + { + /// + /// List of provider keys to allow for the connect feature. These providers will be shown when the customer tries to connect an account. + /// + [JsonPropertyName("accepted_providers")] + public List? AcceptedProviders { get; init; } + + /// + /// Whether to exclude this feature from the portal. + /// + [JsonPropertyName("exclude")] + public bool? Exclude { get; init; } + + /// + /// List of provider keys to exclude from the connect feature. These providers will not be shown when the customer tries to connect an account. + /// + [JsonPropertyName("excluded_providers")] + public List? ExcludedProviders { get; init; } + } + + public sealed record CreatePortalRequestFeaturesManage + { + /// + /// Custom copy for the confirmation modal shown before unmanaged devices are added to a space and begin being managed (and billed). Only takes effect when the MANAGE_DEVICES_CONFIRMATION_MODAL feature flag is enabled for the workspace. Any omitted string falls back to a localized default. + /// + [JsonPropertyName("device_management_confirmation")] + public CreatePortalRequestFeaturesManageDeviceManagementConfirmation? DeviceManagementConfirmation { get; init; } + + /// + /// Configuration for event type filtering in the manage feature. + /// + [JsonPropertyName("events")] + public CreatePortalRequestFeaturesManageEvents? Events { get; init; } + + /// + /// Whether to exclude this feature from the portal. + /// + [JsonPropertyName("exclude")] + public bool? Exclude { get; init; } + + /// + /// Indicates whether the customer can manage reservations for their properties. + /// + [JsonPropertyName("exclude_reservation_management")] + public bool? ExcludeReservationManagement { get; init; } + + /// + /// Indicates whether to exclude technical details from reservation views. + /// + [JsonPropertyName("exclude_reservation_technical_details")] + public bool? ExcludeReservationTechnicalDetails { get; init; } + + /// + /// Indicates whether the customer can manage staff for their properties. + /// + [JsonPropertyName("exclude_staff_management")] + public bool? ExcludeStaffManagement { get; init; } + } + + public sealed record CreatePortalRequestFeaturesManageDeviceManagementConfirmation + { + /// + /// Custom body text for the confirmation modal. May include the {count} token, which is replaced with the number of devices that will begin being managed. + /// + [JsonPropertyName("body")] + public string? Body { get; init; } + + /// + /// Custom label for the cancel button. + /// + [JsonPropertyName("cancel_button_label")] + public string? CancelButtonLabel { get; init; } + + /// + /// Custom label for the confirm button. + /// + [JsonPropertyName("confirm_button_label")] + public string? ConfirmButtonLabel { get; init; } + + /// + /// Custom title for the confirmation modal. + /// + [JsonPropertyName("title")] + public string? Title { get; init; } + } + + public sealed record CreatePortalRequestFeaturesManageEvents + { + /// + /// List of event types to show in the events filter. When set, only these event types will be available. Leave empty to show all events. + /// + [JsonPropertyName("allowed_events")] + public List? AllowedEvents { get; init; } + + /// + /// List of event types that are pre-selected in the events filter when the user first loads the events tab. + /// + [JsonPropertyName("default_events")] + public List? DefaultEvents { get; init; } + } + + public sealed record CreatePortalRequestFeaturesManageDevices + { + /// + /// Whether to exclude this feature from the portal. + /// + [JsonPropertyName("exclude")] + public bool? Exclude { get; init; } + } + + public sealed record CreatePortalRequestFeaturesOrganize + { + /// + /// Whether to exclude this feature from the portal. + /// + [JsonPropertyName("exclude")] + public bool? Exclude { get; init; } + } + + public sealed record CreatePortalRequestLandingPage + { + [JsonPropertyName("manage")] + public CreatePortalRequestLandingPageManage? Manage { get; init; } + } + + public sealed record CreatePortalRequestLandingPageManage + { + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + + [JsonPropertyName("property_key")] + public string? PropertyKey { get; init; } + + [JsonPropertyName("room_key")] + public string? RoomKey { get; init; } + + [JsonPropertyName("common_area_key")] + public string? CommonAreaKey { get; init; } + + [JsonPropertyName("unit_key")] + public string? UnitKey { get; init; } + + [JsonPropertyName("facility_key")] + public string? FacilityKey { get; init; } + + [JsonPropertyName("building_key")] + public string? BuildingKey { get; init; } + + [JsonPropertyName("listing_key")] + public string? ListingKey { get; init; } + + [JsonPropertyName("property_listing_key")] + public string? PropertyListingKey { get; init; } + + [JsonPropertyName("site_key")] + public string? SiteKey { get; init; } + + [JsonPropertyName("reservation_key")] + public string? ReservationKey { get; init; } + + [JsonPropertyName("booking_key")] + public string? BookingKey { get; init; } + + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerData + { + /// + /// List of access grants. + /// + [JsonPropertyName("access_grants")] + public List? AccessGrants { get; init; } + + /// + /// List of bookings. + /// + [JsonPropertyName("bookings")] + public List? Bookings { get; init; } + + /// + /// List of buildings. + /// + [JsonPropertyName("buildings")] + public List? Buildings { get; init; } + + /// + /// List of shared common areas. + /// + [JsonPropertyName("common_areas")] + public List? CommonAreas { get; init; } + + /// + /// Your unique identifier for the customer. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// List of gym or fitness facilities. + /// + [JsonPropertyName("facilities")] + public List? Facilities { get; init; } + + /// + /// List of guests. + /// + [JsonPropertyName("guests")] + public List? Guests { get; init; } + + /// + /// List of property listings. + /// + [JsonPropertyName("listings")] + public List? Listings { get; init; } + + /// + /// List of short-term rental properties. + /// + [JsonPropertyName("properties")] + public List? Properties { get; init; } + + /// + /// List of property listings. + /// + [JsonPropertyName("property_listings")] + public List? PropertyListings { get; init; } + + /// + /// List of reservations. + /// + [JsonPropertyName("reservations")] + public List? Reservations { get; init; } + + /// + /// List of residents. + /// + [JsonPropertyName("residents")] + public List? Residents { get; init; } + + /// + /// List of hotel or hospitality rooms. + /// + [JsonPropertyName("rooms")] + public List? Rooms { get; init; } + + /// + /// List of general sites or areas. + /// + [JsonPropertyName("sites")] + public List? Sites { get; init; } + + /// + /// List of general spaces or areas. + /// + [JsonPropertyName("spaces")] + public List? Spaces { get; init; } + + /// + /// List of staff members. + /// + [JsonPropertyName("staff_members")] + public List? StaffMembers { get; init; } + + /// + /// List of tenants. + /// + [JsonPropertyName("tenants")] + public List? Tenants { get; init; } + + /// + /// List of multi-family residential units. + /// + [JsonPropertyName("units")] + public List? Units { get; init; } + + /// + /// List of user identities. + /// + [JsonPropertyName("user_identities")] + public List? UserIdentities { get; init; } + + /// + /// List of users. + /// + [JsonPropertyName("users")] + public List? Users { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataAccessGrants + { + /// + /// Your unique identifier for the access grant. + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + /// + /// Building keys associated with the access grant. + /// + [JsonPropertyName("building_keys")] + public List? BuildingKeys { get; init; } + + /// + /// Common area keys associated with the access grant. + /// + [JsonPropertyName("common_area_keys")] + public List? CommonAreaKeys { get; init; } + + /// + /// Ending date and time for the access grant. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Facility keys associated with the access grant. + /// + [JsonPropertyName("facility_keys")] + public List? FacilityKeys { get; init; } + + /// + /// Guest key associated with the access grant. + /// + [JsonPropertyName("guest_key")] + public string? GuestKey { get; init; } + + /// + /// Listing keys associated with the access grant. + /// + [JsonPropertyName("listing_keys")] + public List? ListingKeys { get; init; } + + /// + /// Your name for this access grant resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Preferred PIN code to use when creating access for this reservation. + /// + [JsonPropertyName("preferred_code")] + public string? PreferredCode { get; init; } + + /// + /// Property keys associated with the access grant. + /// + [JsonPropertyName("property_keys")] + public List? PropertyKeys { get; init; } + + /// + /// Resident key associated with the access grant. + /// + [JsonPropertyName("resident_key")] + public string? ResidentKey { get; init; } + + /// + /// Room keys associated with the access grant. + /// + [JsonPropertyName("room_keys")] + public List? RoomKeys { get; init; } + + /// + /// Space keys associated with the access grant. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// Starting date and time for the access grant. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Tenant key associated with the access grant. + /// + [JsonPropertyName("tenant_key")] + public string? TenantKey { get; init; } + + /// + /// Unit keys associated with the access grant. + /// + [JsonPropertyName("unit_keys")] + public List? UnitKeys { get; init; } + + /// + /// User identity key associated with the access grant. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + + /// + /// User key associated with the access grant. + /// + [JsonPropertyName("user_key")] + public string? UserKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataBookings + { + /// + /// Your unique identifier for the booking. + /// + [JsonPropertyName("booking_key")] + public string? BookingKey { get; init; } + + /// + /// Building keys associated with the access grant. + /// + [JsonPropertyName("building_keys")] + public List? BuildingKeys { get; init; } + + /// + /// Common area keys associated with the access grant. + /// + [JsonPropertyName("common_area_keys")] + public List? CommonAreaKeys { get; init; } + + /// + /// Ending date and time for the access grant. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Facility keys associated with the access grant. + /// + [JsonPropertyName("facility_keys")] + public List? FacilityKeys { get; init; } + + /// + /// Guest key associated with the access grant. + /// + [JsonPropertyName("guest_key")] + public string? GuestKey { get; init; } + + /// + /// Listing keys associated with the access grant. + /// + [JsonPropertyName("listing_keys")] + public List? ListingKeys { get; init; } + + /// + /// Your name for this access grant resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Preferred PIN code to use when creating access for this reservation. + /// + [JsonPropertyName("preferred_code")] + public string? PreferredCode { get; init; } + + /// + /// Property keys associated with the access grant. + /// + [JsonPropertyName("property_keys")] + public List? PropertyKeys { get; init; } + + /// + /// Resident key associated with the access grant. + /// + [JsonPropertyName("resident_key")] + public string? ResidentKey { get; init; } + + /// + /// Room keys associated with the access grant. + /// + [JsonPropertyName("room_keys")] + public List? RoomKeys { get; init; } + + /// + /// Space keys associated with the access grant. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// Starting date and time for the access grant. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Tenant key associated with the access grant. + /// + [JsonPropertyName("tenant_key")] + public string? TenantKey { get; init; } + + /// + /// Unit keys associated with the access grant. + /// + [JsonPropertyName("unit_keys")] + public List? UnitKeys { get; init; } + + /// + /// User identity key associated with the access grant. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + + /// + /// User key associated with the access grant. + /// + [JsonPropertyName("user_key")] + public string? UserKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataBuildings + { + /// + /// Your unique identifier for the building. + /// + [JsonPropertyName("building_key")] + public string? BuildingKey { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataCommonAreas + { + /// + /// Your unique identifier for the common area. + /// + [JsonPropertyName("common_area_key")] + public string? CommonAreaKey { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("parent_site_key")] + public string? ParentSiteKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataFacilities + { + /// + /// Your unique identifier for the facility. + /// + [JsonPropertyName("facility_key")] + public string? FacilityKey { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataGuests + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your unique identifier for the guest. + /// + [JsonPropertyName("guest_key")] + public string? GuestKey { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataListings + { + /// + /// Your unique identifier for the listing. + /// + [JsonPropertyName("listing_key")] + public string? ListingKey { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataProperties + { + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the property. + /// + [JsonPropertyName("property_key")] + public string? PropertyKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataPropertyListings + { + /// + /// Set key:value pairs. Accepts string or Boolean values. Adding custom metadata to a property listing enables you to store custom information, like customer details or internal IDs from your application. Set a key to `null` or to an empty string to remove that key from the custom metadata. + /// + [JsonPropertyName("custom_metadata")] + public object? CustomMetadata { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the property listing. + /// + [JsonPropertyName("property_listing_key")] + public string? PropertyListingKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataReservations + { + /// + /// Building keys associated with the access grant. + /// + [JsonPropertyName("building_keys")] + public List? BuildingKeys { get; init; } + + /// + /// Common area keys associated with the access grant. + /// + [JsonPropertyName("common_area_keys")] + public List? CommonAreaKeys { get; init; } + + /// + /// Set key:value pairs for filtering reservations by custom criteria. Set a key to `null` or to an empty string to remove that key from the custom metadata. + /// + [JsonPropertyName("custom_metadata")] + public object? CustomMetadata { get; init; } + + /// + /// Ending date and time for the access grant. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Facility keys associated with the access grant. + /// + [JsonPropertyName("facility_keys")] + public List? FacilityKeys { get; init; } + + /// + /// Guest key associated with the access grant. + /// + [JsonPropertyName("guest_key")] + public string? GuestKey { get; init; } + + /// + /// Listing keys associated with the access grant. + /// + [JsonPropertyName("listing_keys")] + public List? ListingKeys { get; init; } + + /// + /// Your name for this access grant resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Preferred PIN code to use when creating access for this reservation. + /// + [JsonPropertyName("preferred_code")] + public string? PreferredCode { get; init; } + + /// + /// Property keys associated with the access grant. + /// + [JsonPropertyName("property_keys")] + public List? PropertyKeys { get; init; } + + /// + /// Your unique identifier for the reservation. + /// + [JsonPropertyName("reservation_key")] + public string? ReservationKey { get; init; } + + /// + /// Resident key associated with the access grant. + /// + [JsonPropertyName("resident_key")] + public string? ResidentKey { get; init; } + + /// + /// Room keys associated with the access grant. + /// + [JsonPropertyName("room_keys")] + public List? RoomKeys { get; init; } + + /// + /// Space keys associated with the access grant. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// Starting date and time for the access grant. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Tenant key associated with the access grant. + /// + [JsonPropertyName("tenant_key")] + public string? TenantKey { get; init; } + + /// + /// Unit keys associated with the access grant. + /// + [JsonPropertyName("unit_keys")] + public List? UnitKeys { get; init; } + + /// + /// User identity key associated with the access grant. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + + /// + /// User key associated with the access grant. + /// + [JsonPropertyName("user_key")] + public string? UserKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataResidents + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// Your unique identifier for the resident. + /// + [JsonPropertyName("resident_key")] + public string? ResidentKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataRooms + { + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("parent_site_key")] + public string? ParentSiteKey { get; init; } + + /// + /// Your unique identifier for the room. + /// + [JsonPropertyName("room_key")] + public string? RoomKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataSites + { + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("site_key")] + public string? SiteKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataSpaces + { + /// + /// Reservation/stay-related defaults for the space (time zone, default check-in/out times, address). + /// + [JsonPropertyName("customer_data")] + public CreatePortalRequestCustomerDataSpacesCustomerData? CustomerData { get; init; } + + /// + /// Default duration of this space in minutes, when the space represents a fixed-length bookable slot (e.g. an appointment type). Used to interpret reservations booked against this space. + /// + [JsonPropertyName("duration_minutes")] + public int? DurationMinutes { get; init; } + + /// + /// Geographic coordinates (latitude and longitude) of the space. + /// + [JsonPropertyName("geolocation")] + public CreatePortalRequestCustomerDataSpacesGeolocation? Geolocation { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("parent_site_key")] + public string? ParentSiteKey { get; init; } + + /// + /// Your unique identifier for the space. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataSpacesCustomerData + { + /// + /// Postal address for the space. + /// + [JsonPropertyName("address")] + public Optional Address { get; init; } + + /// + /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkin_time")] + public Optional DefaultCheckinTime { get; init; } + + /// + /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkout_time")] + public Optional DefaultCheckoutTime { get; init; } + + /// + /// IANA time zone for the space, e.g. America/Los_Angeles. + /// + [JsonPropertyName("time_zone")] + public Optional TimeZone { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataSpacesGeolocation + { + /// + /// Latitude of the space, in decimal degrees. + /// + [JsonPropertyName("latitude")] + public float? Latitude { get; init; } + + /// + /// Longitude of the space, in decimal degrees. + /// + [JsonPropertyName("longitude")] + public float? Longitude { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataStaffMembers + { + /// + /// List of unique identifiers for the buildings the staff member is associated with. + /// + [JsonPropertyName("building_keys")] + public List? BuildingKeys { get; init; } + + /// + /// List of unique identifiers for the common areas the staff member is associated with. + /// + [JsonPropertyName("common_area_keys")] + public List? CommonAreaKeys { get; init; } + + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// List of unique identifiers for the facilities the staff member is associated with. + /// + [JsonPropertyName("facility_keys")] + public List? FacilityKeys { get; init; } + + /// + /// List of unique identifiers for the listings the staff member is associated with. + /// + [JsonPropertyName("listing_keys")] + public List? ListingKeys { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// List of unique identifiers for the properties the staff member is associated with. + /// + [JsonPropertyName("property_keys")] + public List? PropertyKeys { get; init; } + + /// + /// List of unique identifiers for the property listings the staff member is associated with. + /// + [JsonPropertyName("property_listing_keys")] + public List? PropertyListingKeys { get; init; } + + /// + /// List of unique identifiers for the rooms the staff member is associated with. + /// + [JsonPropertyName("room_keys")] + public List? RoomKeys { get; init; } + + /// + /// List of unique identifiers for the sites the staff member is associated with. + /// + [JsonPropertyName("site_keys")] + public List? SiteKeys { get; init; } + + /// + /// List of unique identifiers for the spaces the staff member is associated with. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// Your unique identifier for the staff. + /// + [JsonPropertyName("staff_member_key")] + public string? StaffMemberKey { get; init; } + + /// + /// List of unique identifiers for the units the staff member is associated with. + /// + [JsonPropertyName("unit_keys")] + public List? UnitKeys { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataTenants + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// Your unique identifier for the tenant. + /// + [JsonPropertyName("tenant_key")] + public string? TenantKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataUnits + { + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("parent_site_key")] + public string? ParentSiteKey { get; init; } + + /// + /// Your unique identifier for the unit. + /// + [JsonPropertyName("unit_key")] + public string? UnitKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataUserIdentities + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// Your unique identifier for the user identity. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + } + + public sealed record CreatePortalRequestCustomerDataUsers + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// Your unique identifier for the user. + /// + [JsonPropertyName("user_key")] + public string? UserKey { get; init; } + } + + public sealed record CreatePortalResponse + { + /// + /// OK + /// + [JsonPropertyName("customer_portal")] + public CustomerPortal? CustomerPortal { get; init; } + } + + /// + /// Creates a new customer portal magic link with configurable features. + /// + public async Task CreatePortalAsync( + CreatePortalRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/customers/create_portal", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.CustomerPortal + ?? throw new HttpRequestException( + "Seam returned no customer_portal for /customers/create_portal" + ); + } + + /// + /// Request parameters for Delete Customer Data. + /// + public sealed record DeleteDataRequest + { + /// + /// List of access grant keys to delete. + /// + [JsonPropertyName("access_grant_keys")] + public List? AccessGrantKeys { get; init; } + + /// + /// List of booking keys to delete. + /// + [JsonPropertyName("booking_keys")] + public List? BookingKeys { get; init; } + + /// + /// List of building keys to delete. + /// + [JsonPropertyName("building_keys")] + public List? BuildingKeys { get; init; } + + /// + /// List of common area keys to delete. + /// + [JsonPropertyName("common_area_keys")] + public List? CommonAreaKeys { get; init; } + + /// + /// List of customer keys to delete all data for. + /// + [JsonPropertyName("customer_keys")] + public List? CustomerKeys { get; init; } + + /// + /// List of facility keys to delete. + /// + [JsonPropertyName("facility_keys")] + public List? FacilityKeys { get; init; } + + /// + /// List of guest keys to delete. + /// + [JsonPropertyName("guest_keys")] + public List? GuestKeys { get; init; } + + /// + /// List of listing keys to delete. + /// + [JsonPropertyName("listing_keys")] + public List? ListingKeys { get; init; } + + /// + /// List of property keys to delete. + /// + [JsonPropertyName("property_keys")] + public List? PropertyKeys { get; init; } + + /// + /// List of property listing keys to delete. + /// + [JsonPropertyName("property_listing_keys")] + public List? PropertyListingKeys { get; init; } + + /// + /// List of reservation keys to delete. + /// + [JsonPropertyName("reservation_keys")] + public List? ReservationKeys { get; init; } + + /// + /// List of resident keys to delete. + /// + [JsonPropertyName("resident_keys")] + public List? ResidentKeys { get; init; } + + /// + /// List of room keys to delete. + /// + [JsonPropertyName("room_keys")] + public List? RoomKeys { get; init; } + + /// + /// List of space keys to delete. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// List of staff member keys to delete. + /// + [JsonPropertyName("staff_member_keys")] + public List? StaffMemberKeys { get; init; } + + /// + /// List of tenant keys to delete. + /// + [JsonPropertyName("tenant_keys")] + public List? TenantKeys { get; init; } + + /// + /// List of unit keys to delete. + /// + [JsonPropertyName("unit_keys")] + public List? UnitKeys { get; init; } + + /// + /// List of user identity keys to delete. + /// + [JsonPropertyName("user_identity_keys")] + public List? UserIdentityKeys { get; init; } + + /// + /// List of user keys to delete. + /// + [JsonPropertyName("user_keys")] + public List? UserKeys { get; init; } + } + + /// + /// Deletes customer data including resources like spaces, properties, rooms, users, etc. + /// This will delete the partner resources and any related Seam resources (user identities, access grants, spaces). + /// + public async Task DeleteDataAsync( + DeleteDataRequest? request = null, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/customers/delete_data", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Push Customer Data. + /// + public sealed record PushDataRequest + { + /// + /// List of access grants. + /// + [JsonPropertyName("access_grants")] + public List? AccessGrants { get; init; } + + /// + /// List of bookings. + /// + [JsonPropertyName("bookings")] + public List? Bookings { get; init; } + + /// + /// List of buildings. + /// + [JsonPropertyName("buildings")] + public List? Buildings { get; init; } + + /// + /// List of shared common areas. + /// + [JsonPropertyName("common_areas")] + public List? CommonAreas { get; init; } + + /// + /// Your unique identifier for the customer. + /// + [JsonPropertyName("customer_key")] + public required string CustomerKey { get; init; } + + /// + /// List of gym or fitness facilities. + /// + [JsonPropertyName("facilities")] + public List? Facilities { get; init; } + + /// + /// List of guests. + /// + [JsonPropertyName("guests")] + public List? Guests { get; init; } + + /// + /// List of property listings. + /// + [JsonPropertyName("listings")] + public List? Listings { get; init; } + + /// + /// List of short-term rental properties. + /// + [JsonPropertyName("properties")] + public List? Properties { get; init; } + + /// + /// List of property listings. + /// + [JsonPropertyName("property_listings")] + public List? PropertyListings { get; init; } + + /// + /// List of reservations. + /// + [JsonPropertyName("reservations")] + public List? Reservations { get; init; } + + /// + /// List of residents. + /// + [JsonPropertyName("residents")] + public List? Residents { get; init; } + + /// + /// List of hotel or hospitality rooms. + /// + [JsonPropertyName("rooms")] + public List? Rooms { get; init; } + + /// + /// List of general sites or areas. + /// + [JsonPropertyName("sites")] + public List? Sites { get; init; } + + /// + /// List of general spaces or areas. + /// + [JsonPropertyName("spaces")] + public List? Spaces { get; init; } + + /// + /// List of staff members. + /// + [JsonPropertyName("staff_members")] + public List? StaffMembers { get; init; } + + /// + /// List of tenants. + /// + [JsonPropertyName("tenants")] + public List? Tenants { get; init; } + + /// + /// List of multi-family residential units. + /// + [JsonPropertyName("units")] + public List? Units { get; init; } + + /// + /// List of user identities. + /// + [JsonPropertyName("user_identities")] + public List? UserIdentities { get; init; } + + /// + /// List of users. + /// + [JsonPropertyName("users")] + public List? Users { get; init; } + } + + public sealed record PushDataRequestAccessGrants + { + /// + /// Your unique identifier for the access grant. + /// + [JsonPropertyName("access_grant_key")] + public string? AccessGrantKey { get; init; } + + /// + /// Building keys associated with the access grant. + /// + [JsonPropertyName("building_keys")] + public List? BuildingKeys { get; init; } + + /// + /// Common area keys associated with the access grant. + /// + [JsonPropertyName("common_area_keys")] + public List? CommonAreaKeys { get; init; } + + /// + /// Ending date and time for the access grant. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Facility keys associated with the access grant. + /// + [JsonPropertyName("facility_keys")] + public List? FacilityKeys { get; init; } + + /// + /// Guest key associated with the access grant. + /// + [JsonPropertyName("guest_key")] + public string? GuestKey { get; init; } + + /// + /// Listing keys associated with the access grant. + /// + [JsonPropertyName("listing_keys")] + public List? ListingKeys { get; init; } + + /// + /// Your name for this access grant resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Preferred PIN code to use when creating access for this reservation. + /// + [JsonPropertyName("preferred_code")] + public string? PreferredCode { get; init; } + + /// + /// Property keys associated with the access grant. + /// + [JsonPropertyName("property_keys")] + public List? PropertyKeys { get; init; } + + /// + /// Resident key associated with the access grant. + /// + [JsonPropertyName("resident_key")] + public string? ResidentKey { get; init; } + + /// + /// Room keys associated with the access grant. + /// + [JsonPropertyName("room_keys")] + public List? RoomKeys { get; init; } + + /// + /// Space keys associated with the access grant. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// Starting date and time for the access grant. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Tenant key associated with the access grant. + /// + [JsonPropertyName("tenant_key")] + public string? TenantKey { get; init; } + + /// + /// Unit keys associated with the access grant. + /// + [JsonPropertyName("unit_keys")] + public List? UnitKeys { get; init; } + + /// + /// User identity key associated with the access grant. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + + /// + /// User key associated with the access grant. + /// + [JsonPropertyName("user_key")] + public string? UserKey { get; init; } + } + + public sealed record PushDataRequestBookings + { + /// + /// Your unique identifier for the booking. + /// + [JsonPropertyName("booking_key")] + public string? BookingKey { get; init; } + + /// + /// Building keys associated with the access grant. + /// + [JsonPropertyName("building_keys")] + public List? BuildingKeys { get; init; } + + /// + /// Common area keys associated with the access grant. + /// + [JsonPropertyName("common_area_keys")] + public List? CommonAreaKeys { get; init; } + + /// + /// Ending date and time for the access grant. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Facility keys associated with the access grant. + /// + [JsonPropertyName("facility_keys")] + public List? FacilityKeys { get; init; } + + /// + /// Guest key associated with the access grant. + /// + [JsonPropertyName("guest_key")] + public string? GuestKey { get; init; } + + /// + /// Listing keys associated with the access grant. + /// + [JsonPropertyName("listing_keys")] + public List? ListingKeys { get; init; } + + /// + /// Your name for this access grant resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Preferred PIN code to use when creating access for this reservation. + /// + [JsonPropertyName("preferred_code")] + public string? PreferredCode { get; init; } + + /// + /// Property keys associated with the access grant. + /// + [JsonPropertyName("property_keys")] + public List? PropertyKeys { get; init; } + + /// + /// Resident key associated with the access grant. + /// + [JsonPropertyName("resident_key")] + public string? ResidentKey { get; init; } + + /// + /// Room keys associated with the access grant. + /// + [JsonPropertyName("room_keys")] + public List? RoomKeys { get; init; } + + /// + /// Space keys associated with the access grant. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// Starting date and time for the access grant. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Tenant key associated with the access grant. + /// + [JsonPropertyName("tenant_key")] + public string? TenantKey { get; init; } + + /// + /// Unit keys associated with the access grant. + /// + [JsonPropertyName("unit_keys")] + public List? UnitKeys { get; init; } + + /// + /// User identity key associated with the access grant. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + + /// + /// User key associated with the access grant. + /// + [JsonPropertyName("user_key")] + public string? UserKey { get; init; } + } + + public sealed record PushDataRequestBuildings + { + /// + /// Your unique identifier for the building. + /// + [JsonPropertyName("building_key")] + public string? BuildingKey { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record PushDataRequestCommonAreas + { + /// + /// Your unique identifier for the common area. + /// + [JsonPropertyName("common_area_key")] + public string? CommonAreaKey { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("parent_site_key")] + public string? ParentSiteKey { get; init; } + } + + public sealed record PushDataRequestFacilities + { + /// + /// Your unique identifier for the facility. + /// + [JsonPropertyName("facility_key")] + public string? FacilityKey { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record PushDataRequestGuests + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your unique identifier for the guest. + /// + [JsonPropertyName("guest_key")] + public string? GuestKey { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + } + + public sealed record PushDataRequestListings + { + /// + /// Your unique identifier for the listing. + /// + [JsonPropertyName("listing_key")] + public string? ListingKey { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + } + + public sealed record PushDataRequestProperties + { + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the property. + /// + [JsonPropertyName("property_key")] + public string? PropertyKey { get; init; } + } + + public sealed record PushDataRequestPropertyListings + { + /// + /// Set key:value pairs. Accepts string or Boolean values. Adding custom metadata to a property listing enables you to store custom information, like customer details or internal IDs from your application. Set a key to `null` or to an empty string to remove that key from the custom metadata. + /// + [JsonPropertyName("custom_metadata")] + public object? CustomMetadata { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the property listing. + /// + [JsonPropertyName("property_listing_key")] + public string? PropertyListingKey { get; init; } + } + + public sealed record PushDataRequestReservations + { + /// + /// Building keys associated with the access grant. + /// + [JsonPropertyName("building_keys")] + public List? BuildingKeys { get; init; } + + /// + /// Common area keys associated with the access grant. + /// + [JsonPropertyName("common_area_keys")] + public List? CommonAreaKeys { get; init; } + + /// + /// Set key:value pairs for filtering reservations by custom criteria. Set a key to `null` or to an empty string to remove that key from the custom metadata. + /// + [JsonPropertyName("custom_metadata")] + public object? CustomMetadata { get; init; } + + /// + /// Ending date and time for the access grant. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Facility keys associated with the access grant. + /// + [JsonPropertyName("facility_keys")] + public List? FacilityKeys { get; init; } + + /// + /// Guest key associated with the access grant. + /// + [JsonPropertyName("guest_key")] + public string? GuestKey { get; init; } + + /// + /// Listing keys associated with the access grant. + /// + [JsonPropertyName("listing_keys")] + public List? ListingKeys { get; init; } + + /// + /// Your name for this access grant resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Preferred PIN code to use when creating access for this reservation. + /// + [JsonPropertyName("preferred_code")] + public string? PreferredCode { get; init; } + + /// + /// Property keys associated with the access grant. + /// + [JsonPropertyName("property_keys")] + public List? PropertyKeys { get; init; } + + /// + /// Your unique identifier for the reservation. + /// + [JsonPropertyName("reservation_key")] + public string? ReservationKey { get; init; } + + /// + /// Resident key associated with the access grant. + /// + [JsonPropertyName("resident_key")] + public string? ResidentKey { get; init; } + + /// + /// Room keys associated with the access grant. + /// + [JsonPropertyName("room_keys")] + public List? RoomKeys { get; init; } + + /// + /// Space keys associated with the access grant. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// Starting date and time for the access grant. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// Tenant key associated with the access grant. + /// + [JsonPropertyName("tenant_key")] + public string? TenantKey { get; init; } + + /// + /// Unit keys associated with the access grant. + /// + [JsonPropertyName("unit_keys")] + public List? UnitKeys { get; init; } + + /// + /// User identity key associated with the access grant. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + + /// + /// User key associated with the access grant. + /// + [JsonPropertyName("user_key")] + public string? UserKey { get; init; } + } + + public sealed record PushDataRequestResidents + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// Your unique identifier for the resident. + /// + [JsonPropertyName("resident_key")] + public string? ResidentKey { get; init; } + } + + public sealed record PushDataRequestRooms + { + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("parent_site_key")] + public string? ParentSiteKey { get; init; } + + /// + /// Your unique identifier for the room. + /// + [JsonPropertyName("room_key")] + public string? RoomKey { get; init; } + } + + public sealed record PushDataRequestSites + { + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("site_key")] + public string? SiteKey { get; init; } + } + + public sealed record PushDataRequestSpaces + { + /// + /// Reservation/stay-related defaults for the space (time zone, default check-in/out times, address). + /// + [JsonPropertyName("customer_data")] + public PushDataRequestSpacesCustomerData? CustomerData { get; init; } + + /// + /// Default duration of this space in minutes, when the space represents a fixed-length bookable slot (e.g. an appointment type). Used to interpret reservations booked against this space. + /// + [JsonPropertyName("duration_minutes")] + public int? DurationMinutes { get; init; } + + /// + /// Geographic coordinates (latitude and longitude) of the space. + /// + [JsonPropertyName("geolocation")] + public PushDataRequestSpacesGeolocation? Geolocation { get; init; } + + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("parent_site_key")] + public string? ParentSiteKey { get; init; } + + /// + /// Your unique identifier for the space. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + } + + public sealed record PushDataRequestSpacesCustomerData + { + /// + /// Postal address for the space. + /// + [JsonPropertyName("address")] + public Optional Address { get; init; } + + /// + /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkin_time")] + public Optional DefaultCheckinTime { get; init; } + + /// + /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkout_time")] + public Optional DefaultCheckoutTime { get; init; } + + /// + /// IANA time zone for the space, e.g. America/Los_Angeles. + /// + [JsonPropertyName("time_zone")] + public Optional TimeZone { get; init; } + } + + public sealed record PushDataRequestSpacesGeolocation + { + /// + /// Latitude of the space, in decimal degrees. + /// + [JsonPropertyName("latitude")] + public float? Latitude { get; init; } + + /// + /// Longitude of the space, in decimal degrees. + /// + [JsonPropertyName("longitude")] + public float? Longitude { get; init; } + } + + public sealed record PushDataRequestStaffMembers + { + /// + /// List of unique identifiers for the buildings the staff member is associated with. + /// + [JsonPropertyName("building_keys")] + public List? BuildingKeys { get; init; } + + /// + /// List of unique identifiers for the common areas the staff member is associated with. + /// + [JsonPropertyName("common_area_keys")] + public List? CommonAreaKeys { get; init; } + + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// List of unique identifiers for the facilities the staff member is associated with. + /// + [JsonPropertyName("facility_keys")] + public List? FacilityKeys { get; init; } + + /// + /// List of unique identifiers for the listings the staff member is associated with. + /// + [JsonPropertyName("listing_keys")] + public List? ListingKeys { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// List of unique identifiers for the properties the staff member is associated with. + /// + [JsonPropertyName("property_keys")] + public List? PropertyKeys { get; init; } + + /// + /// List of unique identifiers for the property listings the staff member is associated with. + /// + [JsonPropertyName("property_listing_keys")] + public List? PropertyListingKeys { get; init; } + + /// + /// List of unique identifiers for the rooms the staff member is associated with. + /// + [JsonPropertyName("room_keys")] + public List? RoomKeys { get; init; } + + /// + /// List of unique identifiers for the sites the staff member is associated with. + /// + [JsonPropertyName("site_keys")] + public List? SiteKeys { get; init; } + + /// + /// List of unique identifiers for the spaces the staff member is associated with. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + /// + /// Your unique identifier for the staff. + /// + [JsonPropertyName("staff_member_key")] + public string? StaffMemberKey { get; init; } + + /// + /// List of unique identifiers for the units the staff member is associated with. + /// + [JsonPropertyName("unit_keys")] + public List? UnitKeys { get; init; } + } + + public sealed record PushDataRequestTenants + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// Your unique identifier for the tenant. + /// + [JsonPropertyName("tenant_key")] + public string? TenantKey { get; init; } + } + + public sealed record PushDataRequestUnits + { + /// + /// Your display name for this location resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Your unique identifier for the site. + /// + [JsonPropertyName("parent_site_key")] + public string? ParentSiteKey { get; init; } + + /// + /// Your unique identifier for the unit. + /// + [JsonPropertyName("unit_key")] + public string? UnitKey { get; init; } + } + + public sealed record PushDataRequestUserIdentities + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// Your unique identifier for the user identity. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + } + + public sealed record PushDataRequestUsers + { + /// + /// Email address associated with the user identity. + /// + [JsonPropertyName("email_address")] + public string? EmailAddress { get; init; } + + /// + /// Your display name for this user identity resource. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Phone number associated with the user identity. + /// + [JsonPropertyName("phone_number")] + public string? PhoneNumber { get; init; } + + /// + /// Your unique identifier for the user. + /// + [JsonPropertyName("user_key")] + public string? UserKey { get; init; } + } + + /// + /// Pushes customer data including resources like spaces, properties, rooms, users, etc. + /// + public async Task PushDataAsync( + PushDataRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Post, "/customers/push_data", request, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Api/Devices.cs b/src/Seam/Routes/Devices.cs similarity index 78% rename from src/Seam/Api/Devices.cs rename to src/Seam/Routes/Devices.cs index 777ce42a..44945763 100644 --- a/src/Seam/Api/Devices.cs +++ b/src/Seam/Routes/Devices.cs @@ -1,120 +1,68 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes { - public class Devices + public sealed class Devices { - private ISeamClient _seam; + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; - public Devices(ISeamClient seam) + internal Devices(SeamHttpTransport transport, ActionAttemptWait waitForActionAttemptDefault) { - _seam = seam; + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + Simulate = new DevicesSimulate(transport, waitForActionAttemptDefault); + Unmanaged = new DevicesUnmanaged(transport, waitForActionAttemptDefault); } + public DevicesSimulate Simulate { get; } + + public DevicesUnmanaged Unmanaged { get; } + /// /// Request parameters for Get a Device. /// - [DataContract(Name = "getRequest_request")] - public class GetRequest + public sealed record GetRequest { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest(string? deviceId = default, string? name = default) - { - DeviceId = deviceId; - Name = name; - } - /// /// ID of the device that you want to get. /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } /// /// Name of the device that you want to get. /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } + [JsonPropertyName("name")] + public string? Name { get; init; } - public override string ToString() + internal void Validate() { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) + if (DeviceId == null && Name == null) { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); + throw new ArgumentException( + "At least one parameter is required for /devices/get" + ); } - - return stringWriter.ToString(); } } - [DataContract(Name = "getResponse_response")] - public class GetResponse + public sealed record GetResponse { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(Device device = default) - { - Device = device; - } - /// /// OK /// - [DataMember(Name = "device", IsRequired = false, EmitDefaultValue = false)] - public Device Device { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified [device](https://docs.seam.co/core-concepts/devices). - /// - /// You must specify either `device_id` or `name`. - /// - public Device Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/devices/get", requestOptions) - .EnsureData("/devices/get") - .Device; + [JsonPropertyName("device")] + public Device? Device { get; init; } } /// @@ -122,85 +70,28 @@ public Device Get(GetRequest request) /// /// You must specify either `device_id` or `name`. /// - public Device Get(string? deviceId = default, string? name = default) - { - return Get(new GetRequest(deviceId: deviceId, name: name)); - } - - /// - /// Returns a specified [device](https://docs.seam.co/core-concepts/devices). - /// - /// You must specify either `device_id` or `name`. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/devices/get", requestOptions)) - .EnsureData("/devices/get") - .Device; - } - - /// - /// Returns a specified [device](https://docs.seam.co/core-concepts/devices). - /// - /// You must specify either `device_id` or `name`. - /// - public async Task GetAsync(string? deviceId = default, string? name = default) + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) { - return (await GetAsync(new GetRequest(deviceId: deviceId, name: name))); + request.Validate(); + var response = await _transport + .SendAsync(HttpMethod.Get, "/devices/get", request, cancellationToken) + .ConfigureAwait(false); + return response.Device + ?? throw new HttpRequestException("Seam returned no device for /devices/get"); } /// /// Request parameters for List Devices. /// - [DataContract(Name = "listRequest_request")] - public class ListRequest + public sealed record ListRequest { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? connectWebviewId = default, - string? connectedAccountId = default, - List? connectedAccountIds = default, - string? createdBefore = default, - object? customMetadataHas = default, - string? customerKey = default, - List? deviceIds = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - float? limit = default, - ListRequest.ManufacturerEnum? manufacturer = default, - string? pageCursor = default, - string? search = default, - string? spaceId = default, - string? unstableLocationId = default, - string? userIdentifierKey = default - ) - { - ConnectWebviewId = connectWebviewId; - ConnectedAccountId = connectedAccountId; - ConnectedAccountIds = connectedAccountIds; - CreatedBefore = createdBefore; - CustomMetadataHas = customMetadataHas; - CustomerKey = customerKey; - DeviceIds = deviceIds; - DeviceType = deviceType; - DeviceTypes = deviceTypes; - Limit = limit; - Manufacturer = manufacturer; - PageCursor = pageCursor; - Search = search; - SpaceId = spaceId; - UnstableLocationId = unstableLocationId; - UserIdentifierKey = userIdentifierKey; - } - /// /// Device type for which you want to list devices. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum DeviceTypeEnum { [EnumMember(Value = "unrecognized")] @@ -339,7 +230,7 @@ public enum DeviceTypeEnum /// /// Array of device types for which you want to list devices. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum DeviceTypesEnum { [EnumMember(Value = "unrecognized")] @@ -478,7 +369,7 @@ public enum DeviceTypesEnum /// /// Manufacturer for which you want to list devices. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum ManufacturerEnum { [EnumMember(Value = "unrecognized")] @@ -644,301 +535,182 @@ public enum ManufacturerEnum /// /// ID of the Connect Webview for which you want to list devices. /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectWebviewId { get; set; } + [JsonPropertyName("connect_webview_id")] + public string? ConnectWebviewId { get; init; } /// /// ID of the connected account for which you want to list devices. /// - [DataMember( - Name = "connected_account_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectedAccountId { get; set; } + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } /// /// Array of IDs of the connected accounts for which you want to list devices. /// - [DataMember( - Name = "connected_account_ids", - IsRequired = false, - EmitDefaultValue = false - )] - public List? ConnectedAccountIds { get; set; } + [JsonPropertyName("connected_account_ids")] + public List? ConnectedAccountIds { get; init; } /// /// Timestamp by which to limit returned devices. Returns devices created before this timestamp. /// - [DataMember(Name = "created_before", IsRequired = false, EmitDefaultValue = false)] - public string? CreatedBefore { get; set; } + [JsonPropertyName("created_before")] + public string? CreatedBefore { get; init; } /// /// Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. /// - [DataMember(Name = "custom_metadata_has", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadataHas { get; set; } + [JsonPropertyName("custom_metadata_has")] + public object? CustomMetadataHas { get; init; } /// /// Customer key for which you want to list devices. /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } /// /// Array of device IDs for which you want to list devices. /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceIds { get; set; } + [JsonPropertyName("device_ids")] + public List? DeviceIds { get; init; } /// /// Device type for which you want to list devices. /// - [DataMember(Name = "device_type", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.DeviceTypeEnum? DeviceType { get; set; } + [JsonPropertyName("device_type")] + public ListRequest.DeviceTypeEnum? DeviceType { get; init; } /// /// Array of device types for which you want to list devices. /// - [DataMember(Name = "device_types", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceTypes { get; set; } + [JsonPropertyName("device_types")] + public List? DeviceTypes { get; init; } /// /// Numerical limit on the number of devices to return. /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } + [JsonPropertyName("limit")] + public float? Limit { get; init; } /// /// Manufacturer for which you want to list devices. /// - [DataMember(Name = "manufacturer", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.ManufacturerEnum? Manufacturer { get; set; } + [JsonPropertyName("manufacturer")] + public ListRequest.ManufacturerEnum? Manufacturer { get; init; } /// /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. /// - [DataMember(Name = "page_cursor", IsRequired = false, EmitDefaultValue = false)] - public string? PageCursor { get; set; } + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } /// /// String for which to search. Filters returned devices to include all records that satisfy a partial match using `device_id` (full or partial UUID prefix, minimum 4 characters), `connected_account_id`, `display_name`, `custom_metadata` or `location.location_name`. /// - [DataMember(Name = "search", IsRequired = false, EmitDefaultValue = false)] - public string? Search { get; set; } + [JsonPropertyName("search")] + public string? Search { get; init; } /// /// ID of the space for which you want to list devices. /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceId { get; set; } + [JsonPropertyName("space_id")] + public string? SpaceId { get; init; } [Obsolete("Use `space_id`.")] - [DataMember( - Name = "unstable_location_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? UnstableLocationId { get; set; } + [JsonPropertyName("unstable_location_id")] + public Optional UnstableLocationId { get; init; } /// /// Your own internal user ID for the user for which you want to list devices. /// - [DataMember(Name = "user_identifier_key", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentifierKey { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } } - [DataContract(Name = "listResponse_response")] - public class ListResponse + public sealed record ListResponse { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List devices = default) - { - Devices = devices; - } - /// /// OK /// - [DataMember(Name = "devices", IsRequired = false, EmitDefaultValue = false)] - public List Devices { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); + [JsonPropertyName("devices")] + public List? Devices { get; init; } - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all [devices](https://docs.seam.co/core-concepts/devices). - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/devices/list", requestOptions) - .EnsureData("/devices/list") - .Devices; + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } } /// /// Returns a list of all [devices](https://docs.seam.co/core-concepts/devices). /// - public List List( - string? connectWebviewId = default, - string? connectedAccountId = default, - List? connectedAccountIds = default, - string? createdBefore = default, - object? customMetadataHas = default, - string? customerKey = default, - List? deviceIds = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - float? limit = default, - ListRequest.ManufacturerEnum? manufacturer = default, - string? pageCursor = default, - string? search = default, - string? spaceId = default, - string? unstableLocationId = default, - string? userIdentifierKey = default + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default ) { - return List( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - connectedAccountIds: connectedAccountIds, - createdBefore: createdBefore, - customMetadataHas: customMetadataHas, - customerKey: customerKey, - deviceIds: deviceIds, - deviceType: deviceType, - deviceTypes: deviceTypes, - limit: limit, - manufacturer: manufacturer, - pageCursor: pageCursor, - search: search, - spaceId: spaceId, - unstableLocationId: unstableLocationId, - userIdentifierKey: userIdentifierKey + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/devices/list", + request, + cancellationToken ) - ); + .ConfigureAwait(false); + return response.Devices + ?? throw new HttpRequestException("Seam returned no devices for /devices/list"); } - /// - /// Returns a list of all [devices](https://docs.seam.co/core-concepts/devices). - /// - public async Task> ListAsync(ListRequest request) + /// Fetches one page of /devices/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/devices/list", requestOptions)) - .EnsureData("/devices/list") - .Devices; + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/devices/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.Devices + ?? throw new HttpRequestException("Seam returned no devices for /devices/list"); + var pagination = + response.Pagination + ?? throw new HttpRequestException("Seam returned no pagination for /devices/list"); + return new SeamPage(items, pagination); } - /// - /// Returns a list of all [devices](https://docs.seam.co/core-concepts/devices). - /// - public async Task> ListAsync( - string? connectWebviewId = default, - string? connectedAccountId = default, - List? connectedAccountIds = default, - string? createdBefore = default, - object? customMetadataHas = default, - string? customerKey = default, - List? deviceIds = default, - ListRequest.DeviceTypeEnum? deviceType = default, - List? deviceTypes = default, - float? limit = default, - ListRequest.ManufacturerEnum? manufacturer = default, - string? pageCursor = default, - string? search = default, - string? spaceId = default, - string? unstableLocationId = default, - string? userIdentifierKey = default - ) + /// Creates a paginator over /devices/list. + public SeamPaginator ListPager(ListRequest? request = null) { - return ( - await ListAsync( - new ListRequest( - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - connectedAccountIds: connectedAccountIds, - createdBefore: createdBefore, - customMetadataHas: customMetadataHas, - customerKey: customerKey, - deviceIds: deviceIds, - deviceType: deviceType, - deviceTypes: deviceTypes, - limit: limit, - manufacturer: manufacturer, - pageCursor: pageCursor, - search: search, - spaceId: spaceId, - unstableLocationId: unstableLocationId, - userIdentifierKey: userIdentifierKey + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken ) - ) ); } /// /// Request parameters for List Device Providers. /// - [DataContract(Name = "listDeviceProvidersRequest_request")] - public class ListDeviceProvidersRequest + public sealed record ListDeviceProvidersRequest { - [JsonConstructorAttribute] - protected ListDeviceProvidersRequest() { } - - public ListDeviceProvidersRequest( - ListDeviceProvidersRequest.ProviderCategoryEnum? providerCategory = default - ) - { - ProviderCategory = providerCategory; - } - /// /// Category for which you want to list providers. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum ProviderCategoryEnum { [EnumMember(Value = "unrecognized")] @@ -972,97 +744,17 @@ public enum ProviderCategoryEnum /// /// Category for which you want to list providers. /// - [DataMember(Name = "provider_category", IsRequired = false, EmitDefaultValue = false)] - public ListDeviceProvidersRequest.ProviderCategoryEnum? ProviderCategory { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("provider_category")] + public ListDeviceProvidersRequest.ProviderCategoryEnum? ProviderCategory { get; init; } } - [DataContract(Name = "listDeviceProvidersResponse_response")] - public class ListDeviceProvidersResponse + public sealed record ListDeviceProvidersResponse { - [JsonConstructorAttribute] - protected ListDeviceProvidersResponse() { } - - public ListDeviceProvidersResponse(List deviceProviders = default) - { - DeviceProviders = deviceProviders; - } - /// /// OK /// - [DataMember(Name = "device_providers", IsRequired = false, EmitDefaultValue = false)] - public List DeviceProviders { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all device providers. - /// - /// The information that this endpoint returns for each provider includes a set of [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags), such as `device_provider.can_remotely_unlock`. If at least one supported device from a provider has a specific capability, the corresponding capability flag is `true`. - /// - /// When you create a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews), you can customize the providers—that is, the brands—that it displays. In the `/connect_webviews/create` request, include the desired set of device provider keys in the `accepted_providers` parameter. See also [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). - /// - public List ListDeviceProviders(ListDeviceProvidersRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/devices/list_device_providers", requestOptions) - .EnsureData("/devices/list_device_providers") - .DeviceProviders; - } - - /// - /// Returns a list of all device providers. - /// - /// The information that this endpoint returns for each provider includes a set of [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags), such as `device_provider.can_remotely_unlock`. If at least one supported device from a provider has a specific capability, the corresponding capability flag is `true`. - /// - /// When you create a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews), you can customize the providers—that is, the brands—that it displays. In the `/connect_webviews/create` request, include the desired set of device provider keys in the `accepted_providers` parameter. See also [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). - /// - public List ListDeviceProviders( - ListDeviceProvidersRequest.ProviderCategoryEnum? providerCategory = default - ) - { - return ListDeviceProviders( - new ListDeviceProvidersRequest(providerCategory: providerCategory) - ); + [JsonPropertyName("device_providers")] + public List? DeviceProviders { get; init; } } /// @@ -1073,161 +765,69 @@ public List ListDeviceProviders( /// When you create a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews), you can customize the providers—that is, the brands—that it displays. In the `/connect_webviews/create` request, include the desired set of device provider keys in the `accepted_providers` parameter. See also [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). /// public async Task> ListDeviceProvidersAsync( - ListDeviceProvidersRequest request + ListDeviceProvidersRequest? request = null, + CancellationToken cancellationToken = default ) { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return ( - await _seam.GetAsync( + var response = await _transport + .SendAsync( + HttpMethod.Get, "/devices/list_device_providers", - requestOptions - ) - ) - .EnsureData("/devices/list_device_providers") - .DeviceProviders; - } - - /// - /// Returns a list of all device providers. - /// - /// The information that this endpoint returns for each provider includes a set of [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags), such as `device_provider.can_remotely_unlock`. If at least one supported device from a provider has a specific capability, the corresponding capability flag is `true`. - /// - /// When you create a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews), you can customize the providers—that is, the brands—that it displays. In the `/connect_webviews/create` request, include the desired set of device provider keys in the `accepted_providers` parameter. See also [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). - /// - public async Task> ListDeviceProvidersAsync( - ListDeviceProvidersRequest.ProviderCategoryEnum? providerCategory = default - ) - { - return ( - await ListDeviceProvidersAsync( - new ListDeviceProvidersRequest(providerCategory: providerCategory) + request, + cancellationToken ) - ); + .ConfigureAwait(false); + return response.DeviceProviders + ?? throw new HttpRequestException( + "Seam returned no device_providers for /devices/list_device_providers" + ); } /// /// Request parameters for Report Provider Metadata. /// - [DataContract(Name = "reportProviderMetadataRequest_request")] - public class ReportProviderMetadataRequest + public sealed record ReportProviderMetadataRequest { - [JsonConstructorAttribute] - protected ReportProviderMetadataRequest() { } - - public ReportProviderMetadataRequest( - List devices = default - ) - { - Devices = devices; - } - /// /// Array of devices with provider metadata to update /// - [DataMember(Name = "devices", IsRequired = true, EmitDefaultValue = false)] - public List Devices { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("devices")] + public required List Devices { get; init; } } - [DataContract(Name = "reportProviderMetadataRequestDevices_model")] - public class ReportProviderMetadataRequestDevices + public sealed record ReportProviderMetadataRequestDevices { - [JsonConstructorAttribute] - protected ReportProviderMetadataRequestDevices() { } - - public ReportProviderMetadataRequestDevices( - string? deviceId = default, - ReportProviderMetadataRequestDevicesOmnitecMetadata? omnitecMetadata = default, - ReportProviderMetadataRequestDevicesSchlageMetadata? schlageMetadata = default, - ReportProviderMetadataRequestDevicesUltraloqMetadata? ultraloqMetadata = default - ) - { - DeviceId = deviceId; - OmnitecMetadata = omnitecMetadata; - SchlageMetadata = schlageMetadata; - UltraloqMetadata = ultraloqMetadata; - } - /// /// ID of the device to update /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } /// /// Omnitec-specific metadata to update /// - [DataMember(Name = "omnitec_metadata", IsRequired = false, EmitDefaultValue = false)] - public ReportProviderMetadataRequestDevicesOmnitecMetadata? OmnitecMetadata { get; set; } + [JsonPropertyName("omnitec_metadata")] + public ReportProviderMetadataRequestDevicesOmnitecMetadata? OmnitecMetadata { get; init; } /// /// Schlage-specific metadata to update /// - [DataMember(Name = "schlage_metadata", IsRequired = false, EmitDefaultValue = false)] - public ReportProviderMetadataRequestDevicesSchlageMetadata? SchlageMetadata { get; set; } + [JsonPropertyName("schlage_metadata")] + public ReportProviderMetadataRequestDevicesSchlageMetadata? SchlageMetadata { get; init; } /// /// Ultraloq-specific metadata to update /// - [DataMember(Name = "ultraloq_metadata", IsRequired = false, EmitDefaultValue = false)] - public ReportProviderMetadataRequestDevicesUltraloqMetadata? UltraloqMetadata { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("ultraloq_metadata")] + public ReportProviderMetadataRequestDevicesUltraloqMetadata? UltraloqMetadata { get; init; } } - [DataContract(Name = "reportProviderMetadataRequestDevicesOmnitecMetadata_model")] - public class ReportProviderMetadataRequestDevicesOmnitecMetadata + public sealed record ReportProviderMetadataRequestDevicesOmnitecMetadata { - [JsonConstructorAttribute] - protected ReportProviderMetadataRequestDevicesOmnitecMetadata() { } - - public ReportProviderMetadataRequestDevicesOmnitecMetadata( - ReportProviderMetadataRequestDevicesOmnitecMetadata.TimeZoneEnum? timeZone = default - ) - { - TimeZone = timeZone; - } - /// /// IANA timezone for the Omnitec device /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum TimeZoneEnum { [EnumMember(Value = "unrecognized")] @@ -2524,46 +2124,16 @@ public enum TimeZoneEnum /// /// IANA timezone for the Omnitec device /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public ReportProviderMetadataRequestDevicesOmnitecMetadata.TimeZoneEnum? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("time_zone")] + public ReportProviderMetadataRequestDevicesOmnitecMetadata.TimeZoneEnum? TimeZone { get; init; } } - [DataContract(Name = "reportProviderMetadataRequestDevicesSchlageMetadata_model")] - public class ReportProviderMetadataRequestDevicesSchlageMetadata + public sealed record ReportProviderMetadataRequestDevicesSchlageMetadata { - [JsonConstructorAttribute] - protected ReportProviderMetadataRequestDevicesSchlageMetadata() { } - - public ReportProviderMetadataRequestDevicesSchlageMetadata( - ReportProviderMetadataRequestDevicesSchlageMetadata.TimeZoneEnum? timeZone = default - ) - { - TimeZone = timeZone; - } - /// /// IANA timezone for the Schlage device /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum TimeZoneEnum { [EnumMember(Value = "unrecognized")] @@ -3860,47 +3430,16 @@ public enum TimeZoneEnum /// /// IANA timezone for the Schlage device /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public ReportProviderMetadataRequestDevicesSchlageMetadata.TimeZoneEnum? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("time_zone")] + public ReportProviderMetadataRequestDevicesSchlageMetadata.TimeZoneEnum? TimeZone { get; init; } } - [DataContract(Name = "reportProviderMetadataRequestDevicesUltraloqMetadata_model")] - public class ReportProviderMetadataRequestDevicesUltraloqMetadata + public sealed record ReportProviderMetadataRequestDevicesUltraloqMetadata { - [JsonConstructorAttribute] - protected ReportProviderMetadataRequestDevicesUltraloqMetadata() { } - - public ReportProviderMetadataRequestDevicesUltraloqMetadata( - ReportProviderMetadataRequestDevicesUltraloqMetadata.TimeZoneEnum? timeZone = - default - ) - { - TimeZone = timeZone; - } - /// /// IANA timezone for the Ultraloq device /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum TimeZoneEnum { [EnumMember(Value = "unrecognized")] @@ -5197,237 +4736,74 @@ public enum TimeZoneEnum /// /// IANA timezone for the Ultraloq device /// - [DataMember(Name = "time_zone", IsRequired = false, EmitDefaultValue = false)] - public ReportProviderMetadataRequestDevicesUltraloqMetadata.TimeZoneEnum? TimeZone { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates provider-specific metadata for devices. - /// - public void ReportProviderMetadata(ReportProviderMetadataRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Post("/devices/report_provider_metadata", requestOptions); - } - - /// - /// Updates provider-specific metadata for devices. - /// - public void ReportProviderMetadata( - List devices = default - ) - { - ReportProviderMetadata(new ReportProviderMetadataRequest(devices: devices)); - } - - /// - /// Updates provider-specific metadata for devices. - /// - public async Task ReportProviderMetadataAsync(ReportProviderMetadataRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PostAsync("/devices/report_provider_metadata", requestOptions); + [JsonPropertyName("time_zone")] + public ReportProviderMetadataRequestDevicesUltraloqMetadata.TimeZoneEnum? TimeZone { get; init; } } /// /// Updates provider-specific metadata for devices. /// public async Task ReportProviderMetadataAsync( - List devices = default + ReportProviderMetadataRequest request, + CancellationToken cancellationToken = default ) { - await ReportProviderMetadataAsync(new ReportProviderMetadataRequest(devices: devices)); + await _transport + .SendAsync( + HttpMethod.Post, + "/devices/report_provider_metadata", + request, + cancellationToken + ) + .ConfigureAwait(false); } /// /// Request parameters for Update a Device. /// - [DataContract(Name = "updateRequest_request")] - public class UpdateRequest + public sealed record UpdateRequest { - [JsonConstructorAttribute] - protected UpdateRequest() { } - - public UpdateRequest( - bool? backupAccessCodePoolEnabled = default, - object? customMetadata = default, - string deviceId = default, - bool? isManaged = default, - string? name = default, - UpdateRequestProperties? properties = default - ) - { - BackupAccessCodePoolEnabled = backupAccessCodePoolEnabled; - CustomMetadata = customMetadata; - DeviceId = deviceId; - IsManaged = isManaged; - Name = name; - Properties = properties; - } - /// /// Indicates whether the device's [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) is enabled. Set to `false` to disable the pool: Seam stops refilling it and removes any backup codes that have not yet been pulled into active use. /// - [DataMember( - Name = "backup_access_code_pool_enabled", - IsRequired = false, - EmitDefaultValue = false - )] - public bool? BackupAccessCodePoolEnabled { get; set; } + [JsonPropertyName("backup_access_code_pool_enabled")] + public bool? BackupAccessCodePoolEnabled { get; init; } /// /// Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter devices by the desired metadata](https://docs.seam.co/core-concepts/devices/filtering-devices-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata. /// - [DataMember(Name = "custom_metadata", IsRequired = false, EmitDefaultValue = false)] - public object? CustomMetadata { get; set; } + [JsonPropertyName("custom_metadata")] + public object? CustomMetadata { get; init; } /// /// ID of the device that you want to update. /// - [DataMember(Name = "device_id", IsRequired = true, EmitDefaultValue = false)] - public string DeviceId { get; set; } + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } /// /// Indicates whether the device is managed. To unmanage a device, set `is_managed` to `false`. /// - [DataMember(Name = "is_managed", IsRequired = false, EmitDefaultValue = false)] - public bool? IsManaged { get; set; } + [JsonPropertyName("is_managed")] + public bool? IsManaged { get; init; } /// /// Name for the device. /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - [DataMember(Name = "properties", IsRequired = false, EmitDefaultValue = false)] - public UpdateRequestProperties? Properties { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); + [JsonPropertyName("name")] + public Optional Name { get; init; } - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } + [JsonPropertyName("properties")] + public UpdateRequestProperties? Properties { get; init; } } - [DataContract(Name = "updateRequestProperties_model")] - public class UpdateRequestProperties + public sealed record UpdateRequestProperties { - [JsonConstructorAttribute] - protected UpdateRequestProperties() { } - - public UpdateRequestProperties(string? name = default) - { - Name = name; - } - /// /// Name for the device. /// - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] - public string? Name { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Updates a specified [device](https://docs.seam.co/core-concepts/devices). - /// - /// You can add or change [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for a device, change the device's name, or [convert a managed device to unmanaged](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - public void Update(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - _seam.Patch("/devices/update", requestOptions); - } - - /// - /// Updates a specified [device](https://docs.seam.co/core-concepts/devices). - /// - /// You can add or change [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for a device, change the device's name, or [convert a managed device to unmanaged](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - public void Update( - bool? backupAccessCodePoolEnabled = default, - object? customMetadata = default, - string deviceId = default, - bool? isManaged = default, - string? name = default, - UpdateRequestProperties? properties = default - ) - { - Update( - new UpdateRequest( - backupAccessCodePoolEnabled: backupAccessCodePoolEnabled, - customMetadata: customMetadata, - deviceId: deviceId, - isManaged: isManaged, - name: name, - properties: properties - ) - ); - } - - /// - /// Updates a specified [device](https://docs.seam.co/core-concepts/devices). - /// - /// You can add or change [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for a device, change the device's name, or [convert a managed device to unmanaged](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - /// - public async Task UpdateAsync(UpdateRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - await _seam.PatchAsync("/devices/update", requestOptions); + [JsonPropertyName("name")] + public Optional Name { get; init; } } /// @@ -5436,37 +4812,13 @@ public async Task UpdateAsync(UpdateRequest request) /// You can add or change [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for a device, change the device's name, or [convert a managed device to unmanaged](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). /// public async Task UpdateAsync( - bool? backupAccessCodePoolEnabled = default, - object? customMetadata = default, - string deviceId = default, - bool? isManaged = default, - string? name = default, - UpdateRequestProperties? properties = default + UpdateRequest request, + CancellationToken cancellationToken = default ) { - await UpdateAsync( - new UpdateRequest( - backupAccessCodePoolEnabled: backupAccessCodePoolEnabled, - customMetadata: customMetadata, - deviceId: deviceId, - isManaged: isManaged, - name: name, - properties: properties - ) - ); + await _transport + .SendAsync(HttpMethod.Patch, "/devices/update", request, cancellationToken) + .ConfigureAwait(false); } } } - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.Devices Devices => new(this); - } - - public partial interface ISeamClient - { - public Api.Devices Devices { get; } - } -} diff --git a/src/Seam/Routes/DevicesSimulate.cs b/src/Seam/Routes/DevicesSimulate.cs new file mode 100644 index 00000000..e5e1ef29 --- /dev/null +++ b/src/Seam/Routes/DevicesSimulate.cs @@ -0,0 +1,207 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class DevicesSimulate + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal DevicesSimulate( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Simulate Device Connection. + /// + public sealed record ConnectRequest + { + /// + /// ID of the device that you want to simulate connecting to Seam. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + /// + /// Simulates connecting a device to Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). + /// + public async Task ConnectAsync( + ConnectRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Post, "/devices/simulate/connect", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Simulate Hub Connection. + /// + public sealed record ConnectToHubRequest + { + /// + /// ID of the device whose hub you want to reconnect. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + /// + /// Simulates bringing the Wi‑Fi hub (bridge) back online for a device. + /// Only applicable for sandbox workspaces and currently + /// implemented for August and TTLock locks. + /// This will clear the `hub_disconnected` error on the device. + /// + public async Task ConnectToHubAsync( + ConnectToHubRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/devices/simulate/connect_to_hub", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Simulate Device Disconnection. + /// + public sealed record DisconnectRequest + { + /// + /// ID of the device that you want to simulate disconnecting from Seam. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + /// + /// Simulates disconnecting a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). + /// + public async Task DisconnectAsync( + DisconnectRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/devices/simulate/disconnect", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Simulate Hub Disconnection. + /// + public sealed record DisconnectFromHubRequest + { + /// + /// ID of the device whose hub you want to disconnect. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + /// + /// Simulates taking the Wi‑Fi hub (bridge) offline for a device. + /// Only applicable for sandbox workspaces and currently + /// implemented for August, TTLock, and IglooHome devices. + /// This will set the `hub_disconnected` error on the device, or mark the + /// IglooHome bridge offline in sandbox. + /// + public async Task DisconnectFromHubAsync( + DisconnectFromHubRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/devices/simulate/disconnect_from_hub", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Simulate Paid Subscription. + /// + public sealed record PaidSubscriptionRequest + { + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + [JsonPropertyName("is_expired")] + public required bool IsExpired { get; init; } + } + + /// + /// Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only). + /// Send `is_expired: true` to simulate an expired subscription, or `false` to simulate an active subscription. + /// The actual device error is created/cleared by the poller after this state change. + /// + public async Task PaidSubscriptionAsync( + PaidSubscriptionRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/devices/simulate/paid_subscription", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Simulate Device Removal. + /// + public sealed record RemoveRequest + { + /// + /// ID of the device that you want to simulate removing from Seam. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + /// + /// Simulates removing a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). + /// + public async Task RemoveAsync( + RemoveRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Post, "/devices/simulate/remove", request, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/DevicesUnmanaged.cs b/src/Seam/Routes/DevicesUnmanaged.cs new file mode 100644 index 00000000..5ebdfed7 --- /dev/null +++ b/src/Seam/Routes/DevicesUnmanaged.cs @@ -0,0 +1,741 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class DevicesUnmanaged + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal DevicesUnmanaged( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Get an Unmanaged Device. + /// + public sealed record GetRequest + { + /// + /// ID of the unmanaged device that you want to get. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Name of the unmanaged device that you want to get. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + internal void Validate() + { + if (DeviceId == null && Name == null) + { + throw new ArgumentException( + "At least one parameter is required for /devices/unmanaged/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("device")] + public UnmanagedDevice? Device { get; init; } + } + + /// + /// Returns a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). + /// + /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). + /// + /// You must specify either `device_id` or `name`. + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/devices/unmanaged/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Device + ?? throw new HttpRequestException( + "Seam returned no device for /devices/unmanaged/get" + ); + } + + /// + /// Request parameters for List Unmanaged Devices. + /// + public sealed record ListRequest + { + /// + /// Device type for which you want to list devices. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "akuvox_lock")] + AkuvoxLock = 1, + + [EnumMember(Value = "august_lock")] + AugustLock = 2, + + [EnumMember(Value = "brivo_access_point")] + BrivoAccessPoint = 3, + + [EnumMember(Value = "butterflymx_panel")] + ButterflymxPanel = 4, + + [EnumMember(Value = "avigilon_alta_entry")] + AvigilonAltaEntry = 5, + + [EnumMember(Value = "doorking_lock")] + DoorkingLock = 6, + + [EnumMember(Value = "genie_door")] + GenieDoor = 7, + + [EnumMember(Value = "igloo_lock")] + IglooLock = 8, + + [EnumMember(Value = "linear_lock")] + LinearLock = 9, + + [EnumMember(Value = "lockly_lock")] + LocklyLock = 10, + + [EnumMember(Value = "kwikset_lock")] + KwiksetLock = 11, + + [EnumMember(Value = "nuki_lock")] + NukiLock = 12, + + [EnumMember(Value = "salto_lock")] + SaltoLock = 13, + + [EnumMember(Value = "schlage_lock")] + SchlageLock = 14, + + [EnumMember(Value = "smartthings_lock")] + SmartthingsLock = 15, + + [EnumMember(Value = "wyze_lock")] + WyzeLock = 16, + + [EnumMember(Value = "yale_lock")] + YaleLock = 17, + + [EnumMember(Value = "two_n_intercom")] + TwoNIntercom = 18, + + [EnumMember(Value = "controlbyweb_device")] + ControlbywebDevice = 19, + + [EnumMember(Value = "ttlock_lock")] + TtlockLock = 20, + + [EnumMember(Value = "igloohome_lock")] + IgloohomeLock = 21, + + [EnumMember(Value = "four_suites_door")] + FourSuitesDoor = 22, + + [EnumMember(Value = "dormakaba_oracode_door")] + DormakabaOracodeDoor = 23, + + [EnumMember(Value = "tedee_lock")] + TedeeLock = 24, + + [EnumMember(Value = "akiles_lock")] + AkilesLock = 25, + + [EnumMember(Value = "ultraloq_lock")] + UltraloqLock = 26, + + [EnumMember(Value = "yacan_lock")] + YacanLock = 27, + + [EnumMember(Value = "keyincode_lock")] + KeyincodeLock = 28, + + [EnumMember(Value = "omnitec_lock")] + OmnitecLock = 29, + + [EnumMember(Value = "kisi_lock")] + KisiLock = 30, + + [EnumMember(Value = "aqara_lock")] + AqaraLock = 31, + + [EnumMember(Value = "keynest_key")] + KeynestKey = 32, + + [EnumMember(Value = "noiseaware_activity_zone")] + NoiseawareActivityZone = 33, + + [EnumMember(Value = "minut_sensor")] + MinutSensor = 34, + + [EnumMember(Value = "ecobee_thermostat")] + EcobeeThermostat = 35, + + [EnumMember(Value = "nest_thermostat")] + NestThermostat = 36, + + [EnumMember(Value = "honeywell_resideo_thermostat")] + HoneywellResideoThermostat = 37, + + [EnumMember(Value = "tado_thermostat")] + TadoThermostat = 38, + + [EnumMember(Value = "sensi_thermostat")] + SensiThermostat = 39, + + [EnumMember(Value = "smartthings_thermostat")] + SmartthingsThermostat = 40, + + [EnumMember(Value = "ios_phone")] + IosPhone = 41, + + [EnumMember(Value = "android_phone")] + AndroidPhone = 42, + + [EnumMember(Value = "ring_camera")] + RingCamera = 43, + } + + /// + /// Array of device types for which you want to list devices. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypesEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "akuvox_lock")] + AkuvoxLock = 1, + + [EnumMember(Value = "august_lock")] + AugustLock = 2, + + [EnumMember(Value = "brivo_access_point")] + BrivoAccessPoint = 3, + + [EnumMember(Value = "butterflymx_panel")] + ButterflymxPanel = 4, + + [EnumMember(Value = "avigilon_alta_entry")] + AvigilonAltaEntry = 5, + + [EnumMember(Value = "doorking_lock")] + DoorkingLock = 6, + + [EnumMember(Value = "genie_door")] + GenieDoor = 7, + + [EnumMember(Value = "igloo_lock")] + IglooLock = 8, + + [EnumMember(Value = "linear_lock")] + LinearLock = 9, + + [EnumMember(Value = "lockly_lock")] + LocklyLock = 10, + + [EnumMember(Value = "kwikset_lock")] + KwiksetLock = 11, + + [EnumMember(Value = "nuki_lock")] + NukiLock = 12, + + [EnumMember(Value = "salto_lock")] + SaltoLock = 13, + + [EnumMember(Value = "schlage_lock")] + SchlageLock = 14, + + [EnumMember(Value = "smartthings_lock")] + SmartthingsLock = 15, + + [EnumMember(Value = "wyze_lock")] + WyzeLock = 16, + + [EnumMember(Value = "yale_lock")] + YaleLock = 17, + + [EnumMember(Value = "two_n_intercom")] + TwoNIntercom = 18, + + [EnumMember(Value = "controlbyweb_device")] + ControlbywebDevice = 19, + + [EnumMember(Value = "ttlock_lock")] + TtlockLock = 20, + + [EnumMember(Value = "igloohome_lock")] + IgloohomeLock = 21, + + [EnumMember(Value = "four_suites_door")] + FourSuitesDoor = 22, + + [EnumMember(Value = "dormakaba_oracode_door")] + DormakabaOracodeDoor = 23, + + [EnumMember(Value = "tedee_lock")] + TedeeLock = 24, + + [EnumMember(Value = "akiles_lock")] + AkilesLock = 25, + + [EnumMember(Value = "ultraloq_lock")] + UltraloqLock = 26, + + [EnumMember(Value = "yacan_lock")] + YacanLock = 27, + + [EnumMember(Value = "keyincode_lock")] + KeyincodeLock = 28, + + [EnumMember(Value = "omnitec_lock")] + OmnitecLock = 29, + + [EnumMember(Value = "kisi_lock")] + KisiLock = 30, + + [EnumMember(Value = "aqara_lock")] + AqaraLock = 31, + + [EnumMember(Value = "keynest_key")] + KeynestKey = 32, + + [EnumMember(Value = "noiseaware_activity_zone")] + NoiseawareActivityZone = 33, + + [EnumMember(Value = "minut_sensor")] + MinutSensor = 34, + + [EnumMember(Value = "ecobee_thermostat")] + EcobeeThermostat = 35, + + [EnumMember(Value = "nest_thermostat")] + NestThermostat = 36, + + [EnumMember(Value = "honeywell_resideo_thermostat")] + HoneywellResideoThermostat = 37, + + [EnumMember(Value = "tado_thermostat")] + TadoThermostat = 38, + + [EnumMember(Value = "sensi_thermostat")] + SensiThermostat = 39, + + [EnumMember(Value = "smartthings_thermostat")] + SmartthingsThermostat = 40, + + [EnumMember(Value = "ios_phone")] + IosPhone = 41, + + [EnumMember(Value = "android_phone")] + AndroidPhone = 42, + + [EnumMember(Value = "ring_camera")] + RingCamera = 43, + } + + /// + /// Manufacturer for which you want to list devices. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ManufacturerEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "akuvox")] + Akuvox = 1, + + [EnumMember(Value = "august")] + August = 2, + + [EnumMember(Value = "avigilon_alta")] + AvigilonAlta = 3, + + [EnumMember(Value = "brivo")] + Brivo = 4, + + [EnumMember(Value = "butterflymx")] + Butterflymx = 5, + + [EnumMember(Value = "doorking")] + Doorking = 6, + + [EnumMember(Value = "four_suites")] + FourSuites = 7, + + [EnumMember(Value = "genie")] + Genie = 8, + + [EnumMember(Value = "igloo")] + Igloo = 9, + + [EnumMember(Value = "keywe")] + Keywe = 10, + + [EnumMember(Value = "kwikset")] + Kwikset = 11, + + [EnumMember(Value = "linear")] + Linear = 12, + + [EnumMember(Value = "lockly")] + Lockly = 13, + + [EnumMember(Value = "nuki")] + Nuki = 14, + + [EnumMember(Value = "philia")] + Philia = 15, + + [EnumMember(Value = "salto")] + Salto = 16, + + [EnumMember(Value = "samsung")] + Samsung = 17, + + [EnumMember(Value = "schlage")] + Schlage = 18, + + [EnumMember(Value = "seam")] + Seam = 19, + + [EnumMember(Value = "unknown")] + Unknown = 20, + + [EnumMember(Value = "wyze")] + Wyze = 21, + + [EnumMember(Value = "yale")] + Yale = 22, + + [EnumMember(Value = "two_n")] + TwoN = 23, + + [EnumMember(Value = "ttlock")] + Ttlock = 24, + + [EnumMember(Value = "igloohome")] + Igloohome = 25, + + [EnumMember(Value = "controlbyweb")] + Controlbyweb = 26, + + [EnumMember(Value = "dormakaba_oracode")] + DormakabaOracode = 27, + + [EnumMember(Value = "tedee")] + Tedee = 28, + + [EnumMember(Value = "keyincode")] + Keyincode = 29, + + [EnumMember(Value = "akiles")] + Akiles = 30, + + [EnumMember(Value = "aqara")] + Aqara = 31, + + [EnumMember(Value = "ecobee")] + Ecobee = 32, + + [EnumMember(Value = "honeywell_resideo")] + HoneywellResideo = 33, + + [EnumMember(Value = "keynest")] + Keynest = 34, + + [EnumMember(Value = "korelock")] + Korelock = 35, + + [EnumMember(Value = "minut")] + Minut = 36, + + [EnumMember(Value = "nest")] + Nest = 37, + + [EnumMember(Value = "noiseaware")] + Noiseaware = 38, + + [EnumMember(Value = "sensi")] + Sensi = 39, + + [EnumMember(Value = "smartthings")] + Smartthings = 40, + + [EnumMember(Value = "tado")] + Tado = 41, + + [EnumMember(Value = "ultraloq")] + Ultraloq = 42, + + [EnumMember(Value = "ring")] + Ring = 43, + + [EnumMember(Value = "ical")] + Ical = 44, + + [EnumMember(Value = "lodgify")] + Lodgify = 45, + + [EnumMember(Value = "hostaway")] + Hostaway = 46, + + [EnumMember(Value = "guesty")] + Guesty = 47, + + [EnumMember(Value = "acuity_scheduling")] + AcuityScheduling = 48, + + [EnumMember(Value = "omnitec")] + Omnitec = 49, + + [EnumMember(Value = "kisi")] + Kisi = 50, + + [EnumMember(Value = "slack")] + Slack = 51, + + [EnumMember(Value = "yacan")] + Yacan = 52, + } + + /// + /// ID of the Connect Webview for which you want to list devices. + /// + [JsonPropertyName("connect_webview_id")] + public string? ConnectWebviewId { get; init; } + + /// + /// ID of the connected account for which you want to list devices. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// Array of IDs of the connected accounts for which you want to list devices. + /// + [JsonPropertyName("connected_account_ids")] + public List? ConnectedAccountIds { get; init; } + + /// + /// Timestamp by which to limit returned devices. Returns devices created before this timestamp. + /// + [JsonPropertyName("created_before")] + public string? CreatedBefore { get; init; } + + /// + /// Customer key for which you want to list devices. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Array of device IDs for which you want to list devices. + /// + [JsonPropertyName("device_ids")] + public List? DeviceIds { get; init; } + + /// + /// Device type for which you want to list devices. + /// + [JsonPropertyName("device_type")] + public ListRequest.DeviceTypeEnum? DeviceType { get; init; } + + /// + /// Array of device types for which you want to list devices. + /// + [JsonPropertyName("device_types")] + public List? DeviceTypes { get; init; } + + /// + /// Numerical limit on the number of devices to return. + /// + [JsonPropertyName("limit")] + public float? Limit { get; init; } + + /// + /// Manufacturer for which you want to list devices. + /// + [JsonPropertyName("manufacturer")] + public ListRequest.ManufacturerEnum? Manufacturer { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned devices to include all records that satisfy a partial match using `device_id` (full or partial UUID prefix, minimum 4 characters), `connected_account_id`, `display_name`, `custom_metadata` or `location.location_name`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("devices")] + public List? Devices { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [unmanaged devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). + /// + /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/devices/unmanaged/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Devices + ?? throw new HttpRequestException( + "Seam returned no devices for /devices/unmanaged/list" + ); + } + + /// Fetches one page of /devices/unmanaged/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/devices/unmanaged/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.Devices + ?? throw new HttpRequestException( + "Seam returned no devices for /devices/unmanaged/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /devices/unmanaged/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /devices/unmanaged/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Update an Unmanaged Device. + /// + public sealed record UpdateRequest + { + /// + /// Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). Set a key to `null` or to an empty string to remove that key from the custom metadata. + /// + [JsonPropertyName("custom_metadata")] + public object? CustomMetadata { get; init; } + + /// + /// ID of the unmanaged device that you want to update. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Indicates whether the device is managed. Set this parameter to `true` to convert an unmanaged device to managed. + /// + [JsonPropertyName("is_managed")] + public bool? IsManaged { get; init; } + } + + /// + /// Updates a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). To convert an unmanaged device to managed, set `is_managed` to `true`. + /// + /// An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/devices/unmanaged/update", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Api/Events.cs b/src/Seam/Routes/Events.cs similarity index 60% rename from src/Seam/Api/Events.cs rename to src/Seam/Routes/Events.cs index 3f69e2f9..31cf2242 100644 --- a/src/Seam/Api/Events.cs +++ b/src/Seam/Routes/Events.cs @@ -1,245 +1,95 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. using System.Runtime.Serialization; -using System.Text; -using JsonSubTypes; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using Seam.Client; -using Seam.Model; - -namespace Seam.Api +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes { - public class Events + public sealed class Events { - private ISeamClient _seam; + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; - public Events(ISeamClient seam) + internal Events(SeamHttpTransport transport, ActionAttemptWait waitForActionAttemptDefault) { - _seam = seam; + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; } /// /// Request parameters for Get an Event. /// - [DataContract(Name = "getRequest_request")] - public class GetRequest + public sealed record GetRequest { - [JsonConstructorAttribute] - protected GetRequest() { } - - public GetRequest( - string? deviceId = default, - string? eventId = default, - string? eventType = default - ) - { - DeviceId = deviceId; - EventId = eventId; - EventType = eventType; - } - /// /// Unique identifier for the device that triggered the event that you want to get. /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } /// /// Unique identifier for the event that you want to get. /// - [DataMember(Name = "event_id", IsRequired = false, EmitDefaultValue = false)] - public string? EventId { get; set; } + [JsonPropertyName("event_id")] + public string? EventId { get; init; } /// /// Type of the event that you want to get. /// - [DataMember(Name = "event_type", IsRequired = false, EmitDefaultValue = false)] - public string? EventType { get; set; } + [JsonPropertyName("event_type")] + public string? EventType { get; init; } - public override string ToString() + internal void Validate() { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) + if (DeviceId == null && EventId == null && EventType == null) { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); + throw new ArgumentException( + "At least one parameter is required for /events/get" + ); } - - return stringWriter.ToString(); } } - [DataContract(Name = "getResponse_response")] - public class GetResponse + public sealed record GetResponse { - [JsonConstructorAttribute] - protected GetResponse() { } - - public GetResponse(Event event_ = default) - { - Event = event_; - } - /// /// OK /// - [DataMember(Name = "event", IsRequired = false, EmitDefaultValue = false)] - public Event Event { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to retrieve an event that already took place. - /// - public Event Get(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/events/get", requestOptions) - .EnsureData("/events/get") - .Event; - } - - /// - /// Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to retrieve an event that already took place. - /// - public Event Get( - string? deviceId = default, - string? eventId = default, - string? eventType = default - ) - { - return Get(new GetRequest(deviceId: deviceId, eventId: eventId, eventType: eventType)); - } - - /// - /// Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to retrieve an event that already took place. - /// - public async Task GetAsync(GetRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/events/get", requestOptions)) - .EnsureData("/events/get") - .Event; + [JsonPropertyName("event")] + public Event? Event { get; init; } } /// /// Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to retrieve an event that already took place. /// public async Task GetAsync( - string? deviceId = default, - string? eventId = default, - string? eventType = default + GetRequest request, + CancellationToken cancellationToken = default ) { - return ( - await GetAsync( - new GetRequest(deviceId: deviceId, eventId: eventId, eventType: eventType) - ) - ); + request.Validate(); + var response = await _transport + .SendAsync(HttpMethod.Get, "/events/get", request, cancellationToken) + .ConfigureAwait(false); + return response.Event + ?? throw new HttpRequestException("Seam returned no event for /events/get"); } /// /// Request parameters for List Events. /// - [DataContract(Name = "listRequest_request")] - public class ListRequest + public sealed record ListRequest { - [JsonConstructorAttribute] - protected ListRequest() { } - - public ListRequest( - string? accessCodeId = default, - List? accessCodeIds = default, - string? accessGrantId = default, - List? accessGrantIds = default, - string? accessMethodId = default, - List? accessMethodIds = default, - string? acsAccessGroupId = default, - string? acsCredentialId = default, - string? acsEncoderId = default, - string? acsEntranceId = default, - string? acsSystemId = default, - List? acsSystemIds = default, - string? acsUserId = default, - List? between = default, - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - string? deviceId = default, - List? deviceIds = default, - List? eventIds = default, - ListRequest.EventTypeEnum? eventType = default, - List? eventTypes = default, - float? limit = default, - string? since = default, - string? spaceId = default, - List? spaceIds = default, - float? unstableOffset = default, - string? userIdentityId = default - ) - { - AccessCodeId = accessCodeId; - AccessCodeIds = accessCodeIds; - AccessGrantId = accessGrantId; - AccessGrantIds = accessGrantIds; - AccessMethodId = accessMethodId; - AccessMethodIds = accessMethodIds; - AcsAccessGroupId = acsAccessGroupId; - AcsCredentialId = acsCredentialId; - AcsEncoderId = acsEncoderId; - AcsEntranceId = acsEntranceId; - AcsSystemId = acsSystemId; - AcsSystemIds = acsSystemIds; - AcsUserId = acsUserId; - Between = between; - ConnectWebviewId = connectWebviewId; - ConnectedAccountId = connectedAccountId; - CustomerKey = customerKey; - DeviceId = deviceId; - DeviceIds = deviceIds; - EventIds = eventIds; - EventType = eventType; - EventTypes = eventTypes; - Limit = limit; - Since = since; - SpaceId = spaceId; - SpaceIds = spaceIds; - UnstableOffset = unstableOffset; - UserIdentityId = userIdentityId; - } - /// /// Type of the events that you want to list. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum EventTypeEnum { [EnumMember(Value = "unrecognized")] @@ -594,7 +444,7 @@ public enum EventTypeEnum /// /// Types of the events that you want to list. /// - [JsonConverter(typeof(SafeStringEnumConverter))] + [JsonConverter(typeof(SeamStringEnumConverter))] public enum EventTypesEnum { [EnumMember(Value = "unrecognized")] @@ -949,406 +799,234 @@ public enum EventTypesEnum /// /// ID of the access code for which you want to list events. /// - [DataMember(Name = "access_code_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessCodeId { get; set; } + [JsonPropertyName("access_code_id")] + public string? AccessCodeId { get; init; } /// /// IDs of the access codes for which you want to list events. /// - [DataMember(Name = "access_code_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AccessCodeIds { get; set; } + [JsonPropertyName("access_code_ids")] + public List? AccessCodeIds { get; init; } /// /// ID of the access grant for which you want to list events. /// - [DataMember(Name = "access_grant_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessGrantId { get; set; } + [JsonPropertyName("access_grant_id")] + public string? AccessGrantId { get; init; } /// /// IDs of the access grants for which you want to list events. /// - [DataMember(Name = "access_grant_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AccessGrantIds { get; set; } + [JsonPropertyName("access_grant_ids")] + public List? AccessGrantIds { get; init; } /// /// ID of the access method for which you want to list events. /// - [DataMember(Name = "access_method_id", IsRequired = false, EmitDefaultValue = false)] - public string? AccessMethodId { get; set; } + [JsonPropertyName("access_method_id")] + public string? AccessMethodId { get; init; } /// /// IDs of the access methods for which you want to list events. /// - [DataMember(Name = "access_method_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AccessMethodIds { get; set; } + [JsonPropertyName("access_method_ids")] + public List? AccessMethodIds { get; init; } /// /// ID of the ACS access group for which you want to list events. /// - [DataMember(Name = "acs_access_group_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsAccessGroupId { get; set; } + [JsonPropertyName("acs_access_group_id")] + public string? AcsAccessGroupId { get; init; } /// /// ID of the ACS credential for which you want to list events. /// - [DataMember(Name = "acs_credential_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsCredentialId { get; set; } + [JsonPropertyName("acs_credential_id")] + public string? AcsCredentialId { get; init; } /// /// ID of the ACS encoder for which you want to list events. /// - [DataMember(Name = "acs_encoder_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsEncoderId { get; set; } + [JsonPropertyName("acs_encoder_id")] + public string? AcsEncoderId { get; init; } /// /// ID of the ACS entrance for which you want to list events. /// - [DataMember(Name = "acs_entrance_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsEntranceId { get; set; } + [JsonPropertyName("acs_entrance_id")] + public string? AcsEntranceId { get; init; } /// /// ID of the access system for which you want to list events. /// - [DataMember(Name = "acs_system_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsSystemId { get; set; } + [JsonPropertyName("acs_system_id")] + public string? AcsSystemId { get; init; } /// /// IDs of the access systems for which you want to list events. /// - [DataMember(Name = "acs_system_ids", IsRequired = false, EmitDefaultValue = false)] - public List? AcsSystemIds { get; set; } + [JsonPropertyName("acs_system_ids")] + public List? AcsSystemIds { get; init; } /// /// ID of the ACS user for which you want to list events. /// - [DataMember(Name = "acs_user_id", IsRequired = false, EmitDefaultValue = false)] - public string? AcsUserId { get; set; } + [JsonPropertyName("acs_user_id")] + public string? AcsUserId { get; init; } /// /// Lower and upper timestamps to define an exclusive interval containing the events that you want to list. You must include `since` or `between`. /// - [DataMember(Name = "between", IsRequired = false, EmitDefaultValue = false)] - public List? Between { get; set; } + [JsonPropertyName("between")] + public List? Between { get; init; } /// /// ID of the Connect Webview for which you want to list events. /// - [DataMember(Name = "connect_webview_id", IsRequired = false, EmitDefaultValue = false)] - public string? ConnectWebviewId { get; set; } + [JsonPropertyName("connect_webview_id")] + public string? ConnectWebviewId { get; init; } /// /// ID of the connected account for which you want to list events. /// - [DataMember( - Name = "connected_account_id", - IsRequired = false, - EmitDefaultValue = false - )] - public string? ConnectedAccountId { get; set; } + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } /// /// Customer key for which you want to list events. /// - [DataMember(Name = "customer_key", IsRequired = false, EmitDefaultValue = false)] - public string? CustomerKey { get; set; } + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } /// /// ID of the device for which you want to list events. /// - [DataMember(Name = "device_id", IsRequired = false, EmitDefaultValue = false)] - public string? DeviceId { get; set; } + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } /// /// IDs of the devices for which you want to list events. /// - [DataMember(Name = "device_ids", IsRequired = false, EmitDefaultValue = false)] - public List? DeviceIds { get; set; } + [JsonPropertyName("device_ids")] + public List? DeviceIds { get; init; } /// /// IDs of the events that you want to list. /// - [DataMember(Name = "event_ids", IsRequired = false, EmitDefaultValue = false)] - public List? EventIds { get; set; } + [JsonPropertyName("event_ids")] + public List? EventIds { get; init; } /// /// Type of the events that you want to list. /// - [DataMember(Name = "event_type", IsRequired = false, EmitDefaultValue = false)] - public ListRequest.EventTypeEnum? EventType { get; set; } + [JsonPropertyName("event_type")] + public ListRequest.EventTypeEnum? EventType { get; init; } /// /// Types of the events that you want to list. /// - [DataMember(Name = "event_types", IsRequired = false, EmitDefaultValue = false)] - public List? EventTypes { get; set; } + [JsonPropertyName("event_types")] + public List? EventTypes { get; init; } /// /// Numerical limit on the number of events to return. /// - [DataMember(Name = "limit", IsRequired = false, EmitDefaultValue = false)] - public float? Limit { get; set; } + [JsonPropertyName("limit")] + public float? Limit { get; init; } /// /// Timestamp to indicate the beginning generation time for the events that you want to list. You must include `since` or `between`. /// - [DataMember(Name = "since", IsRequired = false, EmitDefaultValue = false)] - public string? Since { get; set; } + [JsonPropertyName("since")] + public string? Since { get; init; } /// /// ID of the space for which you want to list events. /// - [DataMember(Name = "space_id", IsRequired = false, EmitDefaultValue = false)] - public string? SpaceId { get; set; } + [JsonPropertyName("space_id")] + public string? SpaceId { get; init; } /// /// IDs of the spaces for which you want to list events. /// - [DataMember(Name = "space_ids", IsRequired = false, EmitDefaultValue = false)] - public List? SpaceIds { get; set; } + [JsonPropertyName("space_ids")] + public List? SpaceIds { get; init; } /// /// Offset for the events that you want to list. /// - [DataMember(Name = "unstable_offset", IsRequired = false, EmitDefaultValue = false)] - public float? UnstableOffset { get; set; } + [JsonPropertyName("unstable_offset")] + public float? UnstableOffset { get; init; } /// /// ID of the user identity for which you want to list events. /// - [DataMember(Name = "user_identity_id", IsRequired = false, EmitDefaultValue = false)] - public string? UserIdentityId { get; set; } + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } - public override string ToString() + internal void Validate() { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) + if ( + AccessCodeId == null + && AccessCodeIds == null + && AccessGrantId == null + && AccessGrantIds == null + && AccessMethodId == null + && AccessMethodIds == null + && AcsAccessGroupId == null + && AcsCredentialId == null + && AcsEncoderId == null + && AcsEntranceId == null + && AcsSystemId == null + && AcsSystemIds == null + && AcsUserId == null + && Between == null + && ConnectWebviewId == null + && ConnectedAccountId == null + && CustomerKey == null + && DeviceId == null + && DeviceIds == null + && EventIds == null + && EventType == null + && EventTypes == null + && Limit == null + && Since == null + && SpaceId == null + && SpaceIds == null + && UnstableOffset == null + && UserIdentityId == null + ) { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); + throw new ArgumentException( + "At least one parameter is required for /events/list" + ); } - - return stringWriter.ToString(); } } - [DataContract(Name = "listResponse_response")] - public class ListResponse + public sealed record ListResponse { - [JsonConstructorAttribute] - protected ListResponse() { } - - public ListResponse(List events = default) - { - Events = events; - } - /// /// OK /// - [DataMember(Name = "events", IsRequired = false, EmitDefaultValue = false)] - public List Events { get; set; } - - public override string ToString() - { - JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(null); - - StringWriter stringWriter = new StringWriter( - new StringBuilder(256), - System.Globalization.CultureInfo.InvariantCulture - ); - using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter)) - { - jsonTextWriter.IndentChar = ' '; - jsonTextWriter.Indentation = 2; - jsonTextWriter.Formatting = Formatting.Indented; - jsonSerializer.Serialize(jsonTextWriter, this, null); - } - - return stringWriter.ToString(); - } - } - - /// - /// Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to filter or see events that already took place. - /// - public List List(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return _seam - .Get("/events/list", requestOptions) - .EnsureData("/events/list") - .Events; - } - - /// - /// Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to filter or see events that already took place. - /// - public List List( - string? accessCodeId = default, - List? accessCodeIds = default, - string? accessGrantId = default, - List? accessGrantIds = default, - string? accessMethodId = default, - List? accessMethodIds = default, - string? acsAccessGroupId = default, - string? acsCredentialId = default, - string? acsEncoderId = default, - string? acsEntranceId = default, - string? acsSystemId = default, - List? acsSystemIds = default, - string? acsUserId = default, - List? between = default, - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - string? deviceId = default, - List? deviceIds = default, - List? eventIds = default, - ListRequest.EventTypeEnum? eventType = default, - List? eventTypes = default, - float? limit = default, - string? since = default, - string? spaceId = default, - List? spaceIds = default, - float? unstableOffset = default, - string? userIdentityId = default - ) - { - return List( - new ListRequest( - accessCodeId: accessCodeId, - accessCodeIds: accessCodeIds, - accessGrantId: accessGrantId, - accessGrantIds: accessGrantIds, - accessMethodId: accessMethodId, - accessMethodIds: accessMethodIds, - acsAccessGroupId: acsAccessGroupId, - acsCredentialId: acsCredentialId, - acsEncoderId: acsEncoderId, - acsEntranceId: acsEntranceId, - acsSystemId: acsSystemId, - acsSystemIds: acsSystemIds, - acsUserId: acsUserId, - between: between, - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - deviceId: deviceId, - deviceIds: deviceIds, - eventIds: eventIds, - eventType: eventType, - eventTypes: eventTypes, - limit: limit, - since: since, - spaceId: spaceId, - spaceIds: spaceIds, - unstableOffset: unstableOffset, - userIdentityId: userIdentityId - ) - ); - } - - /// - /// Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to filter or see events that already took place. - /// - public async Task> ListAsync(ListRequest request) - { - var requestOptions = new RequestOptions(); - requestOptions.Data = request; - return (await _seam.GetAsync("/events/list", requestOptions)) - .EnsureData("/events/list") - .Events; + [JsonPropertyName("events")] + public List? Events { get; init; } } /// /// Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to filter or see events that already took place. /// public async Task> ListAsync( - string? accessCodeId = default, - List? accessCodeIds = default, - string? accessGrantId = default, - List? accessGrantIds = default, - string? accessMethodId = default, - List? accessMethodIds = default, - string? acsAccessGroupId = default, - string? acsCredentialId = default, - string? acsEncoderId = default, - string? acsEntranceId = default, - string? acsSystemId = default, - List? acsSystemIds = default, - string? acsUserId = default, - List? between = default, - string? connectWebviewId = default, - string? connectedAccountId = default, - string? customerKey = default, - string? deviceId = default, - List? deviceIds = default, - List? eventIds = default, - ListRequest.EventTypeEnum? eventType = default, - List? eventTypes = default, - float? limit = default, - string? since = default, - string? spaceId = default, - List? spaceIds = default, - float? unstableOffset = default, - string? userIdentityId = default + ListRequest request, + CancellationToken cancellationToken = default ) { - return ( - await ListAsync( - new ListRequest( - accessCodeId: accessCodeId, - accessCodeIds: accessCodeIds, - accessGrantId: accessGrantId, - accessGrantIds: accessGrantIds, - accessMethodId: accessMethodId, - accessMethodIds: accessMethodIds, - acsAccessGroupId: acsAccessGroupId, - acsCredentialId: acsCredentialId, - acsEncoderId: acsEncoderId, - acsEntranceId: acsEntranceId, - acsSystemId: acsSystemId, - acsSystemIds: acsSystemIds, - acsUserId: acsUserId, - between: between, - connectWebviewId: connectWebviewId, - connectedAccountId: connectedAccountId, - customerKey: customerKey, - deviceId: deviceId, - deviceIds: deviceIds, - eventIds: eventIds, - eventType: eventType, - eventTypes: eventTypes, - limit: limit, - since: since, - spaceId: spaceId, - spaceIds: spaceIds, - unstableOffset: unstableOffset, - userIdentityId: userIdentityId - ) - ) - ); + request.Validate(); + var response = await _transport + .SendAsync(HttpMethod.Get, "/events/list", request, cancellationToken) + .ConfigureAwait(false); + return response.Events + ?? throw new HttpRequestException("Seam returned no events for /events/list"); } } } - -namespace Seam.Client -{ - public partial class SeamClient - { - public Api.Events Events => new(this); - } - - public partial interface ISeamClient - { - public Api.Events Events { get; } - } -} diff --git a/src/Seam/Routes/InstantKeys.cs b/src/Seam/Routes/InstantKeys.cs new file mode 100644 index 00000000..355423a2 --- /dev/null +++ b/src/Seam/Routes/InstantKeys.cs @@ -0,0 +1,156 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class InstantKeys + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal InstantKeys( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Delete an Instant Key. + /// + public sealed record DeleteRequest + { + /// + /// ID of the Instant Key that you want to delete. + /// + [JsonPropertyName("instant_key_id")] + public required string InstantKeyId { get; init; } + } + + /// + /// Deletes a specified [Instant Key](https://docs.seam.co/capability-guides/instant-keys). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/instant_keys/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get an Instant Key. + /// + public sealed record GetRequest + { + /// + /// ID of the instant key to get. + /// + [JsonPropertyName("instant_key_id")] + public string? InstantKeyId { get; init; } + + /// + /// URL of the instant key to get. + /// + [JsonPropertyName("instant_key_url")] + public string? InstantKeyUrl { get; init; } + + internal void Validate() + { + if (InstantKeyId == null && InstantKeyUrl == null) + { + throw new ArgumentException( + "At least one parameter is required for /instant_keys/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("instant_key")] + public InstantKey? InstantKey { get; init; } + } + + /// + /// Gets an [instant key](https://docs.seam.co/capability-guides/instant-keys). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/instant_keys/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.InstantKey + ?? throw new HttpRequestException( + "Seam returned no instant_key for /instant_keys/get" + ); + } + + /// + /// Request parameters for List Instant Keys. + /// + public sealed record ListRequest + { + /// + /// ID of the user identity by which you want to filter the list of Instant Keys. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("instant_keys")] + public List? InstantKeys { get; init; } + } + + /// + /// Returns a list of all [instant keys](https://docs.seam.co/capability-guides/instant-keys). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/instant_keys/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.InstantKeys + ?? throw new HttpRequestException( + "Seam returned no instant_keys for /instant_keys/list" + ); + } + } +} diff --git a/src/Seam/Routes/Locks.cs b/src/Seam/Routes/Locks.cs new file mode 100644 index 00000000..706e65b3 --- /dev/null +++ b/src/Seam/Routes/Locks.cs @@ -0,0 +1,635 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class Locks + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal Locks(SeamHttpTransport transport, ActionAttemptWait waitForActionAttemptDefault) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + Simulate = new LocksSimulate(transport, waitForActionAttemptDefault); + } + + public LocksSimulate Simulate { get; } + + /// + /// Request parameters for Configure Auto-Lock. + /// + public sealed record ConfigureAutoLockRequest + { + /// + /// Delay in seconds before the lock automatically locks. Required when enabling auto-lock. Must be between 1 and 60. + /// + [JsonPropertyName("auto_lock_delay_seconds")] + public float? AutoLockDelaySeconds { get; init; } + + /// + /// Whether to enable or disable auto-lock. + /// + [JsonPropertyName("auto_lock_enabled")] + public required bool AutoLockEnabled { get; init; } + + /// + /// ID of the lock for which you want to configure the auto-lock. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record ConfigureAutoLockResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Configures the auto-lock setting for a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). + /// + public async Task ConfigureAutoLockAsync( + ConfigureAutoLockRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/locks/configure_auto_lock", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /locks/configure_auto_lock" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Lock. + /// + [Obsolete("Use `/devices/get` instead.")] + public sealed record GetRequest + { + /// + /// ID of the lock that you want to get. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Name of the lock that you want to get. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + internal void Validate() + { + if (DeviceId == null && Name == null) + { + throw new ArgumentException( + "At least one parameter is required for /locks/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("device")] + public Device? Device { get; init; } + } + + /// + /// Returns a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). + /// + [Obsolete("Use `/devices/get` instead.")] + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync(HttpMethod.Get, "/locks/get", request, cancellationToken) + .ConfigureAwait(false); + return response.Device + ?? throw new HttpRequestException("Seam returned no device for /locks/get"); + } + + /// + /// Request parameters for List Locks. + /// + public sealed record ListRequest + { + /// + /// Device type of the locks that you want to list. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "akuvox_lock")] + AkuvoxLock = 1, + + [EnumMember(Value = "august_lock")] + AugustLock = 2, + + [EnumMember(Value = "brivo_access_point")] + BrivoAccessPoint = 3, + + [EnumMember(Value = "butterflymx_panel")] + ButterflymxPanel = 4, + + [EnumMember(Value = "avigilon_alta_entry")] + AvigilonAltaEntry = 5, + + [EnumMember(Value = "doorking_lock")] + DoorkingLock = 6, + + [EnumMember(Value = "genie_door")] + GenieDoor = 7, + + [EnumMember(Value = "igloo_lock")] + IglooLock = 8, + + [EnumMember(Value = "linear_lock")] + LinearLock = 9, + + [EnumMember(Value = "lockly_lock")] + LocklyLock = 10, + + [EnumMember(Value = "kwikset_lock")] + KwiksetLock = 11, + + [EnumMember(Value = "nuki_lock")] + NukiLock = 12, + + [EnumMember(Value = "salto_lock")] + SaltoLock = 13, + + [EnumMember(Value = "schlage_lock")] + SchlageLock = 14, + + [EnumMember(Value = "smartthings_lock")] + SmartthingsLock = 15, + + [EnumMember(Value = "wyze_lock")] + WyzeLock = 16, + + [EnumMember(Value = "yale_lock")] + YaleLock = 17, + + [EnumMember(Value = "two_n_intercom")] + TwoNIntercom = 18, + + [EnumMember(Value = "controlbyweb_device")] + ControlbywebDevice = 19, + + [EnumMember(Value = "ttlock_lock")] + TtlockLock = 20, + + [EnumMember(Value = "igloohome_lock")] + IgloohomeLock = 21, + + [EnumMember(Value = "four_suites_door")] + FourSuitesDoor = 22, + + [EnumMember(Value = "dormakaba_oracode_door")] + DormakabaOracodeDoor = 23, + + [EnumMember(Value = "tedee_lock")] + TedeeLock = 24, + + [EnumMember(Value = "akiles_lock")] + AkilesLock = 25, + + [EnumMember(Value = "ultraloq_lock")] + UltraloqLock = 26, + + [EnumMember(Value = "yacan_lock")] + YacanLock = 27, + + [EnumMember(Value = "keyincode_lock")] + KeyincodeLock = 28, + + [EnumMember(Value = "omnitec_lock")] + OmnitecLock = 29, + + [EnumMember(Value = "kisi_lock")] + KisiLock = 30, + + [EnumMember(Value = "aqara_lock")] + AqaraLock = 31, + } + + /// + /// Device types of the locks that you want to list. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypesEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "akuvox_lock")] + AkuvoxLock = 1, + + [EnumMember(Value = "august_lock")] + AugustLock = 2, + + [EnumMember(Value = "brivo_access_point")] + BrivoAccessPoint = 3, + + [EnumMember(Value = "butterflymx_panel")] + ButterflymxPanel = 4, + + [EnumMember(Value = "avigilon_alta_entry")] + AvigilonAltaEntry = 5, + + [EnumMember(Value = "doorking_lock")] + DoorkingLock = 6, + + [EnumMember(Value = "genie_door")] + GenieDoor = 7, + + [EnumMember(Value = "igloo_lock")] + IglooLock = 8, + + [EnumMember(Value = "linear_lock")] + LinearLock = 9, + + [EnumMember(Value = "lockly_lock")] + LocklyLock = 10, + + [EnumMember(Value = "kwikset_lock")] + KwiksetLock = 11, + + [EnumMember(Value = "nuki_lock")] + NukiLock = 12, + + [EnumMember(Value = "salto_lock")] + SaltoLock = 13, + + [EnumMember(Value = "schlage_lock")] + SchlageLock = 14, + + [EnumMember(Value = "smartthings_lock")] + SmartthingsLock = 15, + + [EnumMember(Value = "wyze_lock")] + WyzeLock = 16, + + [EnumMember(Value = "yale_lock")] + YaleLock = 17, + + [EnumMember(Value = "two_n_intercom")] + TwoNIntercom = 18, + + [EnumMember(Value = "controlbyweb_device")] + ControlbywebDevice = 19, + + [EnumMember(Value = "ttlock_lock")] + TtlockLock = 20, + + [EnumMember(Value = "igloohome_lock")] + IgloohomeLock = 21, + + [EnumMember(Value = "four_suites_door")] + FourSuitesDoor = 22, + + [EnumMember(Value = "dormakaba_oracode_door")] + DormakabaOracodeDoor = 23, + + [EnumMember(Value = "tedee_lock")] + TedeeLock = 24, + + [EnumMember(Value = "akiles_lock")] + AkilesLock = 25, + + [EnumMember(Value = "ultraloq_lock")] + UltraloqLock = 26, + + [EnumMember(Value = "yacan_lock")] + YacanLock = 27, + + [EnumMember(Value = "keyincode_lock")] + KeyincodeLock = 28, + + [EnumMember(Value = "omnitec_lock")] + OmnitecLock = 29, + + [EnumMember(Value = "kisi_lock")] + KisiLock = 30, + + [EnumMember(Value = "aqara_lock")] + AqaraLock = 31, + } + + /// + /// Manufacturer of the locks that you want to list. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ManufacturerEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "akuvox")] + Akuvox = 1, + + [EnumMember(Value = "august")] + August = 2, + + [EnumMember(Value = "brivo")] + Brivo = 3, + + [EnumMember(Value = "butterflymx")] + Butterflymx = 4, + + [EnumMember(Value = "avigilon_alta")] + AvigilonAlta = 5, + + [EnumMember(Value = "doorking")] + Doorking = 6, + + [EnumMember(Value = "genie")] + Genie = 7, + + [EnumMember(Value = "igloo")] + Igloo = 8, + + [EnumMember(Value = "linear")] + Linear = 9, + + [EnumMember(Value = "lockly")] + Lockly = 10, + + [EnumMember(Value = "kwikset")] + Kwikset = 11, + + [EnumMember(Value = "nuki")] + Nuki = 12, + + [EnumMember(Value = "salto")] + Salto = 13, + + [EnumMember(Value = "schlage")] + Schlage = 14, + + [EnumMember(Value = "seam")] + Seam = 15, + + [EnumMember(Value = "wyze")] + Wyze = 16, + + [EnumMember(Value = "yale")] + Yale = 17, + + [EnumMember(Value = "two_n")] + TwoN = 18, + + [EnumMember(Value = "controlbyweb")] + Controlbyweb = 19, + + [EnumMember(Value = "ttlock")] + Ttlock = 20, + + [EnumMember(Value = "igloohome")] + Igloohome = 21, + + [EnumMember(Value = "four_suites")] + FourSuites = 22, + + [EnumMember(Value = "dormakaba_oracode")] + DormakabaOracode = 23, + + [EnumMember(Value = "tedee")] + Tedee = 24, + + [EnumMember(Value = "keyincode")] + Keyincode = 25, + + [EnumMember(Value = "akiles")] + Akiles = 26, + + [EnumMember(Value = "aqara")] + Aqara = 27, + + [EnumMember(Value = "korelock")] + Korelock = 28, + + [EnumMember(Value = "smartthings")] + Smartthings = 29, + + [EnumMember(Value = "ultraloq")] + Ultraloq = 30, + + [EnumMember(Value = "omnitec")] + Omnitec = 31, + + [EnumMember(Value = "kisi")] + Kisi = 32, + + [EnumMember(Value = "yacan")] + Yacan = 33, + } + + /// + /// ID of the Connect Webview for which you want to list devices. + /// + [JsonPropertyName("connect_webview_id")] + public string? ConnectWebviewId { get; init; } + + /// + /// ID of the connected account for which you want to list devices. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// Customer key for which you want to list devices. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Device type of the locks that you want to list. + /// + [JsonPropertyName("device_type")] + public ListRequest.DeviceTypeEnum? DeviceType { get; init; } + + /// + /// Device types of the locks that you want to list. + /// + [JsonPropertyName("device_types")] + public List? DeviceTypes { get; init; } + + /// + /// Manufacturer of the locks that you want to list. + /// + [JsonPropertyName("manufacturer")] + public ListRequest.ManufacturerEnum? Manufacturer { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("devices")] + public List? Devices { get; init; } + } + + /// + /// Returns a list of all [locks](https://docs.seam.co/low-level-apis/smart-locks). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync(HttpMethod.Get, "/locks/list", request, cancellationToken) + .ConfigureAwait(false); + return response.Devices + ?? throw new HttpRequestException("Seam returned no devices for /locks/list"); + } + + /// + /// Request parameters for Lock a Lock. + /// + public sealed record LockDoorRequest + { + /// + /// ID of the lock that you want to lock. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record LockDoorResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Locks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). + /// + public async Task LockDoorAsync( + LockDoorRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/locks/lock_door", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /locks/lock_door" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Unlock a Lock. + /// + public sealed record UnlockDoorRequest + { + /// + /// ID of the lock that you want to unlock. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record UnlockDoorResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Unlocks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). + /// + public async Task UnlockDoorAsync( + UnlockDoorRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/locks/unlock_door", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /locks/unlock_door" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/LocksSimulate.cs b/src/Seam/Routes/LocksSimulate.cs new file mode 100644 index 00000000..e0550d17 --- /dev/null +++ b/src/Seam/Routes/LocksSimulate.cs @@ -0,0 +1,140 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class LocksSimulate + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal LocksSimulate( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Simulate a Keypad Code Entry. + /// + public sealed record KeypadCodeEntryRequest + { + /// + /// Code that you want to simulate entering on a keypad. + /// + [JsonPropertyName("code")] + public required string Code { get; init; } + + /// + /// ID of the device for which you want to simulate a keypad code entry. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record KeypadCodeEntryResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Simulates the entry of a code on a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + public async Task KeypadCodeEntryAsync( + KeypadCodeEntryRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/locks/simulate/keypad_code_entry", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /locks/simulate/keypad_code_entry" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Simulate a Manual Lock Action Using a Keypad. + /// + public sealed record ManualLockViaKeypadRequest + { + /// + /// ID of the device for which you want to simulate a manual lock action using a keypad. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record ManualLockViaKeypadResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Simulates a manual lock action using a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + public async Task ManualLockViaKeypadAsync( + ManualLockViaKeypadRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/locks/simulate/manual_lock_via_keypad", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /locks/simulate/manual_lock_via_keypad" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/NoiseSensors.cs b/src/Seam/Routes/NoiseSensors.cs new file mode 100644 index 00000000..f8e25477 --- /dev/null +++ b/src/Seam/Routes/NoiseSensors.cs @@ -0,0 +1,158 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class NoiseSensors + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal NoiseSensors( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + NoiseThresholds = new NoiseSensorsNoiseThresholds( + transport, + waitForActionAttemptDefault + ); + Simulate = new NoiseSensorsSimulate(transport, waitForActionAttemptDefault); + } + + public NoiseSensorsNoiseThresholds NoiseThresholds { get; } + + public NoiseSensorsSimulate Simulate { get; } + + /// + /// Request parameters for List Noise Sensors. + /// + public sealed record ListRequest + { + /// + /// Device type of the noise sensors that you want to list. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "noiseaware_activity_zone")] + NoiseawareActivityZone = 1, + + [EnumMember(Value = "minut_sensor")] + MinutSensor = 2, + } + + /// + /// Device types of the noise sensors that you want to list. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypesEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "noiseaware_activity_zone")] + NoiseawareActivityZone = 1, + + [EnumMember(Value = "minut_sensor")] + MinutSensor = 2, + } + + /// + /// Manufacturers of the noise sensors that you want to list. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ManufacturerEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "minut")] + Minut = 1, + + [EnumMember(Value = "noiseaware")] + Noiseaware = 2, + } + + /// + /// ID of the Connect Webview for which you want to list devices. + /// + [JsonPropertyName("connect_webview_id")] + public string? ConnectWebviewId { get; init; } + + /// + /// ID of the connected account for which you want to list devices. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// Customer key for which you want to list devices. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Device type of the noise sensors that you want to list. + /// + [JsonPropertyName("device_type")] + public ListRequest.DeviceTypeEnum? DeviceType { get; init; } + + /// + /// Device types of the noise sensors that you want to list. + /// + [JsonPropertyName("device_types")] + public List? DeviceTypes { get; init; } + + /// + /// Manufacturers of the noise sensors that you want to list. + /// + [JsonPropertyName("manufacturer")] + public ListRequest.ManufacturerEnum? Manufacturer { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("devices")] + public List? Devices { get; init; } + } + + /// + /// Returns a list of all [noise sensors](https://docs.seam.co/capability-guides/noise-sensors). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/noise_sensors/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Devices + ?? throw new HttpRequestException( + "Seam returned no devices for /noise_sensors/list" + ); + } + } +} diff --git a/src/Seam/Routes/NoiseSensorsNoiseThresholds.cs b/src/Seam/Routes/NoiseSensorsNoiseThresholds.cs new file mode 100644 index 00000000..72ead238 --- /dev/null +++ b/src/Seam/Routes/NoiseSensorsNoiseThresholds.cs @@ -0,0 +1,289 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class NoiseSensorsNoiseThresholds + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal NoiseSensorsNoiseThresholds( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Create a Noise Threshold. + /// + public sealed record CreateRequest + { + /// + /// ID of the device for which you want to create a noise threshold. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Time at which the new noise threshold should become inactive daily. + /// + [JsonPropertyName("ends_daily_at")] + public required string EndsDailyAt { get; init; } + + /// + /// Name of the new noise threshold. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Noise level in decibels for the new noise threshold. + /// + [JsonPropertyName("noise_threshold_decibels")] + public float? NoiseThresholdDecibels { get; init; } + + /// + /// Noise level in Noiseaware Noise Risk Score (NRS) for the new noise threshold. This parameter is only relevant for [Noiseaware sensors](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors). + /// + [JsonPropertyName("noise_threshold_nrs")] + public float? NoiseThresholdNrs { get; init; } + + /// + /// Time at which the new noise threshold should become active daily. + /// + [JsonPropertyName("starts_daily_at")] + public required string StartsDailyAt { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("noise_threshold")] + public NoiseThreshold? NoiseThreshold { get; init; } + } + + /// + /// Creates a new [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/noise_sensors/noise_thresholds/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.NoiseThreshold + ?? throw new HttpRequestException( + "Seam returned no noise_threshold for /noise_sensors/noise_thresholds/create" + ); + } + + /// + /// Request parameters for Delete a Noise Threshold. + /// + public sealed record DeleteRequest + { + /// + /// ID of the device that contains the noise threshold that you want to delete. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// ID of the noise threshold that you want to delete. + /// + [JsonPropertyName("noise_threshold_id")] + public required string NoiseThresholdId { get; init; } + } + + /// + /// Deletes a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) from a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/noise_sensors/noise_thresholds/delete", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Noise Threshold. + /// + public sealed record GetRequest + { + /// + /// ID of the noise threshold that you want to get. + /// + [JsonPropertyName("noise_threshold_id")] + public required string NoiseThresholdId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("noise_threshold")] + public NoiseThreshold? NoiseThreshold { get; init; } + } + + /// + /// Returns a specified [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/noise_sensors/noise_thresholds/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.NoiseThreshold + ?? throw new HttpRequestException( + "Seam returned no noise_threshold for /noise_sensors/noise_thresholds/get" + ); + } + + /// + /// Request parameters for List Noise Thresholds. + /// + public sealed record ListRequest + { + /// + /// ID of the device for which you want to list noise thresholds. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("noise_thresholds")] + public List? NoiseThresholds { get; init; } + } + + /// + /// Returns a list of all [noise thresholds](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). + /// + public async Task> ListAsync( + ListRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/noise_sensors/noise_thresholds/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.NoiseThresholds + ?? throw new HttpRequestException( + "Seam returned no noise_thresholds for /noise_sensors/noise_thresholds/list" + ); + } + + /// + /// Request parameters for Update a Noise Threshold. + /// + public sealed record UpdateRequest + { + /// + /// ID of the device that contains the noise threshold that you want to update. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Time at which the noise threshold should become inactive daily. + /// + [JsonPropertyName("ends_daily_at")] + public string? EndsDailyAt { get; init; } + + /// + /// Name of the noise threshold that you want to update. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Noise level in decibels for the noise threshold. + /// + [JsonPropertyName("noise_threshold_decibels")] + public float? NoiseThresholdDecibels { get; init; } + + /// + /// ID of the noise threshold that you want to update. + /// + [JsonPropertyName("noise_threshold_id")] + public required string NoiseThresholdId { get; init; } + + /// + /// Noise level in Noiseaware Noise Risk Score (NRS) for the noise threshold. This parameter is only relevant for [Noiseaware sensors](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors). + /// + [JsonPropertyName("noise_threshold_nrs")] + public float? NoiseThresholdNrs { get; init; } + + /// + /// Time at which the noise threshold should become active daily. + /// + [JsonPropertyName("starts_daily_at")] + public string? StartsDailyAt { get; init; } + } + + /// + /// Updates a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Put, + "/noise_sensors/noise_thresholds/update", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/NoiseSensorsSimulate.cs b/src/Seam/Routes/NoiseSensorsSimulate.cs new file mode 100644 index 00000000..07dfd86c --- /dev/null +++ b/src/Seam/Routes/NoiseSensorsSimulate.cs @@ -0,0 +1,58 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class NoiseSensorsSimulate + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal NoiseSensorsSimulate( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Simulate Triggering a Noise Threshold. + /// + public sealed record TriggerNoiseThresholdRequest + { + /// + /// ID of the device for which you want to simulate the triggering of a noise threshold. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + /// + /// Simulates the triggering of a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + public async Task TriggerNoiseThresholdAsync( + TriggerNoiseThresholdRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/noise_sensors/simulate/trigger_noise_threshold", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/Phones.cs b/src/Seam/Routes/Phones.cs new file mode 100644 index 00000000..2647c9cc --- /dev/null +++ b/src/Seam/Routes/Phones.cs @@ -0,0 +1,131 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class Phones + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal Phones(SeamHttpTransport transport, ActionAttemptWait waitForActionAttemptDefault) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + Simulate = new PhonesSimulate(transport, waitForActionAttemptDefault); + } + + public PhonesSimulate Simulate { get; } + + /// + /// Request parameters for Deactivate a Phone. + /// + public sealed record DeactivateRequest + { + /// + /// Device ID of the phone that you want to deactivate. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + /// + /// Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see [App User Lost Phone Process](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity#app-user-lost-phone-process). + /// + public async Task DeactivateAsync( + DeactivateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/phones/deactivate", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Phone. + /// + public sealed record GetRequest + { + /// + /// Device ID of the phone that you want to get. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("phone")] + public Phone? Phone { get; init; } + } + + /// + /// Returns a specified [phone](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync(HttpMethod.Get, "/phones/get", request, cancellationToken) + .ConfigureAwait(false); + return response.Phone + ?? throw new HttpRequestException("Seam returned no phone for /phones/get"); + } + + /// + /// Request parameters for List Phones. + /// + public sealed record ListRequest + { + /// + /// ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) by which you want to filter the list of returned phones. + /// + [JsonPropertyName("acs_credential_id")] + public string? AcsCredentialId { get; init; } + + /// + /// ID of the user identity that represents the owner by which you want to filter the list of returned phones. + /// + [JsonPropertyName("owner_user_identity_id")] + public string? OwnerUserIdentityId { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("phones")] + public List? Phones { get; init; } + } + + /// + /// Returns a list of all [phones](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). To filter the list of returned phones by a specific owner user identity or credential, include the `owner_user_identity_id` or `acs_credential_id`, respectively, in the request body. + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync(HttpMethod.Get, "/phones/list", request, cancellationToken) + .ConfigureAwait(false); + return response.Phones + ?? throw new HttpRequestException("Seam returned no phones for /phones/list"); + } + } +} diff --git a/src/Seam/Routes/PhonesSimulate.cs b/src/Seam/Routes/PhonesSimulate.cs new file mode 100644 index 00000000..df5bc943 --- /dev/null +++ b/src/Seam/Routes/PhonesSimulate.cs @@ -0,0 +1,171 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class PhonesSimulate + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal PhonesSimulate( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Create a Sandbox Phone. + /// + public sealed record CreateSandboxPhoneRequest + { + /// + /// ASSA ABLOY metadata that you want to associate with the simulated phone. + /// + [JsonPropertyName("assa_abloy_metadata")] + public CreateSandboxPhoneRequestAssaAbloyMetadata? AssaAbloyMetadata { get; init; } + + /// + /// ID of the custom SDK installation that you want to use for the simulated phone. + /// + [JsonPropertyName("custom_sdk_installation_id")] + public string? CustomSdkInstallationId { get; init; } + + /// + /// Metadata that you want to associate with the simulated phone. + /// + [JsonPropertyName("phone_metadata")] + public CreateSandboxPhoneRequestPhoneMetadata? PhoneMetadata { get; init; } + + /// + /// ID of the user identity that you want to associate with the simulated phone. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + public sealed record CreateSandboxPhoneRequestAssaAbloyMetadata + { + /// + /// Application version that you want to use for the simulated phone. + /// + [JsonPropertyName("application_version")] + public string? ApplicationVersion { get; init; } + + /// + /// Indicates whether the simulated phone should have Bluetooth low energy (BLE) capability. + /// + [JsonPropertyName("ble_capability")] + public bool? BleCapability { get; init; } + + /// + /// Indicates whether the simulated phone should have host card emulation (HCE) capability. + /// + [JsonPropertyName("hce_capability")] + public bool? HceCapability { get; init; } + + /// + /// Indicates whether the simulated phone should have near-field communication (NFC) capability. + /// + [JsonPropertyName("nfc_capability")] + public bool? NfcCapability { get; init; } + + /// + /// SEOS applet version that you want to use for the simulated phone. + /// + [JsonPropertyName("seos_applet_version")] + public string? SeosAppletVersion { get; init; } + + /// + /// ID of the SEOS trusted service manager (TSM) endpoint that you want to use for the simulated phone. + /// + [JsonPropertyName("seos_tsm_endpoint_id")] + public float? SeosTsmEndpointId { get; init; } + } + + public sealed record CreateSandboxPhoneRequestPhoneMetadata + { + /// + /// Mobile operating system that you want to use for the simulated phone. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum OperatingSystemEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "android")] + Android = 1, + + [EnumMember(Value = "ios")] + Ios = 2, + } + + /// + /// Manufacturer that you want to use for the simulated phone. + /// + [JsonPropertyName("device_manufacturer")] + public string? DeviceManufacturer { get; init; } + + /// + /// Device model that you want to use for the simulated phone. + /// + [JsonPropertyName("device_model")] + public string? DeviceModel { get; init; } + + /// + /// Mobile operating system that you want to use for the simulated phone. + /// + [JsonPropertyName("operating_system")] + public CreateSandboxPhoneRequestPhoneMetadata.OperatingSystemEnum? OperatingSystem { get; init; } + + /// + /// Mobile operating system version that you want to use for the simulated phone. + /// + [JsonPropertyName("os_version")] + public string? OsVersion { get; init; } + } + + public sealed record CreateSandboxPhoneResponse + { + /// + /// OK + /// + [JsonPropertyName("phone")] + public Phone? Phone { get; init; } + } + + /// + /// Creates a new simulated phone in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Creating a Simulated Phone for a User Identity](https://docs.seam.co/capability-guides/mobile-access/developing-in-a-sandbox-workspace#creating-a-simulated-phone-for-a-user-identity). + /// + public async Task CreateSandboxPhoneAsync( + CreateSandboxPhoneRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/phones/simulate/create_sandbox_phone", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Phone + ?? throw new HttpRequestException( + "Seam returned no phone for /phones/simulate/create_sandbox_phone" + ); + } + } +} diff --git a/src/Seam/Routes/SeamClientRoutes.cs b/src/Seam/Routes/SeamClientRoutes.cs new file mode 100644 index 00000000..c34fb43d --- /dev/null +++ b/src/Seam/Routes/SeamClientRoutes.cs @@ -0,0 +1,104 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +namespace Seam +{ + public sealed partial class SeamClient + { + private Routes.AccessCodes? _accessCodes; + + /// The AccessCodes route client. + public Routes.AccessCodes AccessCodes => + _accessCodes ??= new(Transport, WaitForActionAttemptDefault); + private Routes.AccessGrants? _accessGrants; + + /// The AccessGrants route client. + public Routes.AccessGrants AccessGrants => + _accessGrants ??= new(Transport, WaitForActionAttemptDefault); + private Routes.AccessMethods? _accessMethods; + + /// The AccessMethods route client. + public Routes.AccessMethods AccessMethods => + _accessMethods ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Acs? _acs; + + /// The Acs route client. + public Routes.Acs Acs => _acs ??= new(Transport, WaitForActionAttemptDefault); + private Routes.ActionAttempts? _actionAttempts; + + /// The ActionAttempts route client. + public Routes.ActionAttempts ActionAttempts => + _actionAttempts ??= new(Transport, WaitForActionAttemptDefault); + private Routes.ClientSessions? _clientSessions; + + /// The ClientSessions route client. + public Routes.ClientSessions ClientSessions => + _clientSessions ??= new(Transport, WaitForActionAttemptDefault); + private Routes.ConnectedAccounts? _connectedAccounts; + + /// The ConnectedAccounts route client. + public Routes.ConnectedAccounts ConnectedAccounts => + _connectedAccounts ??= new(Transport, WaitForActionAttemptDefault); + private Routes.ConnectWebviews? _connectWebviews; + + /// The ConnectWebviews route client. + public Routes.ConnectWebviews ConnectWebviews => + _connectWebviews ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Customers? _customers; + + /// The Customers route client. + public Routes.Customers Customers => + _customers ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Devices? _devices; + + /// The Devices route client. + public Routes.Devices Devices => _devices ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Events? _events; + + /// The Events route client. + public Routes.Events Events => _events ??= new(Transport, WaitForActionAttemptDefault); + private Routes.InstantKeys? _instantKeys; + + /// The InstantKeys route client. + public Routes.InstantKeys InstantKeys => + _instantKeys ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Locks? _locks; + + /// The Locks route client. + public Routes.Locks Locks => _locks ??= new(Transport, WaitForActionAttemptDefault); + private Routes.NoiseSensors? _noiseSensors; + + /// The NoiseSensors route client. + public Routes.NoiseSensors NoiseSensors => + _noiseSensors ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Phones? _phones; + + /// The Phones route client. + public Routes.Phones Phones => _phones ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Spaces? _spaces; + + /// The Spaces route client. + public Routes.Spaces Spaces => _spaces ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Thermostats? _thermostats; + + /// The Thermostats route client. + public Routes.Thermostats Thermostats => + _thermostats ??= new(Transport, WaitForActionAttemptDefault); + private Routes.UserIdentities? _userIdentities; + + /// The UserIdentities route client. + public Routes.UserIdentities UserIdentities => + _userIdentities ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Webhooks? _webhooks; + + /// The Webhooks route client. + public Routes.Webhooks Webhooks => + _webhooks ??= new(Transport, WaitForActionAttemptDefault); + private Routes.Workspaces? _workspaces; + + /// The Workspaces route client. + public Routes.Workspaces Workspaces => + _workspaces ??= new(Transport, WaitForActionAttemptDefault); + } +} diff --git a/src/Seam/Routes/Spaces.cs b/src/Seam/Routes/Spaces.cs new file mode 100644 index 00000000..4fc94cc1 --- /dev/null +++ b/src/Seam/Routes/Spaces.cs @@ -0,0 +1,721 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class Spaces + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal Spaces(SeamHttpTransport transport, ActionAttemptWait waitForActionAttemptDefault) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Add Entrances to a Space. + /// + public sealed record AddAcsEntrancesRequest + { + /// + /// IDs of the entrances that you want to add to the space. + /// + [JsonPropertyName("acs_entrance_ids")] + public required List AcsEntranceIds { get; init; } + + /// + /// ID of the space to which you want to add entrances. + /// + [JsonPropertyName("space_id")] + public required string SpaceId { get; init; } + } + + /// + /// Adds [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) to a specific space. + /// + public async Task AddAcsEntrancesAsync( + AddAcsEntrancesRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Put, "/spaces/add_acs_entrances", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Add a Connected Account to a Space. + /// + public sealed record AddConnectedAccountRequest + { + /// + /// ID of the connected account that you want to add to the space. + /// + [JsonPropertyName("connected_account_id")] + public required string ConnectedAccountId { get; init; } + + /// + /// ID of the space to which you want to add the connected account. + /// + [JsonPropertyName("space_id")] + public required string SpaceId { get; init; } + } + + /// + /// Adds a [connected account](https://docs.seam.co/core-concepts/connected-accounts) to a specific space. + /// + public async Task AddConnectedAccountAsync( + AddConnectedAccountRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Put, + "/spaces/add_connected_account", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Add Devices to a Space. + /// + public sealed record AddDevicesRequest + { + /// + /// IDs of the devices that you want to add to the space. + /// + [JsonPropertyName("device_ids")] + public required List DeviceIds { get; init; } + + /// + /// ID of the space to which you want to add devices. + /// + [JsonPropertyName("space_id")] + public required string SpaceId { get; init; } + } + + /// + /// Adds devices to a specific space. + /// + public async Task AddDevicesAsync( + AddDevicesRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Put, "/spaces/add_devices", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Create a Space. + /// + public sealed record CreateRequest + { + /// + /// IDs of the entrances that you want to add to the new space. + /// + [JsonPropertyName("acs_entrance_ids")] + public List? AcsEntranceIds { get; init; } + + /// + /// IDs of connected accounts to associate with the new space. Persisted on seam.location_third_party_account so the UI can show which provider account(s) a space came from. + /// + [JsonPropertyName("connected_account_ids")] + public List? ConnectedAccountIds { get; init; } + + /// + /// Reservation/stay-related defaults for the space. + /// + [JsonPropertyName("customer_data")] + public CreateRequestCustomerData? CustomerData { get; init; } + + /// + /// Customer key for which you want to create the space. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// IDs of the devices that you want to add to the new space. + /// + [JsonPropertyName("device_ids")] + public List? DeviceIds { get; init; } + + /// + /// Name of the space that you want to create. + /// + [JsonPropertyName("name")] + public required string Name { get; init; } + + /// + /// Unique key for the space within the workspace. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + } + + public sealed record CreateRequestCustomerData + { + /// + /// Postal address for the space. + /// + [JsonPropertyName("address")] + public Optional Address { get; init; } + + /// + /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkin_time")] + public Optional DefaultCheckinTime { get; init; } + + /// + /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkout_time")] + public Optional DefaultCheckoutTime { get; init; } + + /// + /// IANA time zone for the space, e.g. America/Los_Angeles. + /// + [JsonPropertyName("time_zone")] + public Optional TimeZone { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("space")] + public Space? Space { get; init; } + } + + /// + /// Creates a new space. + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/spaces/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Space + ?? throw new HttpRequestException("Seam returned no space for /spaces/create"); + } + + /// + /// Request parameters for Delete a Space. + /// + public sealed record DeleteRequest + { + /// + /// ID of the space that you want to delete. + /// + [JsonPropertyName("space_id")] + public required string SpaceId { get; init; } + } + + /// + /// Deletes a space. + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/spaces/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Space. + /// + public sealed record GetRequest + { + /// + /// ID of the space that you want to get. + /// + [JsonPropertyName("space_id")] + public string? SpaceId { get; init; } + + /// + /// Unique key of the space that you want to get. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + + internal void Validate() + { + if (SpaceId == null && SpaceKey == null) + { + throw new ArgumentException( + "At least one parameter is required for /spaces/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("space")] + public Space? Space { get; init; } + } + + /// + /// Gets a space. + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync(HttpMethod.Get, "/spaces/get", request, cancellationToken) + .ConfigureAwait(false); + return response.Space + ?? throw new HttpRequestException("Seam returned no space for /spaces/get"); + } + + /// + /// Request parameters for Get related Space resources. + /// + public sealed record GetRelatedRequest + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ExcludeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "spaces")] + Spaces = 1, + + [EnumMember(Value = "devices")] + Devices = 2, + + [EnumMember(Value = "acs_entrances")] + AcsEntrances = 3, + + [EnumMember(Value = "connected_accounts")] + ConnectedAccounts = 4, + + [EnumMember(Value = "acs_systems")] + AcsSystems = 5, + + [EnumMember(Value = "access_methods")] + AccessMethods = 6, + } + + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum IncludeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "spaces")] + Spaces = 1, + + [EnumMember(Value = "devices")] + Devices = 2, + + [EnumMember(Value = "acs_entrances")] + AcsEntrances = 3, + + [EnumMember(Value = "connected_accounts")] + ConnectedAccounts = 4, + + [EnumMember(Value = "acs_systems")] + AcsSystems = 5, + + [EnumMember(Value = "access_methods")] + AccessMethods = 6, + } + + [JsonPropertyName("exclude")] + public List? Exclude { get; init; } + + [JsonPropertyName("include")] + public List? Include { get; init; } + + /// + /// IDs of the spaces that you want to get along with their related resources. + /// + [JsonPropertyName("space_ids")] + public List? SpaceIds { get; init; } + + /// + /// Keys of the spaces that you want to get along with their related resources. + /// + [JsonPropertyName("space_keys")] + public List? SpaceKeys { get; init; } + + internal void Validate() + { + if (Exclude == null && Include == null && SpaceIds == null && SpaceKeys == null) + { + throw new ArgumentException( + "At least one parameter is required for /spaces/get_related" + ); + } + } + } + + public sealed record GetRelatedResponse + { + /// + /// OK + /// + [JsonPropertyName("batch")] + public Batch? Batch { get; init; } + } + + /// + /// Gets all related resources for one or more Spaces. + /// + public async Task GetRelatedAsync( + GetRelatedRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/spaces/get_related", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Batch + ?? throw new HttpRequestException("Seam returned no batch for /spaces/get_related"); + } + + /// + /// Request parameters for List Spaces. + /// + public sealed record ListRequest + { + /// + /// Customer key for which you want to list spaces. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Maximum number of records to return per page. + /// + [JsonPropertyName("limit")] + public float? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned spaces to include all records that satisfy a partial match using `name`, `space_key`, or `customer_key`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// Filter spaces by space_key. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("spaces")] + public List? Spaces { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all spaces. + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync(HttpMethod.Get, "/spaces/list", request, cancellationToken) + .ConfigureAwait(false); + return response.Spaces + ?? throw new HttpRequestException("Seam returned no spaces for /spaces/list"); + } + + /// Fetches one page of /spaces/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync(HttpMethod.Get, "/spaces/list", request, cancellationToken) + .ConfigureAwait(false); + var items = + response.Spaces + ?? throw new HttpRequestException("Seam returned no spaces for /spaces/list"); + var pagination = + response.Pagination + ?? throw new HttpRequestException("Seam returned no pagination for /spaces/list"); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /spaces/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Remove Entrances from a Space. + /// + public sealed record RemoveAcsEntrancesRequest + { + /// + /// IDs of the entrances that you want to remove from the space. + /// + [JsonPropertyName("acs_entrance_ids")] + public required List AcsEntranceIds { get; init; } + + /// + /// ID of the space from which you want to remove entrances. + /// + [JsonPropertyName("space_id")] + public required string SpaceId { get; init; } + } + + /// + /// Removes [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) from a specific space. + /// + public async Task RemoveAcsEntrancesAsync( + RemoveAcsEntrancesRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/spaces/remove_acs_entrances", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Remove a Connected Account from a Space. + /// + public sealed record RemoveConnectedAccountRequest + { + /// + /// ID of the connected account that you want to remove from the space. + /// + [JsonPropertyName("connected_account_id")] + public required string ConnectedAccountId { get; init; } + + /// + /// ID of the space from which you want to remove the connected account. + /// + [JsonPropertyName("space_id")] + public required string SpaceId { get; init; } + } + + /// + /// Removes a [connected account](https://docs.seam.co/core-concepts/connected-accounts) from a specific space. + /// + public async Task RemoveConnectedAccountAsync( + RemoveConnectedAccountRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/spaces/remove_connected_account", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Remove Devices from a Space. + /// + public sealed record RemoveDevicesRequest + { + /// + /// IDs of the devices that you want to remove from the space. + /// + [JsonPropertyName("device_ids")] + public required List DeviceIds { get; init; } + + /// + /// ID of the space from which you want to remove devices. + /// + [JsonPropertyName("space_id")] + public required string SpaceId { get; init; } + } + + /// + /// Removes devices from a specific space. + /// + public async Task RemoveDevicesAsync( + RemoveDevicesRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/spaces/remove_devices", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update a Space. + /// + public sealed record UpdateRequest + { + /// + /// IDs of the entrances that you want to set for the space. If specified, this will replace all existing entrances. + /// + [JsonPropertyName("acs_entrance_ids")] + public List? AcsEntranceIds { get; init; } + + /// + /// Reservation/stay-related defaults for the space. Only the keys you provide are updated; omit a key to leave it unchanged. Pass null on a key to clear it. + /// + [JsonPropertyName("customer_data")] + public UpdateRequestCustomerData? CustomerData { get; init; } + + /// + /// IDs of the devices that you want to set for the space. If specified, this will replace all existing devices. + /// + [JsonPropertyName("device_ids")] + public List? DeviceIds { get; init; } + + /// + /// Name of the space. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// ID of the space that you want to update. + /// + [JsonPropertyName("space_id")] + public string? SpaceId { get; init; } + + /// + /// Unique key of the space that you want to update. + /// + [JsonPropertyName("space_key")] + public string? SpaceKey { get; init; } + } + + public sealed record UpdateRequestCustomerData + { + /// + /// Postal address for the space. + /// + [JsonPropertyName("address")] + public Optional Address { get; init; } + + /// + /// Default check-in time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkin_time")] + public Optional DefaultCheckinTime { get; init; } + + /// + /// Default check-out time for reservations at the space, as HH:mm or HH:mm:ss. + /// + [JsonPropertyName("default_checkout_time")] + public Optional DefaultCheckoutTime { get; init; } + + /// + /// IANA time zone for the space, e.g. America/Los_Angeles. + /// + [JsonPropertyName("time_zone")] + public Optional TimeZone { get; init; } + } + + public sealed record UpdateResponse + { + /// + /// OK + /// + [JsonPropertyName("space")] + public Space? Space { get; init; } + } + + /// + /// Updates an existing space. + /// + public async Task UpdateAsync( + UpdateRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Patch, + "/spaces/update", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Space + ?? throw new HttpRequestException("Seam returned no space for /spaces/update"); + } + } +} diff --git a/src/Seam/Routes/Thermostats.cs b/src/Seam/Routes/Thermostats.cs new file mode 100644 index 00000000..c27b1f1f --- /dev/null +++ b/src/Seam/Routes/Thermostats.cs @@ -0,0 +1,1350 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class Thermostats + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal Thermostats( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + DailyPrograms = new ThermostatsDailyPrograms(transport, waitForActionAttemptDefault); + Schedules = new ThermostatsSchedules(transport, waitForActionAttemptDefault); + Simulate = new ThermostatsSimulate(transport, waitForActionAttemptDefault); + } + + public ThermostatsDailyPrograms DailyPrograms { get; } + + public ThermostatsSchedules Schedules { get; } + + public ThermostatsSimulate Simulate { get; } + + /// + /// Request parameters for Activate a Climate Preset. + /// + public sealed record ActivateClimatePresetRequest + { + /// + /// Climate preset key of the climate preset that you want to activate. + /// + [JsonPropertyName("climate_preset_key")] + public required string ClimatePresetKey { get; init; } + + /// + /// ID of the thermostat device for which you want to activate a climate preset. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record ActivateClimatePresetResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Activates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task ActivateClimatePresetAsync( + ActivateClimatePresetRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/activate_climate_preset", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /thermostats/activate_climate_preset" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Set to Cool Mode. + /// + public sealed record CoolRequest + { + /// + /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// ID of the thermostat device that you want to set to cool mode. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record CoolResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [cool mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). + /// + public async Task CoolAsync( + CoolRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/cool", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /thermostats/cool" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Create a Climate Preset. + /// + public sealed record CreateClimatePresetRequest + { + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ClimatePresetModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "home")] + Home = 1, + + [EnumMember(Value = "away")] + Away = 2, + + [EnumMember(Value = "wake")] + Wake = 3, + + [EnumMember(Value = "sleep")] + Sleep = 4, + + [EnumMember(Value = "occupied")] + Occupied = 5, + + [EnumMember(Value = "unoccupied")] + Unoccupied = 6, + } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum FanModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum HvacModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "off")] + Off = 1, + + [EnumMember(Value = "heat")] + Heat = 2, + + [EnumMember(Value = "cool")] + Cool = 3, + + [EnumMember(Value = "heat_cool")] + HeatCool = 4, + + [EnumMember(Value = "eco")] + Eco = 5, + } + + /// + /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("climate_preset_key")] + public required string ClimatePresetKey { get; init; } + + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonPropertyName("climate_preset_mode")] + public CreateClimatePresetRequest.ClimatePresetModeEnum? ClimatePresetMode { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// ID of the thermostat device for which you want create a climate preset. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Metadata specific to the Ecobee climate, if applicable. + /// + [JsonPropertyName("ecobee_metadata")] + public CreateClimatePresetRequestEcobeeMetadata? EcobeeMetadata { get; init; } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonPropertyName("fan_mode_setting")] + public CreateClimatePresetRequest.FanModeSettingEnum? FanModeSetting { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonPropertyName("hvac_mode_setting")] + public CreateClimatePresetRequest.HvacModeSettingEnum? HvacModeSetting { get; init; } + + /// + /// Indicates whether a person at the thermostat or using the API can change the thermostat's settings. + /// + [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] + [JsonPropertyName("manual_override_allowed")] + public bool? ManualOverrideAllowed { get; init; } + + /// + /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("name")] + public Optional Name { get; init; } + } + + public sealed record CreateClimatePresetRequestEcobeeMetadata + { + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum OwnerEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "user")] + User = 1, + + [EnumMember(Value = "system")] + System = 2, + } + + /// + /// Reference to the Ecobee climate, if applicable. + /// + [JsonPropertyName("climate_ref")] + public string? ClimateRef { get; init; } + + /// + /// Indicates if the climate preset is optimized by Ecobee. + /// + [JsonPropertyName("is_optimized")] + public bool? IsOptimized { get; init; } + + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonPropertyName("owner")] + public CreateClimatePresetRequestEcobeeMetadata.OwnerEnum? Owner { get; init; } + } + + /// + /// Creates a [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task CreateClimatePresetAsync( + CreateClimatePresetRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/create_climate_preset", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Delete a Climate Preset. + /// + public sealed record DeleteClimatePresetRequest + { + /// + /// Climate preset key of the climate preset that you want to delete. + /// + [JsonPropertyName("climate_preset_key")] + public required string ClimatePresetKey { get; init; } + + /// + /// ID of the thermostat device for which you want to delete a climate preset. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + /// + /// Deletes a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task DeleteClimatePresetAsync( + DeleteClimatePresetRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/thermostats/delete_climate_preset", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Set to Heat Mode. + /// + public sealed record HeatRequest + { + /// + /// ID of the thermostat device that you want to set to heat mode. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + } + + public sealed record HeatResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). + /// + public async Task HeatAsync( + HeatRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/heat", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /thermostats/heat" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Set to Heat-Cool (Auto) Mode. + /// + public sealed record HeatCoolRequest + { + /// + /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// ID of the thermostat device that you want to set to heat-cool mode. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + } + + public sealed record HeatCoolResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat-cool ("auto") mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). + /// + public async Task HeatCoolAsync( + HeatCoolRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/heat_cool", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /thermostats/heat_cool" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for List Thermostats. + /// + public sealed record ListRequest + { + /// + /// Device type by which you want to filter thermostat devices. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "ecobee_thermostat")] + EcobeeThermostat = 1, + + [EnumMember(Value = "nest_thermostat")] + NestThermostat = 2, + + [EnumMember(Value = "honeywell_resideo_thermostat")] + HoneywellResideoThermostat = 3, + + [EnumMember(Value = "tado_thermostat")] + TadoThermostat = 4, + + [EnumMember(Value = "sensi_thermostat")] + SensiThermostat = 5, + + [EnumMember(Value = "smartthings_thermostat")] + SmartthingsThermostat = 6, + } + + /// + /// Array of device types by which you want to filter thermostat devices. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum DeviceTypesEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "ecobee_thermostat")] + EcobeeThermostat = 1, + + [EnumMember(Value = "nest_thermostat")] + NestThermostat = 2, + + [EnumMember(Value = "honeywell_resideo_thermostat")] + HoneywellResideoThermostat = 3, + + [EnumMember(Value = "tado_thermostat")] + TadoThermostat = 4, + + [EnumMember(Value = "sensi_thermostat")] + SensiThermostat = 5, + + [EnumMember(Value = "smartthings_thermostat")] + SmartthingsThermostat = 6, + } + + /// + /// Manufacturer by which you want to filter thermostat devices. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ManufacturerEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "ecobee")] + Ecobee = 1, + + [EnumMember(Value = "honeywell_resideo")] + HoneywellResideo = 2, + + [EnumMember(Value = "nest")] + Nest = 3, + + [EnumMember(Value = "sensi")] + Sensi = 4, + + [EnumMember(Value = "smartthings")] + Smartthings = 5, + + [EnumMember(Value = "tado")] + Tado = 6, + } + + /// + /// ID of the Connect Webview for which you want to list devices. + /// + [JsonPropertyName("connect_webview_id")] + public string? ConnectWebviewId { get; init; } + + /// + /// ID of the connected account for which you want to list devices. + /// + [JsonPropertyName("connected_account_id")] + public string? ConnectedAccountId { get; init; } + + /// + /// Customer key for which you want to list devices. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + + /// + /// Device type by which you want to filter thermostat devices. + /// + [JsonPropertyName("device_type")] + public ListRequest.DeviceTypeEnum? DeviceType { get; init; } + + /// + /// Array of device types by which you want to filter thermostat devices. + /// + [JsonPropertyName("device_types")] + public List? DeviceTypes { get; init; } + + /// + /// Manufacturer by which you want to filter thermostat devices. + /// + [JsonPropertyName("manufacturer")] + public ListRequest.ManufacturerEnum? Manufacturer { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("devices")] + public List? Devices { get; init; } + } + + /// + /// Returns a list of all [thermostats](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/thermostats/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Devices + ?? throw new HttpRequestException("Seam returned no devices for /thermostats/list"); + } + + /// + /// Request parameters for Set to Off Mode. + /// + public sealed record OffRequest + { + /// + /// ID of the thermostat device that you want to set to off mode. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + public sealed record OffResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to ["off" mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). + /// + public async Task OffAsync( + OffRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/off", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /thermostats/off" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Set the Fallback Climate Preset. + /// + public sealed record SetFallbackClimatePresetRequest + { + /// + /// Climate preset key of the climate preset that you want to set as the fallback climate preset. + /// + [JsonPropertyName("climate_preset_key")] + public required string ClimatePresetKey { get; init; } + + /// + /// ID of the thermostat device for which you want to set the fallback climate preset. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + } + + /// + /// Sets a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) as the ["fallback"](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) preset for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task SetFallbackClimatePresetAsync( + SetFallbackClimatePresetRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/set_fallback_climate_preset", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Set the Fan Mode Setting. + /// + public sealed record SetFanModeRequest + { + /// + /// Fan mode setting for the thermostat, such as `auto`, `on`, or `circulate`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum FanModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// [Fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) that you want to set for the thermostat. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum FanModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// ID of the thermostat device for which you want to set the fan mode. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Fan mode setting for the thermostat, such as `auto`, `on`, or `circulate`. + /// + [Obsolete("Use `fan_mode_setting` instead.")] + [JsonPropertyName("fan_mode")] + public SetFanModeRequest.FanModeEnum? FanMode { get; init; } + + /// + /// [Fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) that you want to set for the thermostat. + /// + [JsonPropertyName("fan_mode_setting")] + public SetFanModeRequest.FanModeSettingEnum? FanModeSetting { get; init; } + } + + public sealed record SetFanModeResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Sets the [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task SetFanModeAsync( + SetFanModeRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/set_fan_mode", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /thermostats/set_fan_mode" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Set the HVAC Mode. + /// + public sealed record SetHvacModeRequest + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum HvacModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "off")] + Off = 1, + + [EnumMember(Value = "cool")] + Cool = 2, + + [EnumMember(Value = "heat")] + Heat = 3, + + [EnumMember(Value = "heat_cool")] + HeatCool = 4, + + [EnumMember(Value = "eco")] + Eco = 5, + } + + /// + /// ID of the thermostat device for which you want to set the HVAC mode. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + [JsonPropertyName("hvac_mode_setting")] + public required SetHvacModeRequest.HvacModeSettingEnum HvacModeSetting { get; init; } + + /// + /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + } + + public sealed record SetHvacModeResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Sets the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task SetHvacModeAsync( + SetHvacModeRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/set_hvac_mode", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /thermostats/set_hvac_mode" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Set a Temperature Threshold. + /// + public sealed record SetTemperatureThresholdRequest + { + /// + /// ID of the thermostat device for which you want to set a temperature threshold. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Lower temperature limit in in °C. Seam alerts you if the reported temperature is lower than this value. You can specify either `lower_limit` but not both. + /// + [JsonPropertyName("lower_limit_celsius")] + public Optional LowerLimitCelsius { get; init; } + + /// + /// Lower temperature limit in in °F. Seam alerts you if the reported temperature is lower than this value. You can specify either `lower_limit` but not both. + /// + [JsonPropertyName("lower_limit_fahrenheit")] + public Optional LowerLimitFahrenheit { get; init; } + + /// + /// Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either `upper_limit` but not both. + /// + [JsonPropertyName("upper_limit_celsius")] + public Optional UpperLimitCelsius { get; init; } + + /// + /// Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either `upper_limit` but not both. + /// + [JsonPropertyName("upper_limit_fahrenheit")] + public Optional UpperLimitFahrenheit { get; init; } + } + + /// + /// Sets a [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) for a specified thermostat. Seam emits a `thermostat.temperature_threshold_exceeded` event and adds a warning on a thermostat if it reports a temperature outside the threshold range. + /// + public async Task SetTemperatureThresholdAsync( + SetTemperatureThresholdRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/thermostats/set_temperature_threshold", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update a Climate Preset. + /// + public sealed record UpdateClimatePresetRequest + { + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ClimatePresetModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "home")] + Home = 1, + + [EnumMember(Value = "away")] + Away = 2, + + [EnumMember(Value = "wake")] + Wake = 3, + + [EnumMember(Value = "sleep")] + Sleep = 4, + + [EnumMember(Value = "occupied")] + Occupied = 5, + + [EnumMember(Value = "unoccupied")] + Unoccupied = 6, + } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum FanModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "auto")] + Auto = 1, + + [EnumMember(Value = "on")] + On = 2, + + [EnumMember(Value = "circulate")] + Circulate = 3, + } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum HvacModeSettingEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "off")] + Off = 1, + + [EnumMember(Value = "heat")] + Heat = 2, + + [EnumMember(Value = "cool")] + Cool = 3, + + [EnumMember(Value = "heat_cool")] + HeatCool = 4, + + [EnumMember(Value = "eco")] + Eco = 5, + } + + /// + /// Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("climate_preset_key")] + public required string ClimatePresetKey { get; init; } + + /// + /// The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + /// + [JsonPropertyName("climate_preset_mode")] + public UpdateClimatePresetRequest.ClimatePresetModeEnum? ClimatePresetMode { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// ID of the thermostat device for which you want to update a climate preset. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Metadata specific to the Ecobee climate, if applicable. + /// + [JsonPropertyName("ecobee_metadata")] + public UpdateClimatePresetRequestEcobeeMetadata? EcobeeMetadata { get; init; } + + /// + /// Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + /// + [JsonPropertyName("fan_mode_setting")] + public UpdateClimatePresetRequest.FanModeSettingEnum? FanModeSetting { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + + /// + /// Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + /// + [JsonPropertyName("hvac_mode_setting")] + public UpdateClimatePresetRequest.HvacModeSettingEnum? HvacModeSetting { get; init; } + + /// + /// Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [Obsolete("Use 'thermostat_schedule.is_override_allowed'")] + [JsonPropertyName("manual_override_allowed")] + public bool? ManualOverrideAllowed { get; init; } + + /// + /// User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + /// + [JsonPropertyName("name")] + public Optional Name { get; init; } + } + + public sealed record UpdateClimatePresetRequestEcobeeMetadata + { + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum OwnerEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "user")] + User = 1, + + [EnumMember(Value = "system")] + System = 2, + } + + /// + /// Reference to the Ecobee climate, if applicable. + /// + [JsonPropertyName("climate_ref")] + public string? ClimateRef { get; init; } + + /// + /// Indicates if the climate preset is optimized by Ecobee. + /// + [JsonPropertyName("is_optimized")] + public bool? IsOptimized { get; init; } + + /// + /// Indicates whether the climate preset is owned by the user or the system. + /// + [JsonPropertyName("owner")] + public UpdateClimatePresetRequestEcobeeMetadata.OwnerEnum? Owner { get; init; } + } + + /// + /// Updates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task UpdateClimatePresetAsync( + UpdateClimatePresetRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/thermostats/update_climate_preset", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update the Thermostat Weekly Program. + /// + public sealed record UpdateWeeklyProgramRequest + { + /// + /// ID of the thermostat device for which you want to update the weekly program. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// ID of the thermostat daily program to run on Fridays. + /// + [JsonPropertyName("friday_program_id")] + public Optional FridayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Mondays. + /// + [JsonPropertyName("monday_program_id")] + public Optional MondayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Saturdays. + /// + [JsonPropertyName("saturday_program_id")] + public Optional SaturdayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Sundays. + /// + [JsonPropertyName("sunday_program_id")] + public Optional SundayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Thursdays. + /// + [JsonPropertyName("thursday_program_id")] + public Optional ThursdayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Tuesdays. + /// + [JsonPropertyName("tuesday_program_id")] + public Optional TuesdayProgramId { get; init; } + + /// + /// ID of the thermostat daily program to run on Wednesdays. + /// + [JsonPropertyName("wednesday_program_id")] + public Optional WednesdayProgramId { get; init; } + } + + public sealed record UpdateWeeklyProgramResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Updates the thermostat weekly program for a thermostat device. To configure a weekly program, specify the ID of the daily program that you want to use for each day of the week. When you update a weekly program, the set of programs that you specify overwrites any previous weekly program for the thermostat. + /// + public async Task UpdateWeeklyProgramAsync( + UpdateWeeklyProgramRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/update_weekly_program", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /thermostats/update_weekly_program" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/ThermostatsDailyPrograms.cs b/src/Seam/Routes/ThermostatsDailyPrograms.cs new file mode 100644 index 00000000..875d3de1 --- /dev/null +++ b/src/Seam/Routes/ThermostatsDailyPrograms.cs @@ -0,0 +1,208 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class ThermostatsDailyPrograms + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal ThermostatsDailyPrograms( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Create a Thermostat Daily Program. + /// + public sealed record CreateRequest + { + /// + /// ID of the thermostat device for which you want to create a daily program. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Name of the thermostat daily program. + /// + [JsonPropertyName("name")] + public required string Name { get; init; } + + /// + /// Array of thermostat daily program periods. + /// + [JsonPropertyName("periods")] + public required List Periods { get; init; } + } + + public sealed record CreateRequestPeriods + { + /// + /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to activate at the `starts_at_time`. + /// + [JsonPropertyName("climate_preset_key")] + public string? ClimatePresetKey { get; init; } + + /// + /// Time at which the thermostat daily program period starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at_time")] + public string? StartsAtTime { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("thermostat_daily_program")] + public ThermostatDailyProgram? ThermostatDailyProgram { get; init; } + } + + /// + /// Creates a new thermostat daily program. A daily program consists of a set of periods, where each period includes a start time and the key of a configured climate preset. Once you have defined a daily program, you can assign it to one or more days within a weekly program. + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/daily_programs/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ThermostatDailyProgram + ?? throw new HttpRequestException( + "Seam returned no thermostat_daily_program for /thermostats/daily_programs/create" + ); + } + + /// + /// Request parameters for Delete a Thermostat Daily Program. + /// + public sealed record DeleteRequest + { + /// + /// ID of the thermostat daily program that you want to delete. + /// + [JsonPropertyName("thermostat_daily_program_id")] + public required string ThermostatDailyProgramId { get; init; } + } + + /// + /// Deletes a thermostat daily program. + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/thermostats/daily_programs/delete", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update a Thermostat Daily Program. + /// + public sealed record UpdateRequest + { + /// + /// Name of the thermostat daily program that you want to update. + /// + [JsonPropertyName("name")] + public required string Name { get; init; } + + /// + /// Array of thermostat daily program periods. The periods that you specify overwrite any existing periods for the daily program. + /// + [JsonPropertyName("periods")] + public required List Periods { get; init; } + + /// + /// ID of the thermostat daily program that you want to update. + /// + [JsonPropertyName("thermostat_daily_program_id")] + public required string ThermostatDailyProgramId { get; init; } + } + + public sealed record UpdateRequestPeriods + { + /// + /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to activate at the `starts_at_time`. + /// + [JsonPropertyName("climate_preset_key")] + public string? ClimatePresetKey { get; init; } + + /// + /// Time at which the thermostat daily program period starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at_time")] + public string? StartsAtTime { get; init; } + } + + public sealed record UpdateResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Updates a specified thermostat daily program. The periods that you specify overwrite any existing periods for the daily program. + /// + public async Task UpdateAsync( + UpdateRequest request, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Patch, + "/thermostats/daily_programs/update", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /thermostats/daily_programs/update" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/ThermostatsSchedules.cs b/src/Seam/Routes/ThermostatsSchedules.cs new file mode 100644 index 00000000..8f465ef1 --- /dev/null +++ b/src/Seam/Routes/ThermostatsSchedules.cs @@ -0,0 +1,295 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class ThermostatsSchedules + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal ThermostatsSchedules( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Create a Thermostat Schedule. + /// + public sealed record CreateRequest + { + /// + /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the new thermostat schedule. + /// + [JsonPropertyName("climate_preset_key")] + public required string ClimatePresetKey { get; init; } + + /// + /// ID of the thermostat device for which you want to create a schedule. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Date and time at which the new thermostat schedule ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("ends_at")] + public required string EndsAt { get; init; } + + /// + /// Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the new schedule is active. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [JsonPropertyName("is_override_allowed")] + public bool? IsOverrideAllowed { get; init; } + + /// + /// Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [JsonPropertyName("max_override_period_minutes")] + public Optional MaxOverridePeriodMinutes { get; init; } + + /// + /// Name of the thermostat schedule. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Date and time at which the new thermostat schedule starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public required string StartsAt { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("thermostat_schedule")] + public ThermostatSchedule? ThermostatSchedule { get; init; } + } + + /// + /// Creates a new [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/schedules/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ThermostatSchedule + ?? throw new HttpRequestException( + "Seam returned no thermostat_schedule for /thermostats/schedules/create" + ); + } + + /// + /// Request parameters for Delete a Thermostat Schedule. + /// + public sealed record DeleteRequest + { + /// + /// ID of the thermostat schedule that you want to delete. + /// + [JsonPropertyName("thermostat_schedule_id")] + public required string ThermostatScheduleId { get; init; } + } + + /// + /// Deletes a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/thermostats/schedules/delete", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Thermostat Schedule. + /// + public sealed record GetRequest + { + /// + /// ID of the thermostat schedule that you want to get. + /// + [JsonPropertyName("thermostat_schedule_id")] + public required string ThermostatScheduleId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("thermostat_schedule")] + public ThermostatSchedule? ThermostatSchedule { get; init; } + } + + /// + /// Returns a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/thermostats/schedules/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ThermostatSchedule + ?? throw new HttpRequestException( + "Seam returned no thermostat_schedule for /thermostats/schedules/get" + ); + } + + /// + /// Request parameters for List Thermostat Schedules. + /// + public sealed record ListRequest + { + /// + /// ID of the thermostat device for which you want to list schedules. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// User identifier key by which to filter the list of returned thermostat schedules. + /// + [JsonPropertyName("user_identifier_key")] + public string? UserIdentifierKey { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("thermostat_schedules")] + public List? ThermostatSchedules { get; init; } + } + + /// + /// Returns a list of all [thermostat schedules](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + /// + public async Task> ListAsync( + ListRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/thermostats/schedules/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.ThermostatSchedules + ?? throw new HttpRequestException( + "Seam returned no thermostat_schedules for /thermostats/schedules/list" + ); + } + + /// + /// Request parameters for Update a Thermostat Schedule. + /// + public sealed record UpdateRequest + { + /// + /// Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the thermostat schedule. + /// + [JsonPropertyName("climate_preset_key")] + public string? ClimatePresetKey { get; init; } + + /// + /// Date and time at which the thermostat schedule ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("ends_at")] + public string? EndsAt { get; init; } + + /// + /// Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the schedule is active. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [JsonPropertyName("is_override_allowed")] + public bool? IsOverrideAllowed { get; init; } + + /// + /// Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + /// + [JsonPropertyName("max_override_period_minutes")] + public Optional MaxOverridePeriodMinutes { get; init; } + + /// + /// Name of the thermostat schedule. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// Date and time at which the thermostat schedule starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// + [JsonPropertyName("starts_at")] + public string? StartsAt { get; init; } + + /// + /// ID of the thermostat schedule that you want to update. + /// + [JsonPropertyName("thermostat_schedule_id")] + public required string ThermostatScheduleId { get; init; } + } + + /// + /// Updates a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/thermostats/schedules/update", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/ThermostatsSimulate.cs b/src/Seam/Routes/ThermostatsSimulate.cs new file mode 100644 index 00000000..533cf2fc --- /dev/null +++ b/src/Seam/Routes/ThermostatsSimulate.cs @@ -0,0 +1,152 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class ThermostatsSimulate + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal ThermostatsSimulate( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for HVAC Mode Adjusted. + /// + public sealed record HvacModeAdjustedRequest + { + /// + /// HVAC mode that you want to simulate. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum HvacModeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "off")] + Off = 1, + + [EnumMember(Value = "cool")] + Cool = 2, + + [EnumMember(Value = "heat")] + Heat = 3, + + [EnumMember(Value = "heat_cool")] + HeatCool = 4, + } + + /// + /// ID of the thermostat device for which you want to simulate having adjusted the HVAC mode. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// HVAC mode that you want to simulate. + /// + [JsonPropertyName("hvac_mode")] + public required HvacModeAdjustedRequest.HvacModeEnum HvacMode { get; init; } + + /// + /// Cooling [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to simulate. You must set `cooling_set_point_celsius` or `cooling_set_point_fahrenheit`. + /// + [JsonPropertyName("cooling_set_point_celsius")] + public float? CoolingSetPointCelsius { get; init; } + + /// + /// Cooling [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to simulate. You must set `cooling_set_point_fahrenheit` or `cooling_set_point_celsius`. + /// + [JsonPropertyName("cooling_set_point_fahrenheit")] + public float? CoolingSetPointFahrenheit { get; init; } + + /// + /// Heating [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to simulate. You must set `heating_set_point_celsius` or `heating_set_point_fahrenheit`. + /// + [JsonPropertyName("heating_set_point_celsius")] + public float? HeatingSetPointCelsius { get; init; } + + /// + /// Heating [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to simulate. You must set `heating_set_point_fahrenheit` or `heating_set_point_celsius`. + /// + [JsonPropertyName("heating_set_point_fahrenheit")] + public float? HeatingSetPointFahrenheit { get; init; } + } + + /// + /// Simulates having adjusted the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) for a [thermostat](https://docs.seam.co/capability-guides/thermostats). Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). + /// + public async Task HvacModeAdjustedAsync( + HvacModeAdjustedRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/simulate/hvac_mode_adjusted", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Temperature Reached. + /// + public sealed record TemperatureReachedRequest + { + /// + /// ID of the thermostat device that you want to simulate reaching a specified temperature. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// Temperature in °C that you want simulate the thermostat reaching. You must set `temperature_celsius` or `temperature_fahrenheit`. + /// + [JsonPropertyName("temperature_celsius")] + public float? TemperatureCelsius { get; init; } + + /// + /// Temperature in °F that you want simulate the thermostat reaching. You must set `temperature_fahrenheit` or `temperature_celsius`. + /// + [JsonPropertyName("temperature_fahrenheit")] + public float? TemperatureFahrenheit { get; init; } + } + + /// + /// Simulates a [thermostat](https://docs.seam.co/capability-guides/thermostats) reaching a specified temperature. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints). + /// + public async Task TemperatureReachedAsync( + TemperatureReachedRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Post, + "/thermostats/simulate/temperature_reached", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/UserIdentities.cs b/src/Seam/Routes/UserIdentities.cs new file mode 100644 index 00000000..f2813941 --- /dev/null +++ b/src/Seam/Routes/UserIdentities.cs @@ -0,0 +1,795 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class UserIdentities + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal UserIdentities( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + Unmanaged = new UserIdentitiesUnmanaged(transport, waitForActionAttemptDefault); + } + + public UserIdentitiesUnmanaged Unmanaged { get; } + + /// + /// Request parameters for Add an ACS User to a User Identity. + /// + public sealed record AddAcsUserRequest + { + /// + /// ID of the access system user that you want to add to the user identity. + /// + [JsonPropertyName("acs_user_id")] + public required string AcsUserId { get; init; } + + /// + /// ID of the user identity to which you want to add an access system user. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Key of the user identity to which you want to add an access system user. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + } + + /// + /// Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + /// You must specify either `user_identity_id` or `user_identity_key` to identify the user identity. + /// + /// If `user_identity_key` is provided, but the user identity doesn't exist, a new user identity will be created automatically using information from the ACS user. + /// + public async Task AddAcsUserAsync( + AddAcsUserRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Put, + "/user_identities/add_acs_user", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Create a User Identity. + /// + public sealed record CreateRequest + { + /// + /// List of access system IDs to associate with the new user identity through access system users. If there's no user with the same email address or phone number in the specified access systems, a new access system user is created. If there is an existing user with the same email or phone number in the specified access systems, the user is linked to the user identity. + /// + [JsonPropertyName("acs_system_ids")] + public List? AcsSystemIds { get; init; } + + /// + /// Unique email address for the new user identity. + /// + [JsonPropertyName("email_address")] + public Optional EmailAddress { get; init; } + + /// + /// Full name of the user associated with the new user identity. + /// + [JsonPropertyName("full_name")] + public Optional FullName { get; init; } + + /// + /// Unique phone number for the new user identity in E.164 format (for example, +15555550100). + /// + [JsonPropertyName("phone_number")] + public Optional PhoneNumber { get; init; } + + /// + /// Unique key for the new user identity. + /// + [JsonPropertyName("user_identity_key")] + public Optional UserIdentityKey { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("user_identity")] + public UserIdentity? UserIdentity { get; init; } + } + + /// + /// Creates a new [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + public async Task CreateAsync( + CreateRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/user_identities/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.UserIdentity + ?? throw new HttpRequestException( + "Seam returned no user_identity for /user_identities/create" + ); + } + + /// + /// Request parameters for Delete a User Identity. + /// + public sealed record DeleteRequest + { + /// + /// ID of the user identity that you want to delete. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + /// + /// Deletes a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This deletes the user identity and all associated resources, including any [credentials](https://docs.seam.co/api/acs/credentials), [acs users](https://docs.seam.co/api/acs/users) and [client sessions](https://docs.seam.co/api/client_sessions). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/user_identities/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Generate an Instant Key. + /// + public sealed record GenerateInstantKeyRequest + { + [JsonPropertyName("customization_profile_id")] + public string? CustomizationProfileId { get; init; } + + /// + /// Maximum number of times the instant key can be used. Default: 1. + /// + [JsonPropertyName("max_use_count")] + public float? MaxUseCount { get; init; } + + /// + /// ID of the user identity for which you want to generate an instant key. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + public sealed record GenerateInstantKeyResponse + { + /// + /// OK + /// + [JsonPropertyName("instant_key")] + public InstantKey? InstantKey { get; init; } + } + + /// + /// Generates a new [instant key](https://docs.seam.co/capability-guides/instant-keys) for a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + public async Task GenerateInstantKeyAsync( + GenerateInstantKeyRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/user_identities/generate_instant_key", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.InstantKey + ?? throw new HttpRequestException( + "Seam returned no instant_key for /user_identities/generate_instant_key" + ); + } + + /// + /// Request parameters for Get a User Identity. + /// + public sealed record GetRequest + { + /// + /// ID of the user identity that you want to get. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + + internal void Validate() + { + if (UserIdentityId == null && UserIdentityKey == null) + { + throw new ArgumentException( + "At least one parameter is required for /user_identities/get" + ); + } + } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("user_identity")] + public UserIdentity? UserIdentity { get; init; } + } + + /// + /// Returns a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.UserIdentity + ?? throw new HttpRequestException( + "Seam returned no user_identity for /user_identities/get" + ); + } + + /// + /// Request parameters for Grant a User Identity Access to a Device. + /// + public sealed record GrantAccessToDeviceRequest + { + /// + /// ID of the managed device to which you want to grant access to the user identity. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// ID of the user identity that you want to grant access to a device. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + /// + /// Grants a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) access to a specified [device](https://docs.seam.co/core-concepts/devices/). + /// + public async Task GrantAccessToDeviceAsync( + GrantAccessToDeviceRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Put, + "/user_identities/grant_access_to_device", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for List User Identities. + /// + public sealed record ListRequest + { + /// + /// Timestamp by which to limit returned user identities. Returns user identities created before this timestamp. + /// + [JsonPropertyName("created_before")] + public string? CreatedBefore { get; init; } + + /// + /// `acs_system_id` of the credential manager by which you want to filter the list of user identities. + /// + [JsonPropertyName("credential_manager_acs_system_id")] + public string? CredentialManagerAcsSystemId { get; init; } + + /// + /// Maximum number of records to return per page. + /// + [JsonPropertyName("limit")] + public int? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned user identities to include all records that satisfy a partial match using `full_name`, `phone_number`, `email_address` or `user_identity_id`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + + /// + /// Array of user identity IDs by which to filter the list of user identities. + /// + [JsonPropertyName("user_identity_ids")] + public List? UserIdentityIds { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("user_identities")] + public List? UserIdentities { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.UserIdentities + ?? throw new HttpRequestException( + "Seam returned no user_identities for /user_identities/list" + ); + } + + /// Fetches one page of /user_identities/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.UserIdentities + ?? throw new HttpRequestException( + "Seam returned no user_identities for /user_identities/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /user_identities/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /user_identities/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for List Accessible Devices for a User Identity. + /// + public sealed record ListAccessibleDevicesRequest + { + /// + /// ID of the user identity for which you want to retrieve all accessible devices. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + public sealed record ListAccessibleDevicesResponse + { + /// + /// OK + /// + [JsonPropertyName("devices")] + public List? Devices { get; init; } + } + + /// + /// Returns a list of all [devices](https://docs.seam.co/core-concepts/devices) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes devices derived from the access grants assigned to the user identity and devices directly linked to the user identity. + /// + public async Task> ListAccessibleDevicesAsync( + ListAccessibleDevicesRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/list_accessible_devices", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Devices + ?? throw new HttpRequestException( + "Seam returned no devices for /user_identities/list_accessible_devices" + ); + } + + /// + /// Request parameters for List Accessible Entrances for a User Identity. + /// + public sealed record ListAccessibleEntrancesRequest + { + /// + /// ID of the user identity for which you want to retrieve all accessible entrances. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + public sealed record ListAccessibleEntrancesResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_entrances")] + public List? AcsEntrances { get; init; } + } + + /// + /// Returns a list of all [ACS entrances](https://docs.seam.co/api/acs/entrances) accessible to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This includes entrances derived from the access grants assigned to the user identity and entrances accessible through ACS users linked to the user identity. + /// + public async Task> ListAccessibleEntrancesAsync( + ListAccessibleEntrancesRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/list_accessible_entrances", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsEntrances + ?? throw new HttpRequestException( + "Seam returned no acs_entrances for /user_identities/list_accessible_entrances" + ); + } + + /// + /// Request parameters for List ACS Systems Associated with a User Identity. + /// + public sealed record ListAcsSystemsRequest + { + /// + /// ID of the user identity for which you want to retrieve all access systems. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + public sealed record ListAcsSystemsResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_systems")] + public List? AcsSystems { get; init; } + } + + /// + /// Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + public async Task> ListAcsSystemsAsync( + ListAcsSystemsRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/list_acs_systems", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsSystems + ?? throw new HttpRequestException( + "Seam returned no acs_systems for /user_identities/list_acs_systems" + ); + } + + /// + /// Request parameters for List ACS Users Associated with a User Identity. + /// + public sealed record ListAcsUsersRequest + { + /// + /// ID of the user identity for which you want to retrieve all access system users. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + public sealed record ListAcsUsersResponse + { + /// + /// OK + /// + [JsonPropertyName("acs_users")] + public List? AcsUsers { get; init; } + } + + /// + /// Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) assigned to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + public async Task> ListAcsUsersAsync( + ListAcsUsersRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/list_acs_users", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.AcsUsers + ?? throw new HttpRequestException( + "Seam returned no acs_users for /user_identities/list_acs_users" + ); + } + + /// + /// Request parameters for Merge User Identities. + /// + public sealed record MergeRequest + { + /// + /// IDs of the user identities to merge into the primary user identity. These user identities are deleted. + /// + [JsonPropertyName("merged_user_identity_ids")] + public List? MergedUserIdentityIds { get; init; } + + /// + /// ID of the primary user identity to keep. + /// + [JsonPropertyName("user_identity_id")] + public string? UserIdentityId { get; init; } + + /// + /// Keys of the user identities to merge into the primary user identity. These user identities are deleted. + /// + [JsonPropertyName("merged_user_identity_keys")] + public List? MergedUserIdentityKeys { get; init; } + + /// + /// Key of the primary user identity to keep. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + + internal void Validate() + { + if ( + MergedUserIdentityIds == null + && UserIdentityId == null + && MergedUserIdentityKeys == null + && UserIdentityKey == null + ) + { + throw new ArgumentException( + "At least one parameter is required for /user_identities/merge" + ); + } + } + } + + /// + /// Merges one or more [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) into a primary user identity, for when the same person ended up with more than one user identity. + /// + /// The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as `merged_user_identity_ids` and `merged_user_identity_keys`. + /// + /// Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. + /// + /// Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes. + /// + public async Task MergeAsync( + MergeRequest request, + CancellationToken cancellationToken = default + ) + { + request.Validate(); + await _transport + .SendAsync(HttpMethod.Post, "/user_identities/merge", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Remove an ACS User from a User Identity. + /// + public sealed record RemoveAcsUserRequest + { + /// + /// ID of the access system user that you want to remove from the user identity.. + /// + [JsonPropertyName("acs_user_id")] + public required string AcsUserId { get; init; } + + /// + /// ID of the user identity from which you want to remove an access system user. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + /// + /// Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + public async Task RemoveAcsUserAsync( + RemoveAcsUserRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/user_identities/remove_acs_user", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Revoke Access to a Device from a User Identity. + /// + public sealed record RevokeAccessToDeviceRequest + { + /// + /// ID of the managed device to which you want to revoke access from the user identity. + /// + [JsonPropertyName("device_id")] + public required string DeviceId { get; init; } + + /// + /// ID of the user identity from which you want to revoke access to a device. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + /// + /// Revokes access to a specified [device](https://docs.seam.co/core-concepts/devices/) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + public async Task RevokeAccessToDeviceAsync( + RevokeAccessToDeviceRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Delete, + "/user_identities/revoke_access_to_device", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update a User Identity. + /// + public sealed record UpdateRequest + { + /// + /// Unique email address for the user identity. + /// + [JsonPropertyName("email_address")] + public Optional EmailAddress { get; init; } + + /// + /// Full name of the user associated with the user identity. + /// + [JsonPropertyName("full_name")] + public Optional FullName { get; init; } + + /// + /// Unique phone number for the user identity. + /// + [JsonPropertyName("phone_number")] + public Optional PhoneNumber { get; init; } + + /// + /// ID of the user identity that you want to update. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + + /// + /// Unique key for the user identity. + /// + [JsonPropertyName("user_identity_key")] + public Optional UserIdentityKey { get; init; } + } + + /// + /// Updates a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Patch, "/user_identities/update", request, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/UserIdentitiesUnmanaged.cs b/src/Seam/Routes/UserIdentitiesUnmanaged.cs new file mode 100644 index 00000000..15134de3 --- /dev/null +++ b/src/Seam/Routes/UserIdentitiesUnmanaged.cs @@ -0,0 +1,226 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class UserIdentitiesUnmanaged + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal UserIdentitiesUnmanaged( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Get an Unmanaged User Identity. + /// + public sealed record GetRequest + { + /// + /// ID of the unmanaged user identity that you want to get. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("user_identity")] + public UnmanagedUserIdentity? UserIdentity { get; init; } + } + + /// + /// Returns a specified unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/unmanaged/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.UserIdentity + ?? throw new HttpRequestException( + "Seam returned no user_identity for /user_identities/unmanaged/get" + ); + } + + /// + /// Request parameters for List Unmanaged User Identities. + /// + public sealed record ListRequest + { + /// + /// Timestamp by which to limit returned unmanaged user identities. Returns user identities created before this timestamp. + /// + [JsonPropertyName("created_before")] + public string? CreatedBefore { get; init; } + + /// + /// Maximum number of records to return per page. + /// + [JsonPropertyName("limit")] + public int? Limit { get; init; } + + /// + /// Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. + /// + [JsonPropertyName("page_cursor")] + public Optional PageCursor { get; init; } + + /// + /// String for which to search. Filters returned unmanaged user identities to include all records that satisfy a partial match using `full_name`, `phone_number`, `email_address`, `user_identity_id` or `acs_system_id`. + /// + [JsonPropertyName("search")] + public string? Search { get; init; } + } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("user_identities")] + public List? UserIdentities { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } + } + + /// + /// Returns a list of all unmanaged [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/unmanaged/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.UserIdentities + ?? throw new HttpRequestException( + "Seam returned no user_identities for /user_identities/unmanaged/list" + ); + } + + /// Fetches one page of /user_identities/unmanaged/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/user_identities/unmanaged/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + var items = + response.UserIdentities + ?? throw new HttpRequestException( + "Seam returned no user_identities for /user_identities/unmanaged/list" + ); + var pagination = + response.Pagination + ?? throw new HttpRequestException( + "Seam returned no pagination for /user_identities/unmanaged/list" + ); + return new SeamPage(items, pagination); + } + + /// Creates a paginator over /user_identities/unmanaged/list. + public SeamPaginator ListPager(ListRequest? request = null) + { + return new SeamPaginator( + (pageCursor, cancellationToken) => + ListPageAsync( + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, + cancellationToken + ) + ); + } + + /// + /// Request parameters for Update an Unmanaged User Identity. + /// + public sealed record UpdateRequest + { + /// + /// Must be set to true to convert the unmanaged user identity to managed. + /// + [JsonPropertyName("is_managed")] + public required bool IsManaged { get; init; } + + /// + /// ID of the unmanaged user identity that you want to update. + /// + [JsonPropertyName("user_identity_id")] + public required string UserIdentityId { get; init; } + + /// + /// Unique key for the user identity. If not provided, the existing key will be preserved. + /// + [JsonPropertyName("user_identity_key")] + public string? UserIdentityKey { get; init; } + } + + /// + /// Updates an unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) to make it managed. + /// + /// This endpoint can only be used to convert unmanaged user identities to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed user identities back to unmanaged. + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync( + HttpMethod.Patch, + "/user_identities/unmanaged/update", + request, + cancellationToken + ) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/Webhooks.cs b/src/Seam/Routes/Webhooks.cs new file mode 100644 index 00000000..51179900 --- /dev/null +++ b/src/Seam/Routes/Webhooks.cs @@ -0,0 +1,201 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class Webhooks + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal Webhooks( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Create a Webhook. + /// + public sealed record CreateRequest + { + /// + /// Types of events that you want the new webhook to receive. + /// + [JsonPropertyName("event_types")] + public List? EventTypes { get; init; } + + /// + /// URL for the new webhook. + /// + [JsonPropertyName("url")] + public required string Url { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("webhook")] + public Webhook? Webhook { get; init; } + } + + /// + /// Creates a new [webhook](https://docs.seam.co/developer-tools/webhooks). + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/webhooks/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Webhook + ?? throw new HttpRequestException("Seam returned no webhook for /webhooks/create"); + } + + /// + /// Request parameters for Delete a Webhook. + /// + public sealed record DeleteRequest + { + /// + /// ID of the webhook that you want to delete. + /// + [JsonPropertyName("webhook_id")] + public required string WebhookId { get; init; } + } + + /// + /// Deletes a specified [webhook](https://docs.seam.co/developer-tools/webhooks). + /// + public async Task DeleteAsync( + DeleteRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Delete, "/webhooks/delete", request, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Get a Webhook. + /// + public sealed record GetRequest + { + /// + /// ID of the webhook that you want to get. + /// + [JsonPropertyName("webhook_id")] + public required string WebhookId { get; init; } + } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("webhook")] + public Webhook? Webhook { get; init; } + } + + /// + /// Gets a specified [webhook](https://docs.seam.co/developer-tools/webhooks). + /// + public async Task GetAsync( + GetRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync(HttpMethod.Get, "/webhooks/get", request, cancellationToken) + .ConfigureAwait(false); + return response.Webhook + ?? throw new HttpRequestException("Seam returned no webhook for /webhooks/get"); + } + + /// + /// Request parameters for List Webhooks. + /// + public sealed record ListRequest { } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("webhooks")] + public List? Webhooks { get; init; } + } + + /// + /// Returns a list of all [webhooks](https://docs.seam.co/developer-tools/webhooks). + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/webhooks/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Webhooks + ?? throw new HttpRequestException("Seam returned no webhooks for /webhooks/list"); + } + + /// + /// Request parameters for Update a Webhook. + /// + public sealed record UpdateRequest + { + /// + /// Types of events that you want the webhook to receive. + /// + [JsonPropertyName("event_types")] + public required List EventTypes { get; init; } + + /// + /// ID of the webhook that you want to update. + /// + [JsonPropertyName("webhook_id")] + public required string WebhookId { get; init; } + } + + /// + /// Updates a specified [webhook](https://docs.seam.co/developer-tools/webhooks). + /// + public async Task UpdateAsync( + UpdateRequest request, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Put, "/webhooks/update", request, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Routes/Workspaces.cs b/src/Seam/Routes/Workspaces.cs new file mode 100644 index 00000000..879f0052 --- /dev/null +++ b/src/Seam/Routes/Workspaces.cs @@ -0,0 +1,390 @@ +// +// Generated by codegen/smith.ts from @seamapi/types. Do not edit. +// +#nullable enable +#pragma warning disable CS0618 // The generated code references its own deprecated members. +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Seam.Http; +using Seam.Models; + +namespace Seam.Routes +{ + public sealed class Workspaces + { + private readonly SeamHttpTransport _transport; + private readonly ActionAttemptWait _waitForActionAttemptDefault; + + internal Workspaces( + SeamHttpTransport transport, + ActionAttemptWait waitForActionAttemptDefault + ) + { + _transport = transport; + _waitForActionAttemptDefault = waitForActionAttemptDefault; + } + + /// + /// Request parameters for Create a Workspace. + /// + public sealed record CreateRequest + { + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum WebviewLogoShapeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "circle")] + Circle = 1, + + [EnumMember(Value = "square")] + Square = 2, + } + + /// + /// Company name for the new workspace. + /// + [Obsolete("Use `connect_partner_name` instead.")] + [JsonPropertyName("company_name")] + public string? CompanyName { get; init; } + + /// + /// Connect partner name for the new workspace. + /// + [JsonPropertyName("connect_partner_name")] + public Optional ConnectPartnerName { get; init; } + + /// + /// [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("connect_webview_customization")] + public CreateRequestConnectWebviewCustomization? ConnectWebviewCustomization { get; init; } + + /// + /// Indicates whether the new workspace is a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + /// + [JsonPropertyName("is_sandbox")] + public bool? IsSandbox { get; init; } + + /// + /// Name of the new workspace. + /// + [JsonPropertyName("name")] + public required string Name { get; init; } + + /// + /// ID of the organization to associate with the new workspace. + /// + [JsonPropertyName("organization_id")] + public string? OrganizationId { get; init; } + + [Obsolete("Use `connect_webview_customization.webview_logo_shape` instead.")] + [JsonPropertyName("webview_logo_shape")] + public CreateRequest.WebviewLogoShapeEnum? WebviewLogoShape { get; init; } + + [Obsolete("Use `connect_webview_customization.webview_primary_button_color` instead.")] + [JsonPropertyName("webview_primary_button_color")] + public string? WebviewPrimaryButtonColor { get; init; } + + [Obsolete( + "Use `connect_webview_customization.webview_primary_button_text_color` instead." + )] + [JsonPropertyName("webview_primary_button_text_color")] + public string? WebviewPrimaryButtonTextColor { get; init; } + + [Obsolete("Use `connect_webview_customization.webview_success_message` instead.")] + [JsonPropertyName("webview_success_message")] + public string? WebviewSuccessMessage { get; init; } + } + + public sealed record CreateRequestConnectWebviewCustomization + { + /// + /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum LogoShapeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "circle")] + Circle = 1, + + [EnumMember(Value = "square")] + Square = 2, + } + + /// + /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("logo_shape")] + public Optional LogoShape { get; init; } + + /// + /// Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("primary_button_color")] + public Optional PrimaryButtonColor { get; init; } + + /// + /// Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("primary_button_text_color")] + public Optional PrimaryButtonTextColor { get; init; } + + /// + /// Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("success_message")] + public Optional SuccessMessage { get; init; } + } + + public sealed record CreateResponse + { + /// + /// OK + /// + [JsonPropertyName("workspace")] + public Workspace? Workspace { get; init; } + } + + /// + /// Creates a new [workspace](https://docs.seam.co/core-concepts/workspaces). + /// + public async Task CreateAsync( + CreateRequest request, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/workspaces/create", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Workspace + ?? throw new HttpRequestException( + "Seam returned no workspace for /workspaces/create" + ); + } + + /// + /// Request parameters for Get a Workspace. + /// + public sealed record GetRequest { } + + public sealed record GetResponse + { + /// + /// OK + /// + [JsonPropertyName("workspace")] + public Workspace? Workspace { get; init; } + } + + /// + /// Returns the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. + /// + public async Task GetAsync( + GetRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/workspaces/get", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Workspace + ?? throw new HttpRequestException("Seam returned no workspace for /workspaces/get"); + } + + /// + /// Request parameters for List Workspaces. + /// + public sealed record ListRequest { } + + public sealed record ListResponse + { + /// + /// OK + /// + [JsonPropertyName("workspaces")] + public List? Workspaces { get; init; } + } + + /// + /// Returns a list of [workspaces](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. + /// + public async Task> ListAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/workspaces/list", + request, + cancellationToken + ) + .ConfigureAwait(false); + return response.Workspaces + ?? throw new HttpRequestException( + "Seam returned no workspaces for /workspaces/list" + ); + } + + /// + /// Request parameters for Reset a Sandbox Workspace. + /// + public sealed record ResetSandboxRequest { } + + public sealed record ResetSandboxResponse + { + /// + /// OK + /// + [JsonPropertyName("action_attempt")] + public ActionAttempt? ActionAttempt { get; init; } + } + + /// + /// Resets the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) associated with the authentication value. Note that this endpoint is only available for sandbox workspaces. + /// + public async Task ResetSandboxAsync( + ResetSandboxRequest? request = null, + ActionAttemptWait? waitForActionAttempt = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Post, + "/workspaces/reset_sandbox", + request, + cancellationToken + ) + .ConfigureAwait(false); + var actionAttempt = + response.ActionAttempt + ?? throw new HttpRequestException( + "Seam returned no action_attempt for /workspaces/reset_sandbox" + ); + return await ActionAttemptResolver + .ResolveAsync( + actionAttempt, + _transport, + waitForActionAttempt ?? _waitForActionAttemptDefault, + cancellationToken + ) + .ConfigureAwait(false); + } + + /// + /// Request parameters for Update a Workspace. + /// + public sealed record UpdateRequest + { + /// + /// Connect partner name for the workspace. + /// + [JsonPropertyName("connect_partner_name")] + public string? ConnectPartnerName { get; init; } + + /// + /// [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("connect_webview_customization")] + public UpdateRequestConnectWebviewCustomization? ConnectWebviewCustomization { get; init; } + + /// + /// Indicates whether publishable key authentication is enabled for this workspace. + /// + [JsonPropertyName("is_publishable_key_auth_enabled")] + public bool? IsPublishableKeyAuthEnabled { get; init; } + + /// + /// Indicates whether the workspace is suspended. + /// + [JsonPropertyName("is_suspended")] + public bool? IsSuspended { get; init; } + + /// + /// Name of the workspace. + /// + [JsonPropertyName("name")] + public string? Name { get; init; } + + /// + /// ID of the organization to assign the workspace to. The authenticated user must be the owner of the workspace and an admin of the target organization. + /// + [JsonPropertyName("organization_id")] + public string? OrganizationId { get; init; } + } + + public sealed record UpdateRequestConnectWebviewCustomization + { + /// + /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum LogoShapeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "circle")] + Circle = 1, + + [EnumMember(Value = "square")] + Square = 2, + } + + /// + /// Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("logo_shape")] + public Optional LogoShape { get; init; } + + /// + /// Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("primary_button_color")] + public Optional PrimaryButtonColor { get; init; } + + /// + /// Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("primary_button_text_color")] + public Optional PrimaryButtonTextColor { get; init; } + + /// + /// Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + /// + [JsonPropertyName("success_message")] + public Optional SuccessMessage { get; init; } + } + + /// + /// Updates the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. + /// + public async Task UpdateAsync( + UpdateRequest? request = null, + CancellationToken cancellationToken = default + ) + { + await _transport + .SendAsync(HttpMethod.Patch, "/workspaces/update", request, cancellationToken) + .ConfigureAwait(false); + } + } +} diff --git a/src/Seam/Seam.csproj b/src/Seam/Seam.csproj index 0fb44bcf..d8a005eb 100644 --- a/src/Seam/Seam.csproj +++ b/src/Seam/Seam.csproj @@ -3,13 +3,13 @@ net8.0;net10.0 enable - annotations + enable Seam - 1.4.0 + 2.0.0-beta.3 Seam Labs, Inc. @@ -42,10 +42,11 @@ - - - - + + + + + \ No newline at end of file diff --git a/src/Seam/SeamClient.cs b/src/Seam/SeamClient.cs new file mode 100644 index 00000000..b80602dd --- /dev/null +++ b/src/Seam/SeamClient.cs @@ -0,0 +1,125 @@ +using System; +using System.Net.Http; +using Seam.Http; + +namespace Seam +{ + /// + /// The Seam API client, scoped to a single workspace. + /// + /// + /// + /// using Seam; + /// + /// var seam = new SeamClient(apiKey: "seam_..."); + /// var device = await seam.Locks.GetAsync(new() { DeviceId = "..." }); + /// + /// + public sealed partial class SeamClient : IDisposable + { + private readonly bool _ownsClient; + + public SeamClient(string apiKey) + : this(new SeamClientOptions { ApiKey = apiKey }) { } + + public SeamClient(SeamClientOptions? options = null) + { + options ??= new SeamClientOptions(); + + if (options.HttpClient != null) + { + Http.Options.CheckHttpClientOptions( + options.HttpClient, + ("ApiKey", options.ApiKey), + ("PersonalAccessToken", options.PersonalAccessToken), + ("WorkspaceId", options.WorkspaceId), + ("Endpoint", options.Endpoint), + ("Timeout", options.Timeout), + ("MaxRetries", options.MaxRetries), + ("HttpMessageHandler", options.HttpMessageHandler) + ); + + Transport = new SeamHttpTransport(options.HttpClient); + _ownsClient = false; + } + else + { + Transport = new SeamHttpTransport( + SeamHttpClientFactory.Create( + Http.Options.GetEndpoint(options.Endpoint), + Auth.GetAuthHeaders( + options.ApiKey, + options.PersonalAccessToken, + options.WorkspaceId + ), + options.Timeout, + options.MaxRetries, + options.HttpMessageHandler + ) + ); + _ownsClient = true; + } + + WaitForActionAttemptDefault = options.WaitForActionAttempt ?? ActionAttemptWait.Default; + } + + public static SeamClient FromApiKey(string apiKey, SeamClientOptions? options = null) + { + return new SeamClient((options ?? new SeamClientOptions()) with { ApiKey = apiKey }); + } + + public static SeamClient FromPersonalAccessToken( + string personalAccessToken, + string workspaceId, + SeamClientOptions? options = null + ) + { + return new SeamClient( + (options ?? new SeamClientOptions()) with + { + PersonalAccessToken = personalAccessToken, + WorkspaceId = workspaceId, + } + ); + } + + public static SeamClient FromHttpClient( + HttpClient httpClient, + ActionAttemptWait? waitForActionAttempt = null + ) + { + return new SeamClient( + new SeamClientOptions + { + HttpClient = httpClient, + WaitForActionAttempt = waitForActionAttempt, + } + ); + } + + /// + /// The the SDK sends requests with, fully configured with the + /// endpoint, authorization, and retry behavior, for calling the Seam API directly. + /// + public HttpClient Client => Transport.Client; + + internal SeamHttpTransport Transport { get; } + + internal ActionAttemptWait WaitForActionAttemptDefault { get; } + + /// + /// Creates a paginator over any page-fetching function. Paginated endpoints offer a + /// ready-made one via their ListPager method. + /// + public SeamPaginator CreatePaginator(FetchPage fetchPage) + { + return new SeamPaginator(fetchPage); + } + + public void Dispose() + { + if (_ownsClient) + Client.Dispose(); + } + } +} diff --git a/src/Seam/SeamClientOptions.cs b/src/Seam/SeamClientOptions.cs new file mode 100644 index 00000000..30b361ba --- /dev/null +++ b/src/Seam/SeamClientOptions.cs @@ -0,0 +1,65 @@ +using System; +using System.Net.Http; + +namespace Seam +{ + /// + /// Options for constructing a . + /// + /// + /// Authenticate with either or plus + /// . When neither credential is given, the client reads + /// SEAM_API_KEY or SEAM_PERSONAL_ACCESS_TOKEN (with SEAM_WORKSPACE_ID) + /// from the environment, and falls back to SEAM_ENDPOINT. + /// + public sealed record SeamClientOptions + { + /// A Seam API key, scoped to a single workspace. + public string? ApiKey { get; init; } + + /// + /// A Seam personal access token, scoped to a Seam Console user. Requires + /// . + /// + public string? PersonalAccessToken { get; init; } + + /// The workspace a personal access token acts on. + public string? WorkspaceId { get; init; } + + /// The Seam API endpoint. Defaults to https://connect.getseam.com. + public string? Endpoint { get; init; } + + /// + /// How endpoints that return an action attempt wait for it to finish. Defaults to + /// waiting with a 10 second timeout, polling every second. Accepts a bool. + /// + public ActionAttemptWait? WaitForActionAttempt { get; init; } + + /// + /// The timeout for each request attempt, covering connection and response. Defaults to + /// 30 seconds. Retried attempts each get the full timeout. + /// + public TimeSpan? Timeout { get; init; } + + /// + /// How many times an idempotent request is retried after a transient failure. Defaults + /// to 2, for 3 total attempts. POST and PATCH requests are never retried. + /// + public int? MaxRetries { get; init; } + + /// + /// The innermost the client sends requests through, + /// replacing the default . The SDK's retry and timeout + /// handlers still apply. Useful for tests and custom transports. + /// + public HttpMessageHandler? HttpMessageHandler { get; init; } + + /// + /// A fully configured to use as is: its + /// and headers must already carry the endpoint and + /// authorization, and no SDK retry or timeout handlers are added. Cannot be combined + /// with any other option except . + /// + public HttpClient? HttpClient { get; init; } + } +} diff --git a/src/Seam/SeamWebhook.cs b/src/Seam/SeamWebhook.cs new file mode 100644 index 00000000..783ee6b4 --- /dev/null +++ b/src/Seam/SeamWebhook.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using System.Net; +using System.Text.Json; + +namespace Seam +{ + /// + /// Verifies and parses incoming Seam webhook events. + /// + /// + /// Named SeamWebhook rather than Webhook to leave that name to the webhook resource returned + /// by the API. Verification failures raise + /// . + /// + /// var webhook = new SeamWebhook(Environment.GetEnvironmentVariable("SEAM_WEBHOOK_SECRET")!); + /// var seamEvent = webhook.Verify(requestBody, requestHeaders); + /// + /// + public sealed class SeamWebhook + { + private readonly Svix.Webhook _webhook; + + /// The webhook secret from the Seam Console. + public SeamWebhook(string secret) + { + _webhook = new Svix.Webhook(secret); + } + + /// + /// Verifies an incoming webhook request and returns the event it carries. + /// + /// The raw HTTP request body. + /// The HTTP request headers. + /// + /// When the signature does not match. + /// + public Models.Event Verify(string payload, IReadOnlyDictionary headers) + { + var normalizedHeaders = new WebHeaderCollection(); + foreach (var (name, value) in headers) + { + normalizedHeaders.Add(name.ToLowerInvariant(), value); + } + + _webhook.Verify(payload, normalizedHeaders); + + return JsonSerializer.Deserialize(payload, SeamJson.Options) + ?? throw new Svix.Exceptions.WebhookVerificationException( + "The verified webhook payload did not contain an event" + ); + } + } +} diff --git a/src/Seam/SeamWithoutWorkspaceClient.cs b/src/Seam/SeamWithoutWorkspaceClient.cs new file mode 100644 index 00000000..63849301 --- /dev/null +++ b/src/Seam/SeamWithoutWorkspaceClient.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Seam.Http; + +namespace Seam +{ + /// + /// A Seam API client authenticated with a personal access token but not scoped to a + /// workspace, for listing and creating workspaces. + /// + /// + /// + /// var seam = new SeamWithoutWorkspaceClient(personalAccessToken: "seam_at..."); + /// var workspaces = await seam.Workspaces.ListAsync(); + /// + /// + public sealed class SeamWithoutWorkspaceClient : IDisposable + { + public SeamWithoutWorkspaceClient( + string? personalAccessToken = null, + string? endpoint = null, + TimeSpan? timeout = null, + int? maxRetries = null, + HttpMessageHandler? httpMessageHandler = null + ) + { + var transport = new SeamHttpTransport( + SeamHttpClientFactory.Create( + Http.Options.GetEndpoint(endpoint), + Auth.GetAuthHeadersWithoutWorkspace(personalAccessToken), + timeout, + maxRetries, + httpMessageHandler + ) + ); + + Client = transport.Client; + Workspaces = new WorkspacesProxy( + new Routes.Workspaces(transport, ActionAttemptWait.DoNotWait) + ); + } + + public static SeamWithoutWorkspaceClient FromPersonalAccessToken( + string personalAccessToken, + string? endpoint = null, + TimeSpan? timeout = null, + int? maxRetries = null, + HttpMessageHandler? httpMessageHandler = null + ) + { + return new SeamWithoutWorkspaceClient( + personalAccessToken, + endpoint, + timeout, + maxRetries, + httpMessageHandler + ); + } + + /// + /// The the SDK sends requests with, for calling the Seam API + /// directly. + /// + public HttpClient Client { get; } + + public WorkspacesProxy Workspaces { get; } + + public void Dispose() + { + Client.Dispose(); + } + + /// + /// The workspace operations available without a workspace in scope. + /// + public sealed class WorkspacesProxy + { + private readonly Routes.Workspaces _workspaces; + + internal WorkspacesProxy(Routes.Workspaces workspaces) + { + _workspaces = workspaces; + } + + public Task> ListAsync( + Routes.Workspaces.ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + return _workspaces.ListAsync(request, cancellationToken); + } + + public Task CreateAsync( + Routes.Workspaces.CreateRequest request, + CancellationToken cancellationToken = default + ) + { + return _workspaces.CreateAsync(request, cancellationToken); + } + } + } +} diff --git a/src/Seam/Client/Null.cs b/src/Seam/Serialization/Null.cs similarity index 72% rename from src/Seam/Client/Null.cs rename to src/Seam/Serialization/Null.cs index c9e5b85f..76454075 100644 --- a/src/Seam/Client/Null.cs +++ b/src/Seam/Serialization/Null.cs @@ -1,7 +1,8 @@ using System; -using Newtonsoft.Json; +using System.Text.Json; +using System.Text.Json.Serialization; -namespace Seam.Client +namespace Seam { /// /// The explicit null sentinel used by request parameters. @@ -46,30 +47,26 @@ public override string ToString() /// /// /// Declared on itself so the sentinel serializes to null under any - /// serializer settings, including ones a caller supplies. + /// serializer options, including ones a caller supplies. /// - internal class NullJsonConverter : JsonConverter + internal sealed class NullJsonConverter : JsonConverter { - public override bool CanRead => false; - - public override bool CanConvert(Type objectType) + public override Null Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) { - return objectType == typeof(Null); + throw new NotSupportedException("The Null sentinel cannot be deserialized."); } - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + public override void Write(Utf8JsonWriter writer, Null value, JsonSerializerOptions options) { - writer.WriteNull(); + writer.WriteNullValue(); } - public override object ReadJson( - JsonReader reader, - Type objectType, - object existingValue, - JsonSerializer serializer - ) - { - throw new NotSupportedException("The Null sentinel cannot be deserialized."); - } + // The sentinel means an explicit null, so it must never be dropped by + // the ignore-nulls-when-writing default. + public override bool HandleNull => true; } } diff --git a/src/Seam/Serialization/Optional.cs b/src/Seam/Serialization/Optional.cs new file mode 100644 index 00000000..755da0d3 --- /dev/null +++ b/src/Seam/Serialization/Optional.cs @@ -0,0 +1,138 @@ +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam +{ + /// + /// A request parameter that distinguishes being omitted, set to a value, and explicitly set + /// to null. + /// + /// + /// + /// Used for the nullable parameters of update requests, where an omitted parameter leaves + /// the current value unchanged and a null parameter unsets it. A value assigns implicitly, + /// and an explicit null is always spelled : + /// + /// + /// new ThermostatsUpdateRequest { HvacModeSetting = "heat" } // set a value + /// new ThermostatsUpdateRequest { HvacModeSetting = Null.Value } // unset the value + /// new ThermostatsUpdateRequest { } // leave it unchanged + /// + /// + /// + /// The non-generic view of used to omit unset parameters from the + /// JSON contract. + /// + internal interface IOptional + { + bool IsSet { get; } + } + + public readonly struct Optional : IOptional + { + private readonly T? _value; + + private Optional(bool isSet, bool isNull, T? value) + { + IsSet = isSet; + IsNull = isNull; + _value = value; + } + + /// An omitted parameter. This is the default. + public static Optional Unset => default; + + /// A parameter explicitly set to null. + public static Optional Null => new(true, true, default); + + public static Optional Of(T value) => new(true, false, value); + + /// Whether the parameter was given at all, as a value or as null. + public bool IsSet { get; } + + /// Whether the parameter was explicitly set to null. + public bool IsNull { get; } + + /// + /// The parameter value. + /// + /// + /// If the parameter is unset or explicitly null. + /// + public T Value => + IsSet && !IsNull + ? _value! + : throw new InvalidOperationException( + IsSet + ? "The parameter is explicitly null and has no value." + : "The parameter is unset and has no value." + ); + + public static implicit operator Optional(T value) => Of(value); + + public static implicit operator Optional(Null _) => Null; + + public override string ToString() => + !IsSet ? "unset" + : IsNull ? "null" + : _value?.ToString() ?? ""; + } + + /// + /// Serializes : a value as itself and an explicit null as JSON + /// null. An unset parameter is omitted from the JSON contract entirely by + /// , which never asks this converter to write one. + /// + internal sealed class OptionalJsonConverterFactory : JsonConverterFactory + { + public override bool CanConvert(Type typeToConvert) => + typeToConvert.IsGenericType + && typeToConvert.GetGenericTypeDefinition() == typeof(Optional<>); + + public override JsonConverter CreateConverter( + Type typeToConvert, + JsonSerializerOptions options + ) + { + var valueType = typeToConvert.GetGenericArguments()[0]; + var converterType = typeof(OptionalJsonConverter<>).MakeGenericType(valueType); + + return (JsonConverter)Activator.CreateInstance(converterType)!; + } + } + + internal sealed class OptionalJsonConverter : JsonConverter> + { + public override Optional Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType == JsonTokenType.Null) + return Optional.Null; + + return Optional.Of(JsonSerializer.Deserialize(ref reader, options)!); + } + + public override void Write( + Utf8JsonWriter writer, + Optional value, + JsonSerializerOptions options + ) + { + if (!value.IsSet || value.IsNull) + { + writer.WriteNullValue(); + return; + } + + JsonSerializer.Serialize(writer, value.Value, options); + } + + // An explicit null must be written, not dropped by the + // ignore-nulls-when-writing default. + public override bool HandleNull => true; + } +} diff --git a/src/Seam/Serialization/SeamJson.cs b/src/Seam/Serialization/SeamJson.cs new file mode 100644 index 00000000..5f57be88 --- /dev/null +++ b/src/Seam/Serialization/SeamJson.cs @@ -0,0 +1,51 @@ +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Text.Json.Serialization.Metadata; + +namespace Seam +{ + /// + /// The JSON contract shared by the SDK: request bodies, query parameters, and response + /// models all serialize through these options. + /// + /// + /// Property names are exact wire names declared by [JsonPropertyName] on the + /// generated models. A null optional parameter and an unset are + /// omitted, while the sentinel and an explicitly null + /// serialize to JSON null. + /// + public static class SeamJson + { + public static JsonSerializerOptions Options { get; } = Create(); + + private static JsonSerializerOptions Create() + { + var options = new JsonSerializerOptions + { + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = new DefaultJsonTypeInfoResolver + { + Modifiers = { OmitUnsetOptionals }, + }, + }; + options.Converters.Add(new OptionalJsonConverterFactory()); + + return options; + } + + private static void OmitUnsetOptionals(JsonTypeInfo typeInfo) + { + foreach (var property in typeInfo.Properties) + { + if ( + property.PropertyType.IsGenericType + && property.PropertyType.GetGenericTypeDefinition() == typeof(Optional<>) + ) + { + property.ShouldSerialize = (_, value) => value is IOptional { IsSet: true }; + } + } + } + } +} diff --git a/src/Seam/Serialization/SeamStringEnumConverter.cs b/src/Seam/Serialization/SeamStringEnumConverter.cs new file mode 100644 index 00000000..82d4032d --- /dev/null +++ b/src/Seam/Serialization/SeamStringEnumConverter.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam +{ + /// + /// Serializes the generated string enums by their wire + /// values, mapping an unknown wire value to the Unrecognized member. + /// + /// + /// The Seam API adds enum values over time, so a wire value the SDK does not know yet must + /// deserialize rather than throw. Every generated enum declares Unrecognized = 0 for + /// this; the raw wire value of an unrecognized member is not preserved. + /// + public sealed class SeamStringEnumConverter : JsonConverterFactory + { + public override bool CanConvert(Type typeToConvert) => typeToConvert.IsEnum; + + public override JsonConverter CreateConverter( + Type typeToConvert, + JsonSerializerOptions options + ) + { + var converterType = typeof(SeamStringEnumConverter<>).MakeGenericType(typeToConvert); + + return (JsonConverter)Activator.CreateInstance(converterType)!; + } + } + + internal sealed class SeamStringEnumConverter : JsonConverter + where TEnum : struct, Enum + { + private static readonly ConcurrentDictionary MembersByWireValue = Build(); + + private static readonly Dictionary WireValuesByMember = BuildReverse(); + + public override TEnum Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var wireValue = reader.GetString(); + + if (wireValue != null && MembersByWireValue.TryGetValue(wireValue, out var member)) + return member; + + return default; + } + + public override void Write( + Utf8JsonWriter writer, + TEnum value, + JsonSerializerOptions options + ) + { + if (!WireValuesByMember.TryGetValue(value, out var wireValue)) + throw new JsonException( + $"The enum {typeof(TEnum).Name} member {value} has no wire value." + ); + + writer.WriteStringValue(wireValue); + } + + private static ConcurrentDictionary Build() + { + var members = new ConcurrentDictionary(StringComparer.Ordinal); + + foreach ( + var field in typeof(TEnum).GetFields(BindingFlags.Public | BindingFlags.Static) + ) + { + var wireValue = + field.GetCustomAttribute()?.Value ?? field.Name; + members[wireValue] = (TEnum)field.GetValue(null)!; + } + + return members; + } + + private static Dictionary BuildReverse() + { + var wireValues = new Dictionary(); + + foreach ( + var field in typeof(TEnum).GetFields(BindingFlags.Public | BindingFlags.Static) + ) + { + var wireValue = + field.GetCustomAttribute()?.Value ?? field.Name; + wireValues[(TEnum)field.GetValue(null)!] = wireValue; + } + + return wireValues; + } + } +} diff --git a/src/Seam/Serialization/SeamUnion.cs b/src/Seam/Serialization/SeamUnion.cs new file mode 100644 index 00000000..4804092e --- /dev/null +++ b/src/Seam/Serialization/SeamUnion.cs @@ -0,0 +1,167 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Seam +{ + /// + /// Declares the discriminator property of a generated discriminated union base class. + /// + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + public sealed class SeamUnionAttribute : Attribute + { + public SeamUnionAttribute(string discriminator) + { + Discriminator = discriminator; + } + + /// The wire name of the discriminator property, e.g. action_type. + public string Discriminator { get; } + } + + /// + /// Maps one discriminator value of a generated discriminated union to its variant class. + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] + public sealed class SeamUnionVariantAttribute : Attribute + { + public SeamUnionVariantAttribute(string discriminatorValue, Type variantType) + { + DiscriminatorValue = discriminatorValue; + VariantType = variantType; + } + + public string DiscriminatorValue { get; } + + public Type VariantType { get; } + } + + /// + /// Names the fallback variant a generated discriminated union deserializes to when the + /// discriminator value is not recognized. + /// + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + public sealed class SeamUnionFallbackAttribute : Attribute + { + public SeamUnionFallbackAttribute(Type fallbackType) + { + FallbackType = fallbackType; + } + + public Type FallbackType { get; } + } + + /// + /// Implemented by the generated …Unrecognized fallback variants so the raw payload of + /// an unknown union member is preserved rather than discarded. + /// + public interface ISeamUnrecognizedVariant + { + /// The complete raw JSON of the unrecognized union member. + JsonElement RawJson { get; set; } + } + + /// + /// Serializes the generated discriminated unions: reading dispatches on the discriminator + /// property declared by , falling back to the + /// variant (which keeps the raw JSON) for a + /// discriminator value the SDK does not know yet; writing serializes the runtime type. + /// + public sealed class SeamUnionConverter : JsonConverterFactory + { + public override bool CanConvert(Type typeToConvert) => + typeToConvert.GetCustomAttribute() != null; + + public override JsonConverter CreateConverter( + Type typeToConvert, + JsonSerializerOptions options + ) + { + var converterType = typeof(SeamUnionConverter<>).MakeGenericType(typeToConvert); + + return (JsonConverter)Activator.CreateInstance(converterType)!; + } + } + + internal sealed class SeamUnionConverter : JsonConverter + where TBase : class + { + private static readonly string Discriminator = typeof(TBase) + .GetCustomAttribute()! + .Discriminator; + + private static readonly ConcurrentDictionary VariantsByDiscriminatorValue = + BuildVariants(); + + private static readonly Type? FallbackType = typeof(TBase) + .GetCustomAttribute() + ?.FallbackType; + + public override TBase? Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + using var document = JsonDocument.ParseValue(ref reader); + var element = document.RootElement.Clone(); + + string? discriminatorValue = null; + if ( + element.ValueKind == JsonValueKind.Object + && element.TryGetProperty(Discriminator, out var property) + && property.ValueKind == JsonValueKind.String + ) + { + discriminatorValue = property.GetString(); + } + + if ( + discriminatorValue != null + && VariantsByDiscriminatorValue.TryGetValue(discriminatorValue, out var variantType) + ) + { + return (TBase?)element.Deserialize(variantType, options); + } + + if (FallbackType == null) + throw new JsonException( + $"Unrecognized {typeof(TBase).Name} {Discriminator} \"{discriminatorValue}\" " + + "and the union declares no fallback variant." + ); + + var fallback = (TBase?)element.Deserialize(FallbackType, options); + + if (fallback is ISeamUnrecognizedVariant unrecognized) + unrecognized.RawJson = element; + + return fallback; + } + + public override void Write( + Utf8JsonWriter writer, + TBase value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize(writer, value, value.GetType(), options); + } + + private static ConcurrentDictionary BuildVariants() + { + var variants = new ConcurrentDictionary(StringComparer.Ordinal); + + foreach ( + var attribute in typeof(TBase).GetCustomAttributes() + ) + { + variants[attribute.DiscriminatorValue] = attribute.VariantType; + } + + return variants; + } + } +} diff --git a/src/Seam/Client/StrictUrlSearchParamsSerializer.cs b/src/Seam/Serialization/StrictUrlSearchParamsSerializer.cs similarity index 98% rename from src/Seam/Client/StrictUrlSearchParamsSerializer.cs rename to src/Seam/Serialization/StrictUrlSearchParamsSerializer.cs index 36f63e2c..dae63885 100644 --- a/src/Seam/Client/StrictUrlSearchParamsSerializer.cs +++ b/src/Seam/Serialization/StrictUrlSearchParamsSerializer.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace Seam.Client +namespace Seam { /// /// Serializes parameters for the Seam API: the URL search parameters standard plus diff --git a/src/Seam/Client/UnserializableParamError.cs b/src/Seam/Serialization/UnserializableParamError.cs similarity index 97% rename from src/Seam/Client/UnserializableParamError.cs rename to src/Seam/Serialization/UnserializableParamError.cs index eefe1756..05c9c620 100644 --- a/src/Seam/Client/UnserializableParamError.cs +++ b/src/Seam/Serialization/UnserializableParamError.cs @@ -1,6 +1,6 @@ using System; -namespace Seam.Client +namespace Seam { /// /// Thrown when a request parameter could not be serialized, before any request is sent. diff --git a/src/Seam/Client/UrlSearchParams.cs b/src/Seam/Serialization/UrlSearchParams.cs similarity index 99% rename from src/Seam/Client/UrlSearchParams.cs rename to src/Seam/Serialization/UrlSearchParams.cs index 4b96697c..934b4cf4 100644 --- a/src/Seam/Client/UrlSearchParams.cs +++ b/src/Seam/Serialization/UrlSearchParams.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; -namespace Seam.Client +namespace Seam { /// /// A mutable collection of URL search parameters. @@ -117,7 +117,7 @@ public void Set(string name, string value) /// Returns the value of the first pair with this name, or null if no pair with this name /// exists. /// - public string Get(string name) + public string? Get(string name) { foreach (var pair in _pairs) { diff --git a/src/Seam/Client/UrlSearchParamsSerializer.cs b/src/Seam/Serialization/UrlSearchParamsSerializer.cs similarity index 99% rename from src/Seam/Client/UrlSearchParamsSerializer.cs rename to src/Seam/Serialization/UrlSearchParamsSerializer.cs index 08a6aaaa..429df0d5 100644 --- a/src/Seam/Client/UrlSearchParamsSerializer.cs +++ b/src/Seam/Serialization/UrlSearchParamsSerializer.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text.RegularExpressions; -namespace Seam.Client +namespace Seam { /// /// Serializes values to URL search parameters. @@ -98,7 +98,7 @@ IList path if (!(entry.Key is string key)) { throw new UnserializableParamError( - Convert.ToString(entry.Key, CultureInfo.InvariantCulture), + Convert.ToString(entry.Key, CultureInfo.InvariantCulture) ?? "", "has a name that is not a string which is unsupported" ); } @@ -221,7 +221,7 @@ value is sbyte || value is ulong ) { - return Convert.ToString(value, CultureInfo.InvariantCulture); + return Convert.ToString(value, CultureInfo.InvariantCulture)!; } if (value is float single) diff --git a/test/Seam.Test/ApiKeyTests.cs b/test/Seam.Test/ApiKeyTests.cs new file mode 100644 index 00000000..3950aa10 --- /dev/null +++ b/test/Seam.Test/ApiKeyTests.cs @@ -0,0 +1,58 @@ +namespace Seam.Test; + +using Seam.Test.Support; + +public class ApiKeyTests : FakeSeamConnectTest +{ + [Fact] + public async Task FromApiKeyReturnsAnAuthorizedClient() + { + using var seam = SeamClient.FromApiKey( + Seed("seam_apikey1_token"), + new SeamClientOptions { Endpoint = Endpoint } + ); + + var devices = await seam.Devices.ListAsync(); + + Assert.NotEmpty(devices); + } + + [Fact] + public async Task ConstructorReturnsAnAuthorizedClient() + { + using var seam = new SeamClient( + new SeamClientOptions { ApiKey = Seed("seam_apikey1_token"), Endpoint = Endpoint } + ); + + var devices = await seam.Devices.ListAsync(); + + Assert.NotEmpty(devices); + } + + [Fact] + public async Task InvalidApiKeyIsRejectedByTheServer() + { + using var seam = new SeamClient( + new SeamClientOptions { ApiKey = "seam_invalid_api_key", Endpoint = Endpoint } + ); + + await Assert.ThrowsAsync(() => seam.Devices.ListAsync()); + } +} + +public class ApiKeyFormatTests +{ + [Theory] + [InlineData("seam_at1_token", "An Access Token cannot be used as an ApiKey")] + [InlineData("seam_cst1_token", "A Client Session Token cannot be used as an ApiKey")] + [InlineData("seam_pk1_token", "A Publishable Key cannot be used as an ApiKey")] + [InlineData("ey_json_web_token", "A JWT cannot be used as an ApiKey")] + [InlineData("not-a-token", "Unknown or invalid ApiKey format")] + public void ApiKeyFormatIsChecked(string apiKey, string message) + { + var exception = Assert.Throws(() => new SeamClient(apiKey)); + + Assert.Contains(message, exception.Message); + Assert.StartsWith("Seam received an invalid token:", exception.Message); + } +} diff --git a/test/Seam.Test/Client/ApiResponseTests.cs b/test/Seam.Test/Client/ApiResponseTests.cs deleted file mode 100644 index 819f9da6..00000000 --- a/test/Seam.Test/Client/ApiResponseTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace Seam.Test; - -using System.Net; -using Seam.Client; - -public class ApiResponseTests -{ - [Fact] - public void EnsureDataReturnsDataWhenPresent() - { - var data = new Api.Locks.ListResponse(devices: new List()); - var response = new ApiResponse(HttpStatusCode.OK, data, "{}"); - - Assert.Same(data, response.EnsureData("/locks/list")); - } - - [Fact] - public void EnsureDataThrowsSeamExceptionWhenDataIsNull() - { - var headers = new Multimap { { "seam-request-id", "req-123" } }; - var response = new ApiResponse( - HttpStatusCode.OK, - headers, - null!, - "unexpected body" - ); - - var exception = Assert.Throws(() => response.EnsureData("/locks/list")); - - Assert.Equal(200, exception.ErrorCode); - Assert.Contains("/locks/list", exception.Message); - Assert.Contains("HTTP 200", exception.Message); - Assert.Equal("unexpected body", exception.ErrorContent); - Assert.Equal(headers, exception.Headers); - } - - [Fact] - public void EnsureDataIncludesErrorTextInMessageWhenSet() - { - var response = new ApiResponse(HttpStatusCode.OK, null!, "not json") - { - ErrorText = "Error deserializing response", - }; - - var exception = Assert.Throws(() => response.EnsureData("/locks/list")); - - Assert.Contains("Error deserializing response", exception.Message); - Assert.Equal("not json", exception.ErrorContent); - } -} diff --git a/test/Seam.Test/Client/RequestTransportTests.cs b/test/Seam.Test/Client/RequestTransportTests.cs deleted file mode 100644 index d1f3528c..00000000 --- a/test/Seam.Test/Client/RequestTransportTests.cs +++ /dev/null @@ -1,172 +0,0 @@ -namespace Seam.Test; - -using System.Net; -using System.Text; -using Seam.Client; - -/// -/// Exercises what the client puts on the wire for each preferred HTTP method. -/// -public class RequestTransportTests : IDisposable -{ - private readonly HttpListener _listener; - private readonly string _basePath; - - private string _method = ""; - private string _url = ""; - private string _body = ""; - - public RequestTransportTests() - { - var port = GetAvailablePort(); - _basePath = $"http://127.0.0.1:{port}"; - _listener = new HttpListener(); - _listener.Prefixes.Add($"{_basePath}/"); - _listener.Start(); - } - - public void Dispose() - { - _listener.Close(); - GC.SuppressFinalize(this); - } - - private static int GetAvailablePort() - { - var listener = new System.Net.Sockets.TcpListener(IPAddress.Loopback, 0); - listener.Start(); - var port = ((IPEndPoint)listener.LocalEndpoint).Port; - listener.Stop(); - - return port; - } - - private SeamClient CreateClient(string responseBody) - { - _ = Task.Run(() => - { - var context = _listener.GetContext(); - _method = context.Request.HttpMethod; - _url = context.Request.RawUrl ?? ""; - - using (var reader = new StreamReader(context.Request.InputStream)) - { - _body = reader.ReadToEnd(); - } - - var bytes = Encoding.UTF8.GetBytes(responseBody); - context.Response.ContentType = "application/json"; - context.Response.ContentLength64 = bytes.Length; - context.Response.OutputStream.Write(bytes, 0, bytes.Length); - context.Response.Close(); - }); - - return new SeamClient(basePath: _basePath, apiToken: "seam_apikey_token"); - } - - [Fact] - public void SendsGetParamsAsSortedSearchParams() - { - var seam = CreateClient("{\"acs_encoders\":[]}"); - - seam.EncodersAcs.List(acsSystemIds: new List { "system1", "system2" }, limit: 20); - - Assert.Equal("GET", _method); - Assert.Equal( - "/acs/encoders/list?acs_system_ids=system1&acs_system_ids=system2&limit=20&_strict=true", - _url - ); - Assert.Equal("", _body); - } - - [Fact] - public void SendsGetParamsOfEveryPrimitiveType() - { - var seam = CreateClient("{\"acs_credentials\":[]}"); - - seam.CredentialsAcs.List( - acsUserId: "user1", - isMultiPhoneSyncCredential: true, - limit: 20, - search: "a b*~" - ); - - Assert.Equal("GET", _method); - - // `~` reaches the wire unescaped rather than as `%7E`, because Uri normalizes a - // percent-encoded unreserved character back to its literal form. Both decode to the - // same param. - Assert.Equal( - "/acs/credentials/list?acs_user_id=user1&is_multi_phone_sync_credential=true" - + "&limit=20&search=a+b*~&_strict=true", - _url - ); - } - - [Fact] - public void SendsAGetWithNoParamsWithoutAQuery() - { - var seam = CreateClient("{\"workspaces\":[]}"); - - seam.Workspaces.List(); - - Assert.Equal("GET", _method); - Assert.Equal("/workspaces/list", _url); - } - - [Fact] - public void SendsTheNullSentinelAsAnEmptySearchParamValue() - { - var seam = CreateClient("{\"workspace\":{}}"); - - seam.Get( - "/workspaces/get", - new RequestOptions - { - Data = new Dictionary { ["workspace_id"] = Null.Value }, - } - ); - - Assert.Equal("GET", _method); - Assert.Equal("/workspaces/get?workspace_id=&_strict=true", _url); - } - - [Fact] - public void SendsDeleteParamsAsSearchParams() - { - var seam = CreateClient("{}"); - - seam.AccessMethods.Delete(accessMethodId: "method1"); - - Assert.Equal("DELETE", _method); - Assert.Equal("/access_methods/delete?access_method_id=method1&_strict=true", _url); - Assert.Equal("", _body); - } - - [Fact] - public void SendsPostParamsAsAJsonBody() - { - var seam = CreateClient("{}"); - - seam.ConnectedAccounts.Sync(connectedAccountId: "account1"); - - Assert.Equal("POST", _method); - Assert.Equal("/connected_accounts/sync", _url); - Assert.Equal("{\"connected_account_id\":\"account1\"}", _body); - } - - [Fact] - public void SendsPatchParamsAsAJsonBody() - { - var seam = CreateClient("{}"); - - seam.AccessGrants.Update(accessGrantId: "grant1", startsAt: "2025-02-24T18:44:39.000Z"); - - Assert.Equal("PATCH", _method); - Assert.Equal("/access_grants/update", _url); - Assert.Equal( - "{\"access_grant_id\":\"grant1\",\"starts_at\":\"2025-02-24T18:44:39.000Z\"}", - _body - ); - } -} diff --git a/test/Seam.Test/Client/SeamTests.cs b/test/Seam.Test/Client/SeamTests.cs deleted file mode 100644 index 14d5be0b..00000000 --- a/test/Seam.Test/Client/SeamTests.cs +++ /dev/null @@ -1,178 +0,0 @@ -namespace Seam.Test; - -using Newtonsoft.Json; -using Seam.Model; - -public class UnitTest1 -{ - [Fact] - public void TestUnknownEnumValue() - { - var json = - @"{ - ""device_type"": ""unknown_device_type"", - ""device_id"": ""test"", - ""capabilities_supported"": [""unknown_capability"", ""access_code""], - ""properties"": { - ""available_fan_mode_settings"": [""unknown_mode"", ""auto""] - }, - connected_account_id: ""test"", - created_at: ""test"", - device_id: ""test"", - device_type: ""unknown_device_type"", - display_name: ""test"", - errors: [], - is_managed: false, - warnings: [], - workspace_id: ""test"", - properties: { - ""available_fan_mode_settings"": [""unknown_mode"", ""auto""] - }, - custom_metadata: {}, - space_ids: [] - }"; - - var settings = new JsonSerializerSettings - { - Converters = new List { new SafeStringEnumConverter() }, - }; - var device = JsonConvert.DeserializeObject(json, settings); - - // Unknown values should be mapped to first enum value (Unrecognized = 0) - Assert.NotNull(device); - Assert.Equal(Device.DeviceTypeEnum.Unrecognized, device.DeviceType); - Assert.Equal( - Device.CapabilitiesSupportedEnum.Unrecognized, - device.CapabilitiesSupported[0] - ); - Assert.NotNull(device.Properties.AvailableFanModeSettings); - Assert.Equal( - DeviceProperties.AvailableFanModeSettingsEnum.Unrecognized, - device.Properties.AvailableFanModeSettings[0] - ); - - // Known values should still work - Assert.Equal(Device.CapabilitiesSupportedEnum.AccessCode, device.CapabilitiesSupported[1]); - Assert.Equal( - DeviceProperties.AvailableFanModeSettingsEnum.Auto, - device.Properties.AvailableFanModeSettings[1] - ); - } - - [Fact] - public void TestDiscriminatedUnionArrayWithUnknownTypes() - { - var json = - @"{ - ""connected_account_id"": ""test-account-id"", - ""account_type"": ""august"", - ""account_type_display_name"": ""August Lock"", - ""display_name"": ""Test Account"", - ""automatically_manage_new_devices"": true, - ""created_at"": ""2024-01-15T10:00:00Z"", - ""accepted_capabilities"": [], - ""custom_metadata"": {}, - ""errors"": [ - { - ""error_code"": ""unknown_error_type"", - ""message"": ""An unknown error occurred"", - ""created_at"": ""2024-01-15T10:00:00Z"" - } - ], - ""warnings"": [ - { - ""warning_code"": ""unknown_warning_type"", - ""message"": ""An unknown warning occurred"", - ""created_at"": ""2024-01-15T10:00:00Z"" - } - ] - }"; - - var settings = new JsonSerializerSettings - { - Converters = new List { new SafeStringEnumConverter() }, - MissingMemberHandling = MissingMemberHandling.Ignore, - }; - - // Unknown discriminated union types should fall back to unrecognized type - var account = JsonConvert.DeserializeObject(json, settings); - - Assert.NotNull(account); - Assert.NotNull(account.Errors); - Assert.Single(account.Errors); - - // The unknown error type should fall back to an unrecognized error type - var error = account.Errors[0]; - Assert.Equal("unrecognized", error.ErrorCode); - Assert.Equal("An unknown error occurred", error.Message); - } - - [Fact] - public void TestEventArrayWithUnknownTypes() - { - var json = - @"[ - { - ""event_id"": ""event-1"", - ""event_type"": ""device.connected"", - ""created_at"": ""2024-01-15T10:00:00Z"", - ""occurred_at"": ""2024-01-15T10:00:00Z"", - ""device_id"": ""device-123"", - ""connected_account_id"": ""account-123"", - ""workspace_id"": ""workspace-123"" - }, - { - ""event_id"": ""event-2"", - ""event_type"": ""unknown_event_type"", - ""created_at"": ""2024-01-15T10:00:00Z"", - ""custom_field"": ""custom_value"" - } - ]"; - - var settings = new JsonSerializerSettings - { - Converters = new List { new SafeStringEnumConverter() }, - MissingMemberHandling = MissingMemberHandling.Ignore, - }; - - // Unknown event types should fall back to unrecognized type - var events = JsonConvert.DeserializeObject>(json, settings); - - Assert.NotNull(events); - Assert.Equal(2, events.Count); - - // First event should deserialize normally - Assert.IsType(events[0]); - - // Second event with unknown type should fall back to unrecognized - var unknownEvent = events[1]; - Assert.IsType(unknownEvent); - Assert.Equal("unrecognized", unknownEvent.EventType); - } - - [Fact] - public void TestActionAttemptWithUnknownType() - { - // Test case for ActionAttempt with unknown action types - var json = - @"{ - ""action_attempt_id"": ""attempt-123"", - ""action_type"": ""UNKNOWN_ACTION"", - ""status"": ""success"", - ""result"": {}, - ""error"": null - }"; - - var settings = new JsonSerializerSettings - { - Converters = new List { new SafeStringEnumConverter() }, - MissingMemberHandling = MissingMemberHandling.Ignore, - }; - - // Unknown action types should fall back to unrecognized type - var actionAttempt = JsonConvert.DeserializeObject(json, settings); - - Assert.NotNull(actionAttempt); - Assert.Equal("unrecognized", actionAttempt.ActionType); - } -} diff --git a/test/Seam.Test/Client/TimeoutTests.cs b/test/Seam.Test/Client/TimeoutTests.cs deleted file mode 100644 index cecc86df..00000000 --- a/test/Seam.Test/Client/TimeoutTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -namespace Seam.Test; - -using Seam.Client; - -public class TimeoutTests -{ - [Fact] - public void DefaultTimeoutIs30Seconds() - { - Assert.Equal(30000, SeamRequestConfiguration.DefaultTimeout); - } - - [Fact] - public void NewConfigurationUsesTheDefaultTimeout() - { - var configuration = new SeamRequestConfiguration(); - - Assert.Equal(SeamRequestConfiguration.DefaultTimeout, configuration.Timeout); - } - - [Fact] - public void GlobalConfigurationUsesTheDefaultTimeout() - { - Assert.Equal( - SeamRequestConfiguration.DefaultTimeout, - GlobalSeamRequestConfiguration.Instance.Timeout - ); - } - - [Fact] - public void ConfigurationTimeoutCanBeOverridden() - { - var configuration = new SeamRequestConfiguration { Timeout = 60000 }; - - Assert.Equal(60000, configuration.Timeout); - } - - [Fact] - public void MergedConfigurationTakesTheTimeoutFromTheSecondConfiguration() - { - var first = new SeamRequestConfiguration { Timeout = 60000 }; - var second = new SeamRequestConfiguration { Timeout = 5000 }; - - var merged = SeamRequestConfiguration.MergeConfigurations(first, second); - - Assert.Equal(5000, merged.Timeout); - } - - [Fact] - public void ClientAcceptsATimeout() - { - var seam = new SeamClient(apiToken: "seam_apikey_token", timeout: 60000); - - Assert.NotNull(seam); - } -} diff --git a/test/Seam.Test/ClientTests.cs b/test/Seam.Test/ClientTests.cs new file mode 100644 index 00000000..1c7445ed --- /dev/null +++ b/test/Seam.Test/ClientTests.cs @@ -0,0 +1,109 @@ +namespace Seam.Test; + +using System.Net; +using System.Net.Http.Headers; +using Seam.Http; +using Seam.Models; +using Seam.Test.Support; + +public class ClientTests : FakeSeamConnectTest +{ + [Fact] + public async Task ClientPropertyMakesAuthorizedRequests() + { + using var seam = CreateSeam(); + + using var response = await seam.Client.GetAsync("/devices/list"); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + [Fact] + public async Task FromHttpClientNeedsNoCredentials() + { + using var client = new HttpClient { BaseAddress = new Uri(Endpoint) }; + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( + "Bearer", + Seed("seam_apikey1_token") + ); + + using var seam = SeamClient.FromHttpClient(client); + + Assert.Same(client, seam.Client); + Assert.NotEmpty(await seam.Devices.ListAsync()); + } + + [Fact] + public void HttpClientOptionRejectsAnyOtherOption() + { + using var client = new HttpClient { BaseAddress = new Uri(Endpoint) }; + + var exception = Assert.Throws( + () => + new SeamClient( + new SeamClientOptions { HttpClient = client, ApiKey = "seam_apikey1_token" } + ) + ); + + Assert.Contains( + "The ApiKey option cannot be used with the HttpClient option", + exception.Message + ); + } + + [Fact] + public void HttpClientOptionRequiresABaseAddress() + { + using var client = new HttpClient(); + + Assert.Throws(() => SeamClient.FromHttpClient(client)); + } + + [Fact] + public async Task FromHttpClientStillTakesAWaitForActionAttemptDefault() + { + using var client = new HttpClient { BaseAddress = new Uri(Endpoint) }; + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( + "Bearer", + Seed("seam_apikey1_token") + ); + + using var seam = SeamClient.FromHttpClient(client, waitForActionAttempt: false); + + var actionAttempt = await seam.Locks.UnlockDoorAsync( + new() { DeviceId = Seed("august_device_1") } + ); + + Assert.Equal(ActionAttemptStatus.Pending, actionAttempt.Status); + } + + [Fact] + public async Task AnInjectedHandlerStillGetsTheErrorMapping() + { + var handler = new RecordingHandler().RespondWith(HttpStatusCode.Unauthorized); + using var seam = CreateSeam(httpMessageHandler: handler); + + await Assert.ThrowsAsync(() => seam.Devices.ListAsync()); + } + + [Fact] + public void TimeoutDefaultsToThirtySecondsPerAttempt() + { + Assert.Equal(TimeSpan.FromSeconds(30), SeamHttpClientFactory.DefaultTimeout); + } + + [Fact] + public void RetriesDefaultToTwo() + { + Assert.Equal(2, SeamRetryHandler.DefaultMaxRetries); + } + + [Fact] + public async Task DisposeReleasesAnOwnedClient() + { + var seam = CreateSeam(); + seam.Dispose(); + + await Assert.ThrowsAsync(() => seam.Devices.ListAsync()); + } +} diff --git a/test/Seam.Test/EnvTests.cs b/test/Seam.Test/EnvTests.cs new file mode 100644 index 00000000..2febf3af --- /dev/null +++ b/test/Seam.Test/EnvTests.cs @@ -0,0 +1,174 @@ +namespace Seam.Test; + +using Seam.Test.Support; + +public class EnvTests : FakeSeamConnectTest +{ + [Fact] + public async Task ReadsTheApiKeyFromTheEnvironment() + { + using var env = new EnvGuard(); + env.Set("SEAM_API_KEY", Seed("seam_apikey1_token")); + env.Set("SEAM_ENDPOINT", Endpoint); + + using var seam = new SeamClient(); + + Assert.NotEmpty(await seam.Devices.ListAsync()); + } + + [Fact] + public async Task ReadsTheEndpointFromTheEnvironment() + { + using var env = new EnvGuard(); + env.Set("SEAM_ENDPOINT", Endpoint); + + using var seam = new SeamClient(Seed("seam_apikey1_token")); + + Assert.NotEmpty(await seam.Devices.ListAsync()); + } + + [Fact] + public void FallsBackToTheDefaultEndpoint() + { + using var env = new EnvGuard(); + + using var seam = new SeamClient("seam_apikey1_token"); + + Assert.Equal("https://connect.getseam.com/", seam.Client.BaseAddress!.ToString()); + } + + [Fact] + public async Task EndpointOptionWinsOverTheEnvironment() + { + using var env = new EnvGuard(); + env.Set("SEAM_ENDPOINT", "http://127.0.0.1:1"); + + using var seam = new SeamClient( + new SeamClientOptions { ApiKey = Seed("seam_apikey1_token"), Endpoint = Endpoint } + ); + + Assert.NotEmpty(await seam.Devices.ListAsync()); + } + + [Fact] + public async Task ReadsThePersonalAccessTokenAndWorkspaceIdFromTheEnvironment() + { + using var env = new EnvGuard(); + env.Set("SEAM_PERSONAL_ACCESS_TOKEN", Seed("seam_at1_token")); + env.Set("SEAM_WORKSPACE_ID", Seed("seed_workspace_1")); + env.Set("SEAM_ENDPOINT", Endpoint); + + using var seam = new SeamClient(); + + Assert.NotEmpty(await seam.Devices.ListAsync()); + } + + [Fact] + public async Task ReadsOnlyTheWorkspaceIdFromTheEnvironment() + { + using var env = new EnvGuard(); + env.Set("SEAM_WORKSPACE_ID", Seed("seed_workspace_1")); + + using var seam = new SeamClient( + new SeamClientOptions + { + PersonalAccessToken = Seed("seam_at1_token"), + Endpoint = Endpoint, + } + ); + + Assert.NotEmpty(await seam.Devices.ListAsync()); + } + + [Fact] + public async Task WorkspaceIdOptionWinsOverTheEnvironment() + { + using var env = new EnvGuard(); + env.Set("SEAM_WORKSPACE_ID", "nonexistent-workspace"); + + using var seam = new SeamClient( + new SeamClientOptions + { + PersonalAccessToken = Seed("seam_at1_token"), + WorkspaceId = Seed("seed_workspace_1"), + Endpoint = Endpoint, + } + ); + + Assert.NotEmpty(await seam.Devices.ListAsync()); + } + + [Fact] + public void FailsWhenBothCredentialEnvironmentVariablesAreSet() + { + using var env = new EnvGuard(); + env.Set("SEAM_API_KEY", "seam_apikey1_token"); + env.Set("SEAM_PERSONAL_ACCESS_TOKEN", "seam_at1_token"); + + var exception = Assert.Throws(() => new SeamClient()); + + Assert.Contains("Both SEAM_API_KEY and SEAM_PERSONAL_ACCESS_TOKEN", exception.Message); + } + + [Fact] + public void FailsWhenNoCredentialsAreAvailable() + { + using var env = new EnvGuard(); + + var exception = Assert.Throws(() => new SeamClient()); + + Assert.Contains("Must specify an ApiKey or PersonalAccessToken", exception.Message); + } + + [Fact] + public async Task ApiKeyEnvironmentVariableIsIgnoredForAPersonalAccessToken() + { + using var env = new EnvGuard(); + env.Set("SEAM_API_KEY", "seam_apikey_from_env"); + + using var seam = new SeamClient( + new SeamClientOptions + { + PersonalAccessToken = Seed("seam_at1_token"), + WorkspaceId = Seed("seed_workspace_1"), + Endpoint = Endpoint, + } + ); + + Assert.NotEmpty(await seam.Devices.ListAsync()); + } + + [Fact] + public async Task PersonalAccessTokenEnvironmentVariableIsIgnoredForAnApiKey() + { + using var env = new EnvGuard(); + env.Set("SEAM_PERSONAL_ACCESS_TOKEN", "seam_at_from_env"); + + using var seam = new SeamClient( + new SeamClientOptions { ApiKey = Seed("seam_apikey1_token"), Endpoint = Endpoint } + ); + + Assert.NotEmpty(await seam.Devices.ListAsync()); + } + + [Fact] + public async Task WithoutWorkspaceReadsThePersonalAccessTokenFromTheEnvironment() + { + using var env = new EnvGuard(); + env.Set("SEAM_PERSONAL_ACCESS_TOKEN", Seed("seam_at1_token")); + + using var seam = new SeamWithoutWorkspaceClient(endpoint: Endpoint); + + Assert.NotEmpty(await seam.Workspaces.ListAsync()); + } + + [Fact] + public void EmptyEnvironmentVariablesAreTreatedAsUnset() + { + using var env = new EnvGuard(); + env.Set("SEAM_API_KEY", ""); + env.Set("SEAM_PERSONAL_ACCESS_TOKEN", ""); + + Assert.Throws(() => new SeamClient()); + } +} diff --git a/test/Seam.Test/HeadersTests.cs b/test/Seam.Test/HeadersTests.cs new file mode 100644 index 00000000..8b9813c0 --- /dev/null +++ b/test/Seam.Test/HeadersTests.cs @@ -0,0 +1,67 @@ +namespace Seam.Test; + +using System.Text.RegularExpressions; +using Seam.Test.Support; + +public class HeadersTests +{ + private static async Task RecordAsync(SeamClientOptions options) + { + var handler = new RecordingHandler().RespondWith( + System.Net.HttpStatusCode.OK, + "{\"devices\":[]}" + ); + using var seam = new SeamClient(options with { HttpMessageHandler = handler }); + + await seam.Devices.ListAsync(); + + return Assert.Single(handler.Requests); + } + + [Fact] + public async Task SendsDefaultHeaders() + { + var request = await RecordAsync( + new SeamClientOptions + { + ApiKey = "seam_apikey1_token", + Endpoint = "https://example.com", + } + ); + + Assert.Equal("Bearer seam_apikey1_token", request.Headers["Authorization"]); + Assert.Equal("seamapi/csharp", request.Headers["seam-sdk-name"]); + Assert.Matches(new Regex(@"^\d+\.\d+\.\d+"), request.Headers["seam-sdk-version"]); + Assert.False(request.Headers.ContainsKey("seam-workspace")); + } + + [Fact] + public async Task SendsWorkspaceHeaderWithAPersonalAccessToken() + { + var request = await RecordAsync( + new SeamClientOptions + { + PersonalAccessToken = "seam_at1_token", + WorkspaceId = "workspace1", + Endpoint = "https://example.com", + } + ); + + Assert.Equal("Bearer seam_at1_token", request.Headers["Authorization"]); + Assert.Equal("workspace1", request.Headers["seam-workspace"]); + } + + [Fact] + public async Task SdkVersionHeaderMatchesThePackageVersion() + { + var request = await RecordAsync( + new SeamClientOptions + { + ApiKey = "seam_apikey1_token", + Endpoint = "https://example.com", + } + ); + + Assert.Equal(Seam.Http.SeamVersion.Value, request.Headers["seam-sdk-version"]); + } +} diff --git a/test/Seam.Test/HttpErrorTests.cs b/test/Seam.Test/HttpErrorTests.cs new file mode 100644 index 00000000..493cab4d --- /dev/null +++ b/test/Seam.Test/HttpErrorTests.cs @@ -0,0 +1,140 @@ +namespace Seam.Test; + +using System.Net; +using Seam.Test.Support; + +public class HttpErrorTests : FakeSeamConnectTest +{ + [Fact] + public async Task ThrowsUnauthorizedException() + { + using var seam = new SeamClient( + new SeamClientOptions { ApiKey = "seam_invalid_api_key", Endpoint = Endpoint } + ); + + var exception = await Assert.ThrowsAsync( + () => seam.Devices.ListAsync() + ); + + Assert.Equal(401, exception.StatusCode); + Assert.Equal("unauthorized", exception.Code); + Assert.StartsWith("request", exception.RequestId); + } + + [Fact] + public async Task ThrowsApiExceptionOnStandardErrorResponse() + { + using var seam = CreateSeam(); + + var exception = await Assert.ThrowsAsync( + () => seam.Devices.GetAsync(new() { DeviceId = "unknown-device" }) + ); + + Assert.Equal(404, exception.StatusCode); + Assert.Equal("device_not_found", exception.Code); + Assert.StartsWith("request", exception.RequestId); + } + + // A workspace outage answers with a 503 that is not a Seam error envelope, so it surfaces as + // the underlying transport error rather than a fabricated Seam exception. + [Fact] + public async Task WorkspaceOutageSurfacesTheTransportError() + { + using var seam = CreateSeam(maxRetries: 0); + + await PostFakeAsync( + seam, + "/_fake/simulate_workspace_outage", + new { workspace_id = Seed("seed_workspace_1"), routes = new[] { "/devices/list" } } + ); + + var exception = await Assert.ThrowsAsync( + () => seam.Devices.ListAsync() + ); + + Assert.Equal(HttpStatusCode.ServiceUnavailable, exception.StatusCode); + } +} + +public class InvalidInputTests +{ + private static readonly string InvalidInputBody = """ + { + "error": { + "type": "invalid_input", + "message": "Invalid input", + "validation_errors": { + "device_ids": { "_errors": ["Expected array, received number"] } + }, + "request_id": "request1" + } + } + """; + + private static SeamClient CreateSeam(RecordingHandler handler) + { + return new SeamClient( + new SeamClientOptions + { + ApiKey = "seam_apikey1_token", + Endpoint = "https://example.com", + HttpMessageHandler = handler, + } + ); + } + + [Fact] + public async Task ThrowsInvalidInputExceptionWithValidationMessages() + { + var handler = new RecordingHandler().RespondWith( + HttpStatusCode.BadRequest, + InvalidInputBody, + headers: new Dictionary { ["seam-request-id"] = "request1" } + ); + using var seam = CreateSeam(handler); + + var exception = await Assert.ThrowsAsync( + () => seam.Devices.ListAsync() + ); + + Assert.Equal(400, exception.StatusCode); + Assert.Equal("invalid_input", exception.Code); + Assert.Equal("request1", exception.RequestId); + Assert.Equal( + new[] { "Expected array, received number" }, + exception.GetValidationErrorMessages("device_ids") + ); + } + + [Fact] + public async Task ValidationMessagesAreEmptyForAnUnknownParam() + { + var handler = new RecordingHandler().RespondWith( + HttpStatusCode.BadRequest, + InvalidInputBody + ); + using var seam = CreateSeam(handler); + + var exception = await Assert.ThrowsAsync( + () => seam.Devices.ListAsync() + ); + + Assert.Empty(exception.GetValidationErrorMessages("non_existent_param")); + } + + [Fact] + public async Task RequestIdIsNullWhenTheHeaderIsAbsent() + { + var handler = new RecordingHandler().RespondWith( + HttpStatusCode.BadRequest, + InvalidInputBody + ); + using var seam = CreateSeam(handler); + + var exception = await Assert.ThrowsAsync( + () => seam.Devices.ListAsync() + ); + + Assert.Null(exception.RequestId); + } +} diff --git a/test/Seam.Test/MalformedResponseTests.cs b/test/Seam.Test/MalformedResponseTests.cs new file mode 100644 index 00000000..8e261896 --- /dev/null +++ b/test/Seam.Test/MalformedResponseTests.cs @@ -0,0 +1,66 @@ +namespace Seam.Test; + +using System.Net; +using Seam.Test.Support; + +// A response that is not a Seam error envelope must surface as the transport's own error, never +// as a fabricated Seam exception. +public class MalformedResponseTests +{ + private static SeamClient CreateSeam(RecordingHandler handler) + { + return new SeamClient( + new SeamClientOptions + { + ApiKey = "seam_apikey1_token", + Endpoint = "https://example.com", + HttpMessageHandler = handler, + MaxRetries = 0, + } + ); + } + + [Theory] + [InlineData("Bad Gateway", "text/html")] + [InlineData("not json at all", "application/json")] + [InlineData("{\"message\":\"no error envelope\"}", "application/json")] + [InlineData("{\"error\":\"a string, not an object\"}", "application/json")] + [InlineData("{\"error\":{\"type\":42}}", "application/json")] + public async Task NonSeamErrorResponsesSurfaceTheTransportError(string body, string contentType) + { + var handler = new RecordingHandler().RespondWith( + HttpStatusCode.BadGateway, + body, + contentType + ); + using var seam = CreateSeam(handler); + + var exception = await Assert.ThrowsAsync( + () => seam.Devices.ListAsync() + ); + + Assert.Equal(HttpStatusCode.BadGateway, exception.StatusCode); + } + + [Fact] + public async Task MalformedSuccessBodyRaisesAJsonException() + { + var handler = new RecordingHandler().RespondWith(HttpStatusCode.OK, "not json at all"); + using var seam = CreateSeam(handler); + + await Assert.ThrowsAsync(() => seam.Devices.ListAsync()); + } + + [Fact] + public async Task RedirectIsNotTreatedAsSuccess() + { + var handler = new RecordingHandler().RespondWith( + HttpStatusCode.Found, + "", + headers: new Dictionary { ["Location"] = "https://example.com/" } + ); + using var seam = CreateSeam(handler); + + await Assert.ThrowsAsync(() => seam.Devices.ListAsync()); + } +} diff --git a/test/Seam.Test/Client/NullTests.cs b/test/Seam.Test/NullTests.cs similarity index 53% rename from test/Seam.Test/Client/NullTests.cs rename to test/Seam.Test/NullTests.cs index 50c5f7c1..9d45ba3c 100644 --- a/test/Seam.Test/Client/NullTests.cs +++ b/test/Seam.Test/NullTests.cs @@ -1,14 +1,13 @@ namespace Seam.Test; -using Newtonsoft.Json; -using Seam.Client; +using System.Text.Json; public class NullTests { [Fact] public void SerializesToJsonNull() { - Assert.Equal("null", JsonConvert.SerializeObject(Null.Value)); + Assert.Equal("null", JsonSerializer.Serialize(Null.Value, SeamJson.Options)); } [Fact] @@ -24,24 +23,23 @@ public void SerializesToJsonNullInsideARequestBody() Assert.Equal( "{\"name\":null,\"limit\":20,\"nested\":{\"key\":null},\"list\":[null]}", - JsonConvert.SerializeObject(body) + JsonSerializer.Serialize(body, SeamJson.Options) ); } [Fact] - public void SerializesToJsonNullUnderTheClientSerializerSettings() + public void SerializesToJsonNullInsideAGeneratedRequest() { - var request = new Api.Devices.UpdateRequest( - deviceId: "device1", - customMetadata: new Dictionary { ["sync"] = Null.Value } - ); + var request = new Routes.Devices.UpdateRequest + { + DeviceId = "device1", + CustomMetadata = new Dictionary { ["sync"] = Null.Value }, + }; - var json = JsonConvert.SerializeObject( - request, - new SeamClient(apiToken: "seam_apikey").SerializerSettings - ); + var json = JsonSerializer.Serialize(request, SeamJson.Options); - Assert.Equal("{\"custom_metadata\":{\"sync\":null},\"device_id\":\"device1\"}", json); + Assert.Contains("\"custom_metadata\":{\"sync\":null}", json); + Assert.Contains("\"device_id\":\"device1\"", json); } [Fact] diff --git a/test/Seam.Test/PaginatorTests.cs b/test/Seam.Test/PaginatorTests.cs new file mode 100644 index 00000000..82cf53e1 --- /dev/null +++ b/test/Seam.Test/PaginatorTests.cs @@ -0,0 +1,142 @@ +namespace Seam.Test; + +using Seam.Test.Support; + +public class PaginatorTests : FakeSeamConnectTest +{ + private (SeamClient Seam, SeamPaginator Pages) CreatePaginator( + int limit = 2 + ) + { + var seam = CreateSeam(); + + return (seam, seam.ConnectedAccounts.ListPager(new() { Limit = limit })); + } + + [Fact] + public async Task FirstPageReturnsTheFirstPage() + { + var (_, pages) = CreatePaginator(); + + var (accounts, pagination) = await pages.FirstPageAsync(); + + Assert.Equal(2, accounts.Count); + Assert.True(pagination.HasNextPage); + Assert.NotNull(pagination.NextPageCursor); + } + + [Fact] + public async Task NextPageReturnsTheNextPage() + { + var (_, pages) = CreatePaginator(); + + var (first, pagination) = await pages.FirstPageAsync(); + var (second, _) = await pages.NextPageAsync(pagination.NextPageCursor!); + + Assert.NotEmpty(second); + + var firstIds = first.Select(account => account.ConnectedAccountId).ToHashSet(); + Assert.DoesNotContain(second, account => firstIds.Contains(account.ConnectedAccountId)); + } + + [Fact] + public async Task NextPageRequiresACursor() + { + var (_, pages) = CreatePaginator(); + + await Assert.ThrowsAsync(() => pages.NextPageAsync(null!)); + } + + [Fact] + public async Task NextPageRejectsAnEmptyCursor() + { + var (_, pages) = CreatePaginator(); + + await Assert.ThrowsAsync(() => pages.NextPageAsync("")); + } + + [Fact] + public async Task LastPageHasNoNextPage() + { + var (_, pages) = CreatePaginator(limit: 100); + + var (_, pagination) = await pages.FirstPageAsync(); + + Assert.False(pagination.HasNextPage); + Assert.Null(pagination.NextPageCursor); + } + + [Fact] + public async Task FlattenToListReturnsEveryResource() + { + var (seam, pages) = CreatePaginator(); + + var all = await pages.FlattenToListAsync(); + var expected = await seam.ConnectedAccounts.ListAsync(); + + Assert.Equal(expected.Count, all.Count); + } + + [Fact] + public async Task FlattenIteratesEveryResource() + { + var (seam, pages) = CreatePaginator(); + + var ids = new List(); + await foreach (var account in pages.Flatten()) + { + ids.Add(account.ConnectedAccountId); + } + + var expected = await seam.ConnectedAccounts.ListAsync(); + + Assert.Equal(expected.Count, ids.Count); + Assert.Equal(ids.Distinct().Count(), ids.Count); + } + + [Fact] + public async Task PagesIteratesEveryPage() + { + var (_, pages) = CreatePaginator(); + + var pageCount = 0; + await foreach (var page in pages.Pages()) + { + Assert.NotNull(page.Pagination); + pageCount++; + } + + Assert.True(pageCount > 1); + } + + [Fact] + public async Task CreatePaginatorAcceptsAnyPageFetcher() + { + var seam = CreateSeam(); + + var pages = seam.CreatePaginator( + (pageCursor, cancellationToken) => + seam.ConnectedAccounts.ListPageAsync( + new() + { + Limit = 2, + PageCursor = pageCursor == null ? Optional.Unset : pageCursor, + }, + cancellationToken + ) + ); + + var (accounts, _) = await pages.FirstPageAsync(); + + Assert.Equal(2, accounts.Count); + } + + // The unpaginated-endpoint guard is compile-time in this SDK: an endpoint without + // pagination simply has no pager method. + [Fact] + public void UnpaginatedEndpointsHaveNoPager() + { + Assert.Null(typeof(Routes.Workspaces).GetMethod("ListPager")); + Assert.NotNull(typeof(Routes.ConnectedAccounts).GetMethod("ListPager")); + } +} diff --git a/test/Seam.Test/PersonalAccessTokenTests.cs b/test/Seam.Test/PersonalAccessTokenTests.cs new file mode 100644 index 00000000..e936b583 --- /dev/null +++ b/test/Seam.Test/PersonalAccessTokenTests.cs @@ -0,0 +1,158 @@ +namespace Seam.Test; + +using Seam.Test.Support; + +public class PersonalAccessTokenTests : FakeSeamConnectTest +{ + [Fact] + public async Task FromPersonalAccessTokenReturnsAnAuthorizedClient() + { + using var seam = SeamClient.FromPersonalAccessToken( + Seed("seam_at1_token"), + Seed("seed_workspace_1"), + new SeamClientOptions { Endpoint = Endpoint } + ); + + var devices = await seam.Devices.ListAsync(); + + Assert.NotEmpty(devices); + } + + [Fact] + public async Task ConstructorReturnsAnAuthorizedClient() + { + using var seam = new SeamClient( + new SeamClientOptions + { + PersonalAccessToken = Seed("seam_at1_token"), + WorkspaceId = Seed("seed_workspace_1"), + Endpoint = Endpoint, + } + ); + + var devices = await seam.Devices.ListAsync(); + + Assert.NotEmpty(devices); + } + + [Fact] + public void WorkspaceIdIsRequired() + { + using var env = new EnvGuard(); + + var exception = Assert.Throws( + () => new SeamClient(new SeamClientOptions { PersonalAccessToken = "seam_at1_token" }) + ); + + Assert.Contains("Must pass a WorkspaceId", exception.Message); + } + + [Fact] + public void ApiKeyCannotBeCombinedWithAPersonalAccessToken() + { + var exception = Assert.Throws( + () => + new SeamClient( + new SeamClientOptions + { + ApiKey = "seam_apikey1_token", + PersonalAccessToken = "seam_at1_token", + WorkspaceId = "workspace1", + } + ) + ); + + Assert.Contains( + "The PersonalAccessToken option cannot be used with the ApiKey option", + exception.Message + ); + } + + [Theory] + [InlineData( + "seam_cst1_token", + "A Client Session Token cannot be used as a PersonalAccessToken" + )] + [InlineData("seam_pk1_token", "A Publishable Key cannot be used as a PersonalAccessToken")] + [InlineData("ey_json_web_token", "A JWT cannot be used as a PersonalAccessToken")] + [InlineData("seam_apikey1_token", "Unknown or invalid PersonalAccessToken format")] + public void PersonalAccessTokenFormatIsChecked(string token, string message) + { + var exception = Assert.Throws( + () => + new SeamClient( + new SeamClientOptions + { + PersonalAccessToken = token, + WorkspaceId = "workspace1", + } + ) + ); + + Assert.Contains(message, exception.Message); + } + + [Fact] + public async Task WithoutWorkspaceClientListsWorkspaces() + { + using var seam = SeamWithoutWorkspaceClient.FromPersonalAccessToken( + Seed("seam_at1_token"), + endpoint: Endpoint + ); + + var workspaces = await seam.Workspaces.ListAsync(); + + Assert.NotEmpty(workspaces); + } + + [Fact] + public async Task WithoutWorkspaceConstructorListsWorkspaces() + { + using var seam = new SeamWithoutWorkspaceClient(Seed("seam_at1_token"), endpoint: Endpoint); + + var workspaces = await seam.Workspaces.ListAsync(); + + Assert.NotEmpty(workspaces); + } + + [Fact] + public async Task WithoutWorkspaceClientCreatesAWorkspace() + { + using var seam = new SeamWithoutWorkspaceClient(Seed("seam_at1_token"), endpoint: Endpoint); + + // The pinned blueprint still marks connect_partner_name obsolete; its deprecation is + // being reversed upstream, so the pragma goes away on a future regeneration. +#pragma warning disable CS0618 + var workspace = await seam.Workspaces.CreateAsync( + new() + { + Name = "Test Workspace", + ConnectPartnerName = "Test Partner", + IsSandbox = true, + } + ); +#pragma warning restore CS0618 + + Assert.NotNull(workspace.WorkspaceId); + } + + [Fact] + public void WithoutWorkspaceClientRequiresAToken() + { + using var env = new EnvGuard(); + + var exception = Assert.Throws( + () => new SeamWithoutWorkspaceClient() + ); + + Assert.Contains("Must specify a PersonalAccessToken", exception.Message); + } + + [Fact] + public void WithoutWorkspaceClientChecksTheTokenFormat() + { + Assert.Throws( + () => new SeamWithoutWorkspaceClient("seam_apikey1_token") + ); + } +} diff --git a/test/Seam.Test/ResourceTests.cs b/test/Seam.Test/ResourceTests.cs new file mode 100644 index 00000000..09e7e2ea --- /dev/null +++ b/test/Seam.Test/ResourceTests.cs @@ -0,0 +1,39 @@ +namespace Seam.Test; + +using Seam.Test.Support; + +public class ResourceTests : FakeSeamConnectTest +{ + [Fact] + public async Task DevicesDeserializeIntoTypedModels() + { + using var seam = CreateSeam(); + + var device = await seam.Devices.GetAsync(new() { DeviceId = Seed("august_device_1") }); + + Assert.Equal(Seed("august_device_1"), device.DeviceId); + Assert.Equal(Seed("seed_workspace_1"), device.WorkspaceId); + Assert.NotNull(device.Properties); + Assert.False(string.IsNullOrEmpty(device.DisplayName)); + } + + [Fact] + public async Task ListEndpointsReturnTypedLists() + { + using var seam = CreateSeam(); + + var devices = await seam.Devices.ListAsync(); + + Assert.All(devices, device => Assert.False(string.IsNullOrEmpty(device.DeviceId))); + } + + [Fact] + public async Task NestedRouteNamespacesAreReachable() + { + using var seam = CreateSeam(); + + var systems = await seam.Acs.Systems.ListAsync(); + + Assert.All(systems, system => Assert.False(string.IsNullOrEmpty(system.AcsSystemId))); + } +} diff --git a/test/Seam.Test/RetryTests.cs b/test/Seam.Test/RetryTests.cs new file mode 100644 index 00000000..474ffc8d --- /dev/null +++ b/test/Seam.Test/RetryTests.cs @@ -0,0 +1,174 @@ +namespace Seam.Test; + +using System.Net; +using Seam.Test.Support; + +public class RetryTests +{ + private const string DevicesBody = "{\"devices\":[]}"; + + private const string ActionAttemptBody = """ + {"action_attempt":{"action_type":"UNLOCK_DOOR","action_attempt_id":"attempt1","status":"pending"}} + """; + + private static SeamClient CreateSeam( + RecordingHandler handler, + int? maxRetries = null, + TimeSpan? timeout = null + ) + { + return new SeamClient( + new SeamClientOptions + { + ApiKey = "seam_apikey1_token", + Endpoint = "https://example.com", + HttpMessageHandler = handler, + MaxRetries = maxRetries, + Timeout = timeout, + WaitForActionAttempt = false, + } + ); + } + + private static Task UnlockDoorAsync(SeamClient seam) + { + return seam.Locks.UnlockDoorAsync(new() { DeviceId = "device1" }); + } + + [Fact] + public async Task DoesNotRetryPostOnServiceUnavailable() + { + var handler = new RecordingHandler().RespondWith( + HttpStatusCode.ServiceUnavailable, + "unavailable", + "text/plain" + ); + using var seam = CreateSeam(handler); + + await Assert.ThrowsAsync(() => UnlockDoorAsync(seam)); + + Assert.Equal(1, handler.AttemptCount); + } + + [Fact] + public async Task DoesNotRetryPostOnConnectionFailure() + { + var handler = new RecordingHandler().FailWith( + new HttpRequestException("Connection refused") + ); + using var seam = CreateSeam(handler); + + await Assert.ThrowsAsync(() => UnlockDoorAsync(seam)); + + Assert.Equal(1, handler.AttemptCount); + } + + [Fact] + public async Task DoesNotRetryPostOnTimeout() + { + var handler = new RecordingHandler().RespondAfter( + TimeSpan.FromSeconds(10), + HttpStatusCode.OK, + ActionAttemptBody + ); + using var seam = CreateSeam(handler, timeout: TimeSpan.FromMilliseconds(200)); + + await Assert.ThrowsAsync(() => UnlockDoorAsync(seam)); + + Assert.Equal(1, handler.AttemptCount); + } + + [Fact] + public async Task RetriesIdempotentRequestsOnTimeout() + { + var handler = new RecordingHandler() + .RespondAfter(TimeSpan.FromSeconds(10), HttpStatusCode.OK) + .RespondWith(HttpStatusCode.OK, DevicesBody); + using var seam = CreateSeam(handler, timeout: TimeSpan.FromMilliseconds(200)); + + var devices = await seam.Devices.ListAsync(); + + Assert.Empty(devices); + Assert.Equal(2, handler.AttemptCount); + } + + [Fact] + public async Task RetriesIdempotentRequestsOnServiceUnavailable() + { + var handler = new RecordingHandler() + .RespondWith(HttpStatusCode.ServiceUnavailable, "unavailable", "text/plain") + .RespondWith(HttpStatusCode.OK, DevicesBody); + using var seam = CreateSeam(handler); + + var devices = await seam.Devices.ListAsync(); + + Assert.Empty(devices); + Assert.Equal(2, handler.AttemptCount); + } + + [Fact] + public async Task RetriesIdempotentRequestsOnTooManyRequests() + { + var handler = new RecordingHandler() + .RespondWith( + HttpStatusCode.TooManyRequests, + "slow down", + "text/plain", + new Dictionary { ["Retry-After"] = "0" } + ) + .RespondWith(HttpStatusCode.OK, DevicesBody); + using var seam = CreateSeam(handler); + + var devices = await seam.Devices.ListAsync(); + + Assert.Empty(devices); + Assert.Equal(2, handler.AttemptCount); + } + + [Fact] + public async Task RetriesIdempotentRequestsOnConnectionFailure() + { + var handler = new RecordingHandler() + .FailWith(new HttpRequestException("Connection reset")) + .RespondWith(HttpStatusCode.OK, DevicesBody); + using var seam = CreateSeam(handler); + + var devices = await seam.Devices.ListAsync(); + + Assert.Empty(devices); + Assert.Equal(2, handler.AttemptCount); + } + + [Fact] + public async Task StopsRetryingOnceRetriesAreExhausted() + { + var handler = new RecordingHandler().RespondWith( + HttpStatusCode.ServiceUnavailable, + "unavailable", + "text/plain" + ); + using var seam = CreateSeam(handler); + + var exception = await Assert.ThrowsAsync( + () => seam.Devices.ListAsync() + ); + + Assert.Equal(HttpStatusCode.ServiceUnavailable, exception.StatusCode); + Assert.Equal(3, handler.AttemptCount); + } + + [Fact] + public async Task DoesNotRetryWhenRetriesAreDisabled() + { + var handler = new RecordingHandler().RespondWith( + HttpStatusCode.ServiceUnavailable, + "unavailable", + "text/plain" + ); + using var seam = CreateSeam(handler, maxRetries: 0); + + await Assert.ThrowsAsync(() => seam.Devices.ListAsync()); + + Assert.Equal(1, handler.AttemptCount); + } +} diff --git a/test/Seam.Test/Seam.Test.csproj b/test/Seam.Test/Seam.Test.csproj index 05858056..b128db53 100644 --- a/test/Seam.Test/Seam.Test.csproj +++ b/test/Seam.Test/Seam.Test.csproj @@ -10,13 +10,13 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -26,4 +26,8 @@ + + + + diff --git a/test/Seam.Test/SeamWebhookTests.cs b/test/Seam.Test/SeamWebhookTests.cs new file mode 100644 index 00000000..79d00141 --- /dev/null +++ b/test/Seam.Test/SeamWebhookTests.cs @@ -0,0 +1,79 @@ +namespace Seam.Test; + +using System.Security.Cryptography; +using System.Text; +using Svix.Exceptions; + +public class SeamWebhookTests +{ + private const string Secret = "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"; + + private const string Payload = """ + {"event_id":"8d7e0b26-5e6c-4a1f-9b3d-1b0f0e5a9c11","event_type":"device.connected","workspace_id":"398d80b7-3f96-47c2-b85a-6f8ba21d07be","device_id":"054765c8-a2fc-4599-b486-14c19f462c45","created_at":"2024-01-01T00:00:00.000Z","occurred_at":"2024-01-01T00:00:00.000Z"} + """; + + // Signs the payload the way Svix does: v1,base64(hmac_sha256(key, "{id}.{timestamp}.{payload}")). + private static Dictionary SignedHeaders(string payload) + { + var id = "msg_test"; + var timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(); + + var key = Convert.FromBase64String(Secret["whsec_".Length..]); + using var hmac = new HMACSHA256(key); + var signature = Convert.ToBase64String( + hmac.ComputeHash(Encoding.UTF8.GetBytes($"{id}.{timestamp}.{payload}")) + ); + + return new Dictionary + { + ["svix-id"] = id, + ["svix-timestamp"] = timestamp, + ["svix-signature"] = $"v1,{signature}", + }; + } + + [Fact] + public void VerifyReturnsTheEvent() + { + var seamEvent = new SeamWebhook(Secret).Verify(Payload, SignedHeaders(Payload)); + + Assert.Equal("device.connected", seamEvent.EventType); + Assert.Equal("8d7e0b26-5e6c-4a1f-9b3d-1b0f0e5a9c11", seamEvent.EventId); + } + + [Fact] + public void VerifyAcceptsHeadersInAnyCase() + { + var headers = SignedHeaders(Payload) + .ToDictionary(pair => pair.Key.ToUpperInvariant(), pair => pair.Value); + + var seamEvent = new SeamWebhook(Secret).Verify(Payload, headers); + + Assert.Equal("device.connected", seamEvent.EventType); + } + + [Fact] + public void VerifyRejectsATamperedPayload() + { + var headers = SignedHeaders(Payload); + var tampered = Payload.Replace("device.connected", "device.disconnected"); + + Assert.Throws( + () => new SeamWebhook(Secret).Verify(tampered, headers) + ); + } + + [Fact] + public void VerifyRejectsTheWrongSecret() + { + var headers = SignedHeaders(Payload); + + Assert.Throws( + () => + new SeamWebhook("whsec_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=").Verify( + Payload, + headers + ) + ); + } +} diff --git a/test/Seam.Test/SearchParamsTests.cs b/test/Seam.Test/SearchParamsTests.cs new file mode 100644 index 00000000..f495743e --- /dev/null +++ b/test/Seam.Test/SearchParamsTests.cs @@ -0,0 +1,119 @@ +namespace Seam.Test; + +using System.Net; +using Seam.Test.Support; + +// Wire-level assertions: GET and DELETE carry their parameters as URL search parameters per the +// Seam serialization standard with strict mode enabled, everything else sends a JSON body. +public class SearchParamsTests +{ + private static (SeamClient Seam, RecordingHandler Handler) CreateSeam(string body = "{}") + { + var handler = new RecordingHandler().RespondWith(HttpStatusCode.OK, body); + var seam = new SeamClient( + new SeamClientOptions + { + ApiKey = "seam_apikey1_token", + Endpoint = "https://example.com", + HttpMessageHandler = handler, + WaitForActionAttempt = false, + } + ); + + return (seam, handler); + } + + [Fact] + public async Task GetCarriesParametersInTheQuery() + { + var (seam, handler) = CreateSeam("{\"devices\":[]}"); + + await seam.Devices.ListAsync( + new() + { + Limit = 2, + DeviceIds = new List { "device1", "device2" }, + } + ); + + var request = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Get, request.Method); + Assert.Equal("/devices/list", request.Uri.AbsolutePath); + Assert.Contains("limit=2", request.Uri.Query); + Assert.Contains("device_ids=device1", request.Uri.Query); + Assert.Contains("device_ids=device2", request.Uri.Query); + Assert.Contains("_strict=true", request.Uri.Query); + Assert.Equal("", request.Body); + } + + [Fact] + public async Task GetWithoutParametersHasAnEmptyQuery() + { + var (seam, handler) = CreateSeam("{\"devices\":[]}"); + + await seam.Devices.ListAsync(); + + var request = Assert.Single(handler.Requests); + Assert.Equal("", request.Uri.Query); + } + + [Fact] + public async Task DeleteCarriesParametersInTheQuery() + { + var (seam, handler) = CreateSeam(); + + await seam.AccessCodes.DeleteAsync(new() { AccessCodeId = "access_code1" }); + + var request = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Delete, request.Method); + Assert.Equal("/access_codes/delete", request.Uri.AbsolutePath); + Assert.Contains("access_code_id=access_code1", request.Uri.Query); + Assert.Contains("_strict=true", request.Uri.Query); + Assert.Equal("", request.Body); + } + + [Fact] + public async Task PostSendsAJsonBody() + { + var (seam, handler) = CreateSeam( + """ + {"action_attempt":{"action_type":"UNLOCK_DOOR","action_attempt_id":"attempt1","status":"pending"}} + """ + ); + + await seam.Locks.UnlockDoorAsync(new() { DeviceId = "device1" }); + + var request = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Post, request.Method); + Assert.Equal("", request.Uri.Query); + Assert.Contains("\"device_id\":\"device1\"", request.Body); + } + + [Fact] + public async Task OmittedParametersAreAbsentFromTheBody() + { + var (seam, handler) = CreateSeam( + """ + {"action_attempt":{"action_type":"UNLOCK_DOOR","action_attempt_id":"attempt1","status":"pending"}} + """ + ); + + await seam.Locks.UnlockDoorAsync(new() { DeviceId = "device1" }); + + var request = Assert.Single(handler.Requests); + Assert.Equal("{\"device_id\":\"device1\"}", request.Body); + } + + [Fact] + public async Task AtLeastOneParameterIsRequiredLocally() + { + var (seam, handler) = CreateSeam(); + + var exception = await Assert.ThrowsAsync( + () => seam.Devices.GetAsync(new()) + ); + + Assert.Contains("At least one parameter is required", exception.Message); + Assert.Empty(handler.Requests); + } +} diff --git a/test/Seam.Test/SerializationTests.cs b/test/Seam.Test/SerializationTests.cs new file mode 100644 index 00000000..3cbb78e2 --- /dev/null +++ b/test/Seam.Test/SerializationTests.cs @@ -0,0 +1,150 @@ +namespace Seam.Test; + +using System.Text.Json; +using Seam.Models; + +public class SerializationTests +{ + private static T Deserialize(string json) + { + return JsonSerializer.Deserialize(json, SeamJson.Options)!; + } + + [Fact] + public void UnknownEnumValueDeserializesToUnrecognized() + { + var device = Deserialize( + """{"device_id":"device1","device_type":"not_a_real_device_type"}""" + ); + + Assert.Equal(Device.DeviceTypeEnum.Unrecognized, device.DeviceType); + } + + [Fact] + public void KnownEnumValueRoundTrips() + { + var device = Deserialize("""{"device_id":"device1","device_type":"august_lock"}"""); + + Assert.Equal(Device.DeviceTypeEnum.AugustLock, device.DeviceType); + Assert.Contains( + "\"device_type\":\"august_lock\"", + JsonSerializer.Serialize(device, SeamJson.Options) + ); + } + + [Fact] + public void UnknownActionTypeDeserializesToUnrecognizedVariant() + { + var actionAttempt = Deserialize( + """ + {"action_type":"BRAND_NEW_ACTION","action_attempt_id":"attempt1","status":"pending","extra":{"a":1}} + """ + ); + + var unrecognized = Assert.IsType(actionAttempt); + Assert.Equal("unrecognized", unrecognized.ActionType); + Assert.Equal("attempt1", unrecognized.ActionAttemptId); + Assert.Equal(ActionAttemptStatus.Pending, unrecognized.Status); + + // The raw payload of an unrecognized variant is preserved, not discarded. + Assert.Equal( + "BRAND_NEW_ACTION", + unrecognized.RawJson.GetProperty("action_type").GetString() + ); + Assert.Equal(1, unrecognized.RawJson.GetProperty("extra").GetProperty("a").GetInt32()); + } + + [Fact] + public void KnownActionTypeDeserializesToItsVariant() + { + var actionAttempt = Deserialize( + """ + {"action_type":"UNLOCK_DOOR","action_attempt_id":"attempt1","status":"success","result":{}} + """ + ); + + Assert.IsType(actionAttempt); + Assert.Equal(ActionAttemptStatus.Success, actionAttempt.Status); + Assert.Equal("UNLOCK_DOOR", actionAttempt.ActionType); + } + + [Fact] + public void UnknownEventTypeDeserializesToUnrecognizedVariant() + { + var seamEvent = Deserialize( + """ + {"event_type":"brand.new_event","event_id":"event1","workspace_id":"workspace1"} + """ + ); + + var unrecognized = Assert.IsType(seamEvent); + Assert.Equal("event1", unrecognized.EventId); + Assert.Equal("brand.new_event", unrecognized.RawJson.GetProperty("event_type").GetString()); + } + + [Fact] + public void KnownEventTypeDeserializesToItsVariant() + { + var seamEvent = Deserialize( + """ + {"event_type":"device.connected","event_id":"event1","workspace_id":"workspace1","device_id":"device1"} + """ + ); + + Assert.Equal("device.connected", seamEvent.EventType); + Assert.Equal("event1", seamEvent.EventId); + } + + [Fact] + public void UnknownActionAttemptStatusDeserializesToUnrecognized() + { + var actionAttempt = Deserialize( + """ + {"action_type":"UNLOCK_DOOR","action_attempt_id":"attempt1","status":"not_a_status"} + """ + ); + + Assert.Equal(ActionAttemptStatus.Unrecognized, actionAttempt.Status); + } + + [Fact] + public void UnsetOptionalParametersAreOmitted() + { + var json = JsonSerializer.Serialize( + new Routes.ConnectedAccounts.ListRequest(), + SeamJson.Options + ); + + Assert.Equal("{}", json); + } + + [Fact] + public void OptionalParametersSerializeTheirValue() + { + var json = JsonSerializer.Serialize( + new Routes.ConnectedAccounts.ListRequest { PageCursor = "cursor1" }, + SeamJson.Options + ); + + Assert.Contains("\"page_cursor\":\"cursor1\"", json); + } + + [Fact] + public void OptionalParametersSerializeAnExplicitNull() + { + var json = JsonSerializer.Serialize( + new Routes.ConnectedAccounts.ListRequest { PageCursor = Null.Value }, + SeamJson.Options + ); + + Assert.Contains("\"page_cursor\":null", json); + } + + [Fact] + public void NullOptionalParametersAreOmitted() + { + var json = JsonSerializer.Serialize(new Routes.Devices.ListRequest(), SeamJson.Options); + + Assert.Equal("{}", json); + } +} diff --git a/test/Seam.Test/Client/StrictUrlSearchParamsSerializerTests.cs b/test/Seam.Test/StrictUrlSearchParamsSerializerTests.cs similarity index 98% rename from test/Seam.Test/Client/StrictUrlSearchParamsSerializerTests.cs rename to test/Seam.Test/StrictUrlSearchParamsSerializerTests.cs index bc149338..0233c35c 100644 --- a/test/Seam.Test/Client/StrictUrlSearchParamsSerializerTests.cs +++ b/test/Seam.Test/StrictUrlSearchParamsSerializerTests.cs @@ -1,7 +1,5 @@ namespace Seam.Test; -using Seam.Client; - public class StrictUrlSearchParamsSerializerTests { private static string Serialize(params (string Name, object? Value)[] parameters) diff --git a/test/Seam.Test/Support/EnvGuard.cs b/test/Seam.Test/Support/EnvGuard.cs new file mode 100644 index 00000000..34eca79c --- /dev/null +++ b/test/Seam.Test/Support/EnvGuard.cs @@ -0,0 +1,40 @@ +namespace Seam.Test.Support; + +/// +/// Clears the SEAM_* environment variables for the duration of a test and restores whatever was +/// set before, so environment-driven construction is deterministic. +/// +public sealed class EnvGuard : IDisposable +{ + private static readonly string[] Names = + { + "SEAM_API_KEY", + "SEAM_PERSONAL_ACCESS_TOKEN", + "SEAM_WORKSPACE_ID", + "SEAM_ENDPOINT", + }; + + private readonly Dictionary _saved = new(); + + public EnvGuard() + { + foreach (var name in Names) + { + _saved[name] = Environment.GetEnvironmentVariable(name); + Environment.SetEnvironmentVariable(name, null); + } + } + + public void Set(string name, string value) + { + Environment.SetEnvironmentVariable(name, value); + } + + public void Dispose() + { + foreach (var (name, value) in _saved) + { + Environment.SetEnvironmentVariable(name, value); + } + } +} diff --git a/test/Seam.Test/Support/FakeSeamConnect.cs b/test/Seam.Test/Support/FakeSeamConnect.cs new file mode 100644 index 00000000..ff7e3b71 --- /dev/null +++ b/test/Seam.Test/Support/FakeSeamConnect.cs @@ -0,0 +1,179 @@ +using System.Diagnostics; +using System.Net.Sockets; +using System.Text.Json; + +namespace Seam.Test.Support; + +/// +/// Runs a fake Seam Connect server for the duration of a single test. +/// +/// +/// Prefer this over stubbing HTTP responses: the fake exercises the SDK against a real server +/// and seeded records. Use only for the things the fake cannot +/// do: asserting what goes out on the wire, counting retries, and serving malformed responses. +/// +public sealed class FakeSeamConnect : IAsyncDisposable +{ + private static readonly TimeSpan StartupTimeout = TimeSpan.FromSeconds(30); + + private static readonly TimeSpan PollInterval = TimeSpan.FromMilliseconds(50); + + private static readonly HttpClient Http = new() { Timeout = TimeSpan.FromSeconds(5) }; + + private Process? _process; + + private JsonElement _seed; + + public string Endpoint { get; private set; } = ""; + + /// An id or token of a seeded record, e.g. seam_apikey1_token. + public string Seed(string key) => _seed.GetProperty(key).GetString()!; + + public static async Task StartAsync() + { + var fake = new FakeSeamConnect(); + await fake.RunAsync(); + + return fake; + } + + private async Task RunAsync() + { + var binary = FindBinary(); + var port = UnusedPort(); + Endpoint = $"http://127.0.0.1:{port}"; + + // The binary is spawned directly rather than through npm so the process handle is the + // server itself and stopping it does not leave an orphan behind. PORT goes to the child + // only, leaving the parent environment alone for the tests that read it. + var startInfo = new ProcessStartInfo + { + FileName = binary, + ArgumentList = { "--seed" }, + UseShellExecute = false, + RedirectStandardOutput = true, + RedirectStandardError = true, + }; + startInfo.Environment["PORT"] = port.ToString(); + + _process = + Process.Start(startInfo) + ?? throw new InvalidOperationException("Could not start Fake Seam Connect."); + + // Drain the output pipes so the server never blocks on a full buffer. + _process.OutputDataReceived += (_, _) => { }; + _process.ErrorDataReceived += (_, _) => { }; + _process.BeginOutputReadLine(); + _process.BeginErrorReadLine(); + + await WaitForHealthAsync(); + _seed = await FetchSeedAsync(); + } + + public async ValueTask DisposeAsync() + { + if (_process == null) + return; + + try + { + _process.Kill(entireProcessTree: true); + await _process.WaitForExitAsync(); + } + catch (InvalidOperationException) + { + // The process already exited. + } + + _process.Dispose(); + _process = null; + } + + private async Task WaitForHealthAsync() + { + var startup = Stopwatch.StartNew(); + + while (startup.Elapsed < StartupTimeout) + { + if (_process!.HasExited) + throw new InvalidOperationException( + "Fake Seam Connect exited before becoming healthy." + ); + + if (await GetAsync("/health") != null) + return; + + await Task.Delay(PollInterval); + } + + throw new TimeoutException( + $"Fake Seam Connect did not become healthy within {StartupTimeout.TotalSeconds}s." + ); + } + + private async Task FetchSeedAsync() + { + var body = + await GetAsync("/_fake/default_seed") + ?? throw new InvalidOperationException( + "Could not read the seed from Fake Seam Connect." + ); + + using var document = JsonDocument.Parse(body); + + return document.RootElement.Clone(); + } + + private async Task GetAsync(string path) + { + try + { + using var response = await Http.GetAsync(Endpoint + path); + + return response.IsSuccessStatusCode ? await response.Content.ReadAsStringAsync() : null; + } + catch (HttpRequestException) + { + return null; + } + catch (TaskCanceledException) + { + return null; + } + } + + private static string FindBinary() + { + // Walk up from the test assembly to the repository root holding node_modules. + for ( + var directory = new DirectoryInfo(AppContext.BaseDirectory); + directory != null; + directory = directory.Parent + ) + { + var binary = Path.Combine( + directory.FullName, + "node_modules", + ".bin", + OperatingSystem.IsWindows() ? "fake-seam-connect.cmd" : "fake-seam-connect" + ); + + if (File.Exists(binary)) + return binary; + } + + throw new FileNotFoundException( + "Could not find fake-seam-connect, run npm install before the tests." + ); + } + + private static int UnusedPort() + { + var listener = new TcpListener(System.Net.IPAddress.Loopback, 0); + listener.Start(); + var port = ((System.Net.IPEndPoint)listener.LocalEndpoint).Port; + listener.Stop(); + + return port; + } +} diff --git a/test/Seam.Test/Support/FakeSeamConnectTest.cs b/test/Seam.Test/Support/FakeSeamConnectTest.cs new file mode 100644 index 00000000..0555557a --- /dev/null +++ b/test/Seam.Test/Support/FakeSeamConnectTest.cs @@ -0,0 +1,64 @@ +using System.Text; +using System.Text.Json; + +namespace Seam.Test.Support; + +/// +/// Base class for tests that run against a fake Seam Connect server. A fresh server is started +/// for every test so no test can observe another's mutations. +/// +public abstract class FakeSeamConnectTest : IAsyncLifetime +{ + protected FakeSeamConnect Fake { get; private set; } = null!; + + protected string Endpoint => Fake.Endpoint; + + protected string Seed(string key) => Fake.Seed(key); + + public async Task InitializeAsync() + { + Fake = await FakeSeamConnect.StartAsync(); + } + + public async Task DisposeAsync() + { + await Fake.DisposeAsync(); + } + + /// + /// A client authorized against the fake with the seeded API key. + /// + protected SeamClient CreateSeam( + ActionAttemptWait? waitForActionAttempt = null, + int? maxRetries = null, + TimeSpan? timeout = null, + HttpMessageHandler? httpMessageHandler = null + ) + { + return new SeamClient( + new SeamClientOptions + { + ApiKey = Seed("seam_apikey1_token"), + Endpoint = Endpoint, + WaitForActionAttempt = waitForActionAttempt, + MaxRetries = maxRetries, + Timeout = timeout, + HttpMessageHandler = httpMessageHandler, + } + ); + } + + /// + /// Calls one of the fake's own /_fake control endpoints. + /// + protected async Task PostFakeAsync(SeamClient seam, string path, object payload) + { + using var content = new StringContent( + JsonSerializer.Serialize(payload), + Encoding.UTF8, + "application/json" + ); + using var response = await seam.Client.PostAsync(path, content); + response.EnsureSuccessStatusCode(); + } +} diff --git a/test/Seam.Test/Support/RecordingHandler.cs b/test/Seam.Test/Support/RecordingHandler.cs new file mode 100644 index 00000000..9e80dbf6 --- /dev/null +++ b/test/Seam.Test/Support/RecordingHandler.cs @@ -0,0 +1,131 @@ +using System.Net; +using System.Text; + +namespace Seam.Test.Support; + +/// +/// An innermost serving canned responses while recording every +/// attempt that reaches it. +/// +/// +/// Use this only for the things the fake server cannot do: asserting what goes out on the wire, +/// counting retries, and serving malformed or delayed responses. Because it replaces the real +/// socket handler, every retry attempt is recorded, so counts +/// attempts, retries included. The last planned response repeats; with no plan every attempt +/// gets 200 {}. +/// +public sealed class RecordingHandler : HttpMessageHandler +{ + private readonly List>> _plan = new(); + + private int _next; + + public List Requests { get; } = new(); + + public int AttemptCount => Requests.Count; + + public RecordingHandler RespondWith( + HttpStatusCode statusCode, + string body = "{}", + string contentType = "application/json", + IReadOnlyDictionary? headers = null + ) + { + _plan.Add((_) => Task.FromResult(CreateResponse(statusCode, body, contentType, headers))); + + return this; + } + + /// Fails the attempt with a transport error. + public RecordingHandler FailWith(Exception exception) + { + _plan.Add((_) => Task.FromException(exception)); + + return this; + } + + /// + /// Delays the response so the attempt outlives a shorter per-attempt timeout. + /// + public RecordingHandler RespondAfter( + TimeSpan delay, + HttpStatusCode statusCode, + string body = "{}" + ) + { + _plan.Add( + async (cancellationToken) => + { + await Task.Delay(delay, cancellationToken); + + return CreateResponse(statusCode, body, "application/json", null); + } + ); + + return this; + } + + protected override async Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken + ) + { + var body = + request.Content == null + ? "" + : await request.Content.ReadAsStringAsync(cancellationToken); + + var headers = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var (name, values) in request.Headers) + { + headers[name] = string.Join(",", values); + } + if (request.Content != null) + { + foreach (var (name, values) in request.Content.Headers) + { + headers[name] = string.Join(",", values); + } + } + + Requests.Add(new RecordedRequest(request.Method, request.RequestUri!, body, headers)); + + if (_plan.Count == 0) + return CreateResponse(HttpStatusCode.OK, "{}", "application/json", null); + + var producer = _plan[Math.Min(_next, _plan.Count - 1)]; + _next++; + + return await producer(cancellationToken); + } + + private static HttpResponseMessage CreateResponse( + HttpStatusCode statusCode, + string body, + string contentType, + IReadOnlyDictionary? headers + ) + { + var response = new HttpResponseMessage(statusCode) + { + Content = new StringContent(body, Encoding.UTF8, contentType), + }; + + if (headers != null) + { + foreach (var (name, value) in headers) + { + response.Headers.TryAddWithoutValidation(name, value); + } + } + + return response; + } +} + +public sealed record RecordedRequest( + HttpMethod Method, + Uri Uri, + string Body, + IReadOnlyDictionary Headers +); diff --git a/test/Seam.Test/TimeoutTests.cs b/test/Seam.Test/TimeoutTests.cs new file mode 100644 index 00000000..8887979c --- /dev/null +++ b/test/Seam.Test/TimeoutTests.cs @@ -0,0 +1,65 @@ +namespace Seam.Test; + +using System.Net; +using Seam.Test.Support; + +public class TimeoutTests +{ + private static SeamClient CreateSeam(RecordingHandler handler, TimeSpan? timeout = null) + { + return new SeamClient( + new SeamClientOptions + { + ApiKey = "seam_apikey1_token", + Endpoint = "https://example.com", + HttpMessageHandler = handler, + Timeout = timeout, + MaxRetries = 0, + } + ); + } + + [Fact] + public async Task ATimedOutAttemptThrowsATimeoutException() + { + var handler = new RecordingHandler().RespondAfter( + TimeSpan.FromSeconds(10), + HttpStatusCode.OK + ); + using var seam = CreateSeam(handler, timeout: TimeSpan.FromMilliseconds(200)); + + await Assert.ThrowsAsync(() => seam.Devices.ListAsync()); + } + + [Fact] + public async Task ASlowResponseWithinTheTimeoutSucceeds() + { + var handler = new RecordingHandler().RespondAfter( + TimeSpan.FromMilliseconds(100), + HttpStatusCode.OK, + "{\"devices\":[]}" + ); + using var seam = CreateSeam(handler, timeout: TimeSpan.FromSeconds(10)); + + Assert.Empty(await seam.Devices.ListAsync()); + } + + // Cancelling the caller's token is the caller's intent, not a timeout, so it surfaces as an + // OperationCanceledException rather than the SDK's TimeoutException. + [Fact] + public async Task CallerCancellationIsNotATimeout() + { + var handler = new RecordingHandler().RespondAfter( + TimeSpan.FromSeconds(10), + HttpStatusCode.OK + ); + using var seam = CreateSeam(handler, timeout: TimeSpan.FromSeconds(30)); + using var cancellation = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); + + var exception = await Assert.ThrowsAnyAsync( + () => seam.Devices.ListAsync(null, cancellation.Token) + ); + + Assert.IsNotType(exception); + } +} diff --git a/test/Seam.Test/Client/UrlSearchParamsSerializerTests.cs b/test/Seam.Test/UrlSearchParamsSerializerTests.cs similarity index 99% rename from test/Seam.Test/Client/UrlSearchParamsSerializerTests.cs rename to test/Seam.Test/UrlSearchParamsSerializerTests.cs index e2aecb28..08e74417 100644 --- a/test/Seam.Test/Client/UrlSearchParamsSerializerTests.cs +++ b/test/Seam.Test/UrlSearchParamsSerializerTests.cs @@ -1,7 +1,6 @@ namespace Seam.Test; using System.Collections; -using Seam.Client; public class UrlSearchParamsSerializerTests { diff --git a/test/Seam.Test/Client/UrlSearchParamsTests.cs b/test/Seam.Test/UrlSearchParamsTests.cs similarity index 99% rename from test/Seam.Test/Client/UrlSearchParamsTests.cs rename to test/Seam.Test/UrlSearchParamsTests.cs index 48411733..b216e54a 100644 --- a/test/Seam.Test/Client/UrlSearchParamsTests.cs +++ b/test/Seam.Test/UrlSearchParamsTests.cs @@ -1,7 +1,5 @@ namespace Seam.Test; -using Seam.Client; - public class UrlSearchParamsTests { [Fact] diff --git a/test/Seam.Test/VersionTests.cs b/test/Seam.Test/VersionTests.cs new file mode 100644 index 00000000..8a5752d5 --- /dev/null +++ b/test/Seam.Test/VersionTests.cs @@ -0,0 +1,28 @@ +namespace Seam.Test; + +using System.Text.RegularExpressions; +using Seam.Http; + +public class VersionTests +{ + [Fact] + public void VersionIsReadFromTheAssembly() + { + Assert.Matches(new Regex(@"^\d+\.\d+\.\d+"), SeamVersion.Value); + } + + [Fact] + public void VersionMatchesThePackageVersion() + { + var informational = typeof(SeamClient) + .Assembly.GetCustomAttributes( + typeof(System.Reflection.AssemblyInformationalVersionAttribute), + false + ) + .Cast() + .Single() + .InformationalVersion; + + Assert.StartsWith(SeamVersion.Value, informational); + } +} diff --git a/test/Seam.Test/WaitForActionAttemptTests.cs b/test/Seam.Test/WaitForActionAttemptTests.cs new file mode 100644 index 00000000..76bfdbcf --- /dev/null +++ b/test/Seam.Test/WaitForActionAttemptTests.cs @@ -0,0 +1,255 @@ +namespace Seam.Test; + +using Seam.Models; +using Seam.Test.Support; + +public class WaitForActionAttemptTests : FakeSeamConnectTest +{ + private async Task PendingActionAttemptAsync(SeamClient seam) + { + var actionAttempt = await seam.Locks.UnlockDoorAsync( + new() { DeviceId = Seed("august_device_1") } + ); + + Assert.Equal(ActionAttemptStatus.Pending, actionAttempt.Status); + + await SetStatusAsync(seam, actionAttempt, "pending"); + + return actionAttempt; + } + + private Task SetStatusAsync( + SeamClient seam, + ActionAttempt actionAttempt, + string status, + object? error = null + ) + { + return PostFakeAsync( + seam, + "/_fake/update_action_attempt", + error == null + ? new { action_attempt_id = actionAttempt.ActionAttemptId, status } + : new + { + action_attempt_id = actionAttempt.ActionAttemptId, + status, + error, + } + ); + } + + [Fact] + public async Task WaitsByDefault() + { + var actionAttempt = await CreateSeam() + .Locks.UnlockDoorAsync(new() { DeviceId = Seed("august_device_1") }); + + Assert.Equal(ActionAttemptStatus.Success, actionAttempt.Status); + } + + [Fact] + public async Task ClientDefaultCanDisableWaiting() + { + var seam = CreateSeam(waitForActionAttempt: false); + + var actionAttempt = await seam.Locks.UnlockDoorAsync( + new() { DeviceId = Seed("august_device_1") } + ); + + Assert.Equal(ActionAttemptStatus.Pending, actionAttempt.Status); + } + + // The options form of the client default has to wait just like `true` does; treating it as + // "no waiting" would hand back a pending attempt with no indication anything was skipped. + [Fact] + public async Task ClientDefaultCanBeAnOptionsObject() + { + var seam = CreateSeam( + waitForActionAttempt: new ActionAttemptWait + { + Timeout = TimeSpan.FromSeconds(5), + PollingInterval = TimeSpan.FromMilliseconds(50), + } + ); + + var actionAttempt = await seam.Locks.UnlockDoorAsync( + new() { DeviceId = Seed("august_device_1") } + ); + + Assert.Equal(ActionAttemptStatus.Success, actionAttempt.Status); + } + + [Fact] + public async Task PerCallOptionCanDisableWaiting() + { + var actionAttempt = await CreateSeam() + .Locks.UnlockDoorAsync( + new() { DeviceId = Seed("august_device_1") }, + waitForActionAttempt: false + ); + + Assert.Equal(ActionAttemptStatus.Pending, actionAttempt.Status); + } + + [Fact] + public async Task PerCallOptionCanEnableWaiting() + { + var seam = CreateSeam(waitForActionAttempt: false); + + var actionAttempt = await seam.Locks.UnlockDoorAsync( + new() { DeviceId = Seed("august_device_1") }, + waitForActionAttempt: true + ); + + Assert.Equal(ActionAttemptStatus.Success, actionAttempt.Status); + } + + [Fact] + public async Task ReturnsAnAlreadySuccessfulActionAttempt() + { + var seam = CreateSeam(waitForActionAttempt: false); + + var actionAttempt = await seam.Locks.UnlockDoorAsync( + new() { DeviceId = Seed("august_device_1") } + ); + await SetStatusAsync(seam, actionAttempt, "success"); + + var resolved = await seam.ActionAttempts.GetAsync( + new() { ActionAttemptId = actionAttempt.ActionAttemptId }, + waitForActionAttempt: true + ); + + Assert.Equal(ActionAttemptStatus.Success, resolved.Status); + Assert.Equal(actionAttempt.ActionAttemptId, resolved.ActionAttemptId); + } + + // Proves the resolver really re-reads the action attempt: it starts out pending and is moved + // to success by something outside the resolver, the way the other SDK suites do it. + [Fact] + public async Task WaitsForAnActionAttemptResolvedOutOfBand() + { + var seam = CreateSeam(waitForActionAttempt: false); + var actionAttempt = await PendingActionAttemptAsync(seam); + + var resolver = Task.Run(async () => + { + await Task.Delay(TimeSpan.FromMilliseconds(500)); + await SetStatusAsync(seam, actionAttempt, "success"); + }); + + var resolved = await seam.ActionAttempts.GetAsync( + new() { ActionAttemptId = actionAttempt.ActionAttemptId }, + waitForActionAttempt: new ActionAttemptWait + { + Timeout = TimeSpan.FromSeconds(15), + PollingInterval = TimeSpan.FromMilliseconds(100), + } + ); + + Assert.Equal(ActionAttemptStatus.Success, resolved.Status); + await resolver; + } + + [Fact] + public async Task ThrowsWhenTheActionAttemptFails() + { + var seam = CreateSeam(waitForActionAttempt: false); + + var actionAttempt = await seam.Locks.UnlockDoorAsync( + new() { DeviceId = Seed("august_device_1") } + ); + await SetStatusAsync( + seam, + actionAttempt, + "error", + new { type = "foo", message = "Failed" } + ); + + var exception = await Assert.ThrowsAsync( + () => + seam.ActionAttempts.GetAsync( + new() { ActionAttemptId = actionAttempt.ActionAttemptId }, + waitForActionAttempt: true + ) + ); + + Assert.Equal("Failed", exception.Message); + Assert.Equal("foo", exception.Code); + Assert.Equal(ActionAttemptStatus.Error, exception.ActionAttempt.Status); + Assert.Equal(actionAttempt.ActionAttemptId, exception.ActionAttempt.ActionAttemptId); + Assert.IsAssignableFrom(exception); + } + + [Fact] + public async Task TimesOutWhileTheActionAttemptIsPending() + { + var seam = CreateSeam(waitForActionAttempt: false); + var actionAttempt = await PendingActionAttemptAsync(seam); + + var exception = await Assert.ThrowsAsync( + () => + seam.ActionAttempts.GetAsync( + new() { ActionAttemptId = actionAttempt.ActionAttemptId }, + waitForActionAttempt: new ActionAttemptWait + { + Timeout = TimeSpan.FromMilliseconds(200), + PollingInterval = TimeSpan.FromSeconds(5), + } + ) + ); + + Assert.Equal(actionAttempt.ActionAttemptId, exception.ActionAttempt.ActionAttemptId); + Assert.Contains("Timed out waiting for action attempt", exception.Message); + } + + // Resolving fetches the action attempt through the transport rather than the route client, + // so enabling the option on the route that reads action attempts cannot recurse. + [Fact] + public async Task ActionAttemptsGetDoesNotRecurse() + { + var seam = CreateSeam(waitForActionAttempt: false); + + var actionAttempt = await seam.Locks.UnlockDoorAsync( + new() { DeviceId = Seed("august_device_1") } + ); + await SetStatusAsync(seam, actionAttempt, "success"); + + var resolved = await seam.ActionAttempts.GetAsync( + new() { ActionAttemptId = actionAttempt.ActionAttemptId }, + waitForActionAttempt: new ActionAttemptWait + { + Timeout = TimeSpan.FromSeconds(1), + PollingInterval = TimeSpan.FromMilliseconds(50), + } + ); + + Assert.Equal(ActionAttemptStatus.Success, resolved.Status); + } + + // A list of action attempts is returned as is: only a single returned attempt is ever + // resolved, so listing must not poll pending attempts. + [Fact] + public async Task ListReturnsActionAttemptsWithoutResolvingThem() + { + var seam = CreateSeam(waitForActionAttempt: false); + var pending = await PendingActionAttemptAsync(seam); + + var attempts = await seam.ActionAttempts.ListAsync( + new() { ActionAttemptIds = new List { pending.ActionAttemptId } } + ); + + var attempt = Assert.Single(attempts); + Assert.Equal(pending.ActionAttemptId, attempt.ActionAttemptId); + Assert.Equal(ActionAttemptStatus.Pending, attempt.Status); + } + + [Fact] + public void WaitForActionAttemptDefaultsToEnabled() + { + Assert.True(ActionAttemptWait.Default.Enabled); + Assert.Equal(TimeSpan.FromSeconds(10), ActionAttemptWait.Default.Timeout); + Assert.Equal(TimeSpan.FromSeconds(1), ActionAttemptWait.Default.PollingInterval); + Assert.False(ActionAttemptWait.DoNotWait.Enabled); + } +} diff --git a/test/Seam.Test/xunit.runner.json b/test/Seam.Test/xunit.runner.json new file mode 100644 index 00000000..08c512b3 --- /dev/null +++ b/test/Seam.Test/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "parallelizeTestCollections": false +}