From 62e6ab863ebb076df366a4a3d85a1d424eedec23 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 5 Nov 2026 15:45:02 -0800 Subject: [PATCH 1/7] feat(deps-dev): bump the seam group with 3 updates --- package-lock.json | 24 ++++++++++++------------ package.json | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index c392fc2..86b31cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,9 @@ "license": "MIT", "devDependencies": { "@seamapi/blueprint": "^1.12.0", - "@seamapi/fake-seam-connect": "2.0.5", - "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1092.0", + "@seamapi/fake-seam-connect": "2.0.6", + "@seamapi/smith": "^1.1.1", + "@seamapi/types": "1.1159.0", "change-case": "^5.4.4", "del": "^8.0.0", "execa": "^10.0.1", @@ -804,9 +804,9 @@ } }, "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==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@seamapi/fake-seam-connect/-/fake-seam-connect-2.0.6.tgz", + "integrity": "sha512-lwesSVm0AhQ57QuV52iGTI2qkK++phcY0K/xkalsUWdbwyPK4cj2VfJuW3yes32HuTaXkwPWlT9lrIhLJzZOnQ==", "dev": true, "license": "MIT", "bin": { @@ -822,9 +822,9 @@ } }, "node_modules/@seamapi/smith": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@seamapi/smith/-/smith-1.1.0.tgz", - "integrity": "sha512-sI542rvN7Kq+whft3Ff5R6RRB7ORu2y23TGZOHtvEoxNp2OIYwf/wSuuY+7fZhZvIMvDsXSQJQyytOfrgKpxgg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@seamapi/smith/-/smith-1.1.1.tgz", + "integrity": "sha512-AcDsvtfhrfJLfkZ2m7uXCgkQL5rpaCQDE+d71f9mc3lUAv3otZv4IkNv0hvK4wjaaRJ3QEp+9tiu0fR4M64jYw==", "dev": true, "license": "MIT", "dependencies": { @@ -855,9 +855,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1092.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1092.0.tgz", - "integrity": "sha512-99Wi8sSk4RZ2g9/iRJiONtIp9Hc/c2Xe5SeIIacbwxKbqkpmiTi8tQO0+M2qGXVzYuoO3xM/lBkEy4kUAhe/Ew==", + "version": "1.1159.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1159.0.tgz", + "integrity": "sha512-QuJY2XT/A61PlEN/8+QsEcYzJk13dc8v1rNC5yWXWv0iJfwc0zOIly+Z3RdcEX+Gg+ghRUoaIHVk4WSJlzRHJQ==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 80efd01..83757a1 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,9 @@ "packageManager": "npm@11.19.0", "devDependencies": { "@seamapi/blueprint": "^1.12.0", - "@seamapi/fake-seam-connect": "2.0.5", - "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1092.0", + "@seamapi/fake-seam-connect": "2.0.6", + "@seamapi/smith": "^1.1.1", + "@seamapi/types": "1.1159.0", "change-case": "^5.4.4", "del": "^8.0.0", "execa": "^10.0.1", From bec236642995f2ecff7cc8333c4a6a3b043193e2 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 5 Nov 2026 15:46:44 -0800 Subject: [PATCH 2/7] Update automerge to check src --- .github/workflows/automerge.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index c72fae7..984b587 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -30,8 +30,7 @@ jobs: uses: tj-actions/changed-files@v44 with: files: | - src/Seam/Api/** - src/Seam/Model/** + src/** merge: name: Merge runs-on: ubuntu-latest From 60afee51f7a8a8fc16baae1930f95dfac45e1df9 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Thu, 5 Nov 2026 23:48:08 +0000 Subject: [PATCH 3/7] ci: Generate code --- src/Seam/Models/AccessCode.cs | 17 + src/Seam/Models/AccessGrant.cs | 48 +- src/Seam/Models/AccessMethod.cs | 49 +- src/Seam/Models/AcsCredential.cs | 7 + src/Seam/Models/AcsEntrance.cs | 61 ++- src/Seam/Models/AcsSystem.cs | 10 + src/Seam/Models/ActionAttempt.cs | 99 +++- src/Seam/Models/ConnectWebview.cs | 3 + src/Seam/Models/ConnectedAccount.cs | 3 + src/Seam/Models/Device.cs | 160 +++++- src/Seam/Models/DeviceProvider.cs | 25 +- src/Seam/Models/Event.cs | 7 +- src/Seam/Models/Phone.cs | 605 +++++++++++++++++++++-- src/Seam/Models/Space.cs | 60 +++ src/Seam/Models/UnmanagedAccessCode.cs | 17 + src/Seam/Models/UnmanagedAccessGrant.cs | 53 +- src/Seam/Models/UnmanagedAccessMethod.cs | 58 ++- src/Seam/Models/UnmanagedDevice.cs | 50 +- src/Seam/Routes/AccessCodes.cs | 46 +- src/Seam/Routes/AccessGrantsUnmanaged.cs | 6 + src/Seam/Routes/AccessMethods.cs | 7 + src/Seam/Routes/CamerasLiveViews.cs | 6 +- src/Seam/Routes/ConnectWebviews.cs | 36 +- src/Seam/Routes/ConnectedAccounts.cs | 3 + src/Seam/Routes/Customers.cs | 334 ++++++++++++- src/Seam/Routes/Devices.cs | 147 +++--- src/Seam/Routes/DevicesUnmanaged.cs | 147 +++--- src/Seam/Routes/Events.cs | 8 +- src/Seam/Routes/Locks.cs | 6 + src/Seam/Routes/UserIdentities.cs | 12 + 30 files changed, 1783 insertions(+), 307 deletions(-) diff --git a/src/Seam/Models/AccessCode.cs b/src/Seam/Models/AccessCode.cs index ee2ba48..fea065d 100644 --- a/src/Seam/Models/AccessCode.cs +++ b/src/Seam/Models/AccessCode.cs @@ -920,6 +920,10 @@ public enum TypeEnum typeof(AccessCodeWarningsUsingBackupAccessCode) )] [SeamUnionVariant("being_deleted", typeof(AccessCodeWarningsBeingDeleted))] + [SeamUnionVariant( + "device_unreachable_for_extended_period", + typeof(AccessCodeWarningsDeviceUnreachableForExtendedPeriod) + )] [SeamUnionVariant( "unknown_issue_with_access_code", typeof(AccessCodeWarningsUnknownIssueWithAccessCode) @@ -1062,6 +1066,19 @@ public sealed record AccessCodeWarningsBeingDeleted : AccessCodeWarnings public override string WarningCode { get; } = "being_deleted"; } + public sealed record AccessCodeWarningsDeviceUnreachableForExtendedPeriod + : AccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_unreachable_for_extended_period"; + + /// + /// Date and time since which Seam has been unable to reach the device. + /// + [JsonPropertyName("device_unreachable_since")] + public string DeviceUnreachableSince { get; init; } = default!; + } + public sealed record AccessCodeWarningsUnknownIssueWithAccessCode : AccessCodeWarnings { [JsonPropertyName("warning_code")] diff --git a/src/Seam/Models/AccessGrant.cs b/src/Seam/Models/AccessGrant.cs index 478caf0..99253b8 100644 --- a/src/Seam/Models/AccessGrant.cs +++ b/src/Seam/Models/AccessGrant.cs @@ -20,6 +20,7 @@ public sealed record AccessGrant "cannot_create_requested_access_methods", typeof(AccessGrantErrorsCannotCreateRequestedAccessMethods) )] + [SeamUnionVariant("access_not_provisioned", typeof(AccessGrantErrorsAccessNotProvisioned))] [SeamUnionFallback(typeof(AccessGrantErrorsUnrecognized))] public abstract record AccessGrantErrors { @@ -51,6 +52,12 @@ public sealed record AccessGrantErrorsCannotCreateRequestedAccessMethods : Acces public List? MissingDeviceIds { get; init; } } + public sealed record AccessGrantErrorsAccessNotProvisioned : AccessGrantErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "access_not_provisioned"; + } + public sealed record AccessGrantErrorsUnrecognized : AccessGrantErrors, ISeamUnrecognizedVariant @@ -223,6 +230,7 @@ public sealed record AccessGrantPendingMutationsUnrecognized "device_time_constraints_violated", typeof(AccessGrantWarningsDeviceTimeConstraintsViolated) )] + [SeamUnionVariant("access_revoked", typeof(AccessGrantWarningsAccessRevoked))] [SeamUnionFallback(typeof(AccessGrantWarningsUnrecognized))] public abstract record AccessGrantWarnings { @@ -268,6 +276,19 @@ public sealed record AccessGrantWarningsOverprovisionedAccess : AccessGrantWarni public sealed record AccessGrantWarningsOverprovisionedAccessFailedDevices { + /// + /// Reason the access code could not be revoked. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ErrorCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "offline_access_code_not_revocable")] + OfflineAccessCodeNotRevocable = 1, + } + /// /// Device whose access code could not be revoked. /// @@ -275,10 +296,11 @@ public sealed record AccessGrantWarningsOverprovisionedAccessFailedDevices public string DeviceId { get; init; } = default!; /// - /// Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`). + /// Reason the access code could not be revoked. /// [JsonPropertyName("error_code")] - public string ErrorCode { get; init; } = default!; + public AccessGrantWarningsOverprovisionedAccessFailedDevices.ErrorCodeEnum ErrorCode { get; init; } = + default!; /// /// Human-readable description of why revocation failed. @@ -305,10 +327,16 @@ public sealed record AccessGrantWarningsRequestedCodeUnavailable : AccessGrantWa public override string WarningCode { get; } = "requested_code_unavailable"; /// - /// ID of the device where the requested code was unavailable. + /// ID of the access method whose requested code was unavailable. Present when an access system, such as Salto KS, assigned a different code. + /// + [JsonPropertyName("access_method_id")] + public string? AccessMethodId { get; init; } + + /// + /// ID of the device where the requested code was unavailable. Present when the code was set directly on a device. /// [JsonPropertyName("device_id")] - public string DeviceId { get; init; } = default!; + public string? DeviceId { get; init; } /// /// The new PIN code that was assigned instead. @@ -374,6 +402,18 @@ public enum ReasonEnum default!; } + public sealed record AccessGrantWarningsAccessRevoked : AccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "access_revoked"; + + /// + /// ID of the access method whose access was revoked. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + } + public sealed record AccessGrantWarningsUnrecognized : AccessGrantWarnings, ISeamUnrecognizedVariant diff --git a/src/Seam/Models/AccessMethod.cs b/src/Seam/Models/AccessMethod.cs index 998065c..de8a3a9 100644 --- a/src/Seam/Models/AccessMethod.cs +++ b/src/Seam/Models/AccessMethod.cs @@ -17,6 +17,7 @@ public sealed record AccessMethod [JsonConverter(typeof(SeamUnionConverter))] [SeamUnion("error_code")] [SeamUnionVariant("failed_to_issue", typeof(AccessMethodErrorsFailedToIssue))] + [SeamUnionVariant("access_not_provisioned", typeof(AccessMethodErrorsAccessNotProvisioned))] [SeamUnionFallback(typeof(AccessMethodErrorsUnrecognized))] public abstract record AccessMethodErrors { @@ -42,6 +43,12 @@ public sealed record AccessMethodErrorsFailedToIssue : AccessMethodErrors public override string ErrorCode { get; } = "failed_to_issue"; } + public sealed record AccessMethodErrorsAccessNotProvisioned : AccessMethodErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "access_not_provisioned"; + } + public sealed record AccessMethodErrorsUnrecognized : AccessMethodErrors, ISeamUnrecognizedVariant @@ -87,6 +94,10 @@ public enum ModeEnum "updating_access_times", typeof(AccessMethodPendingMutationsUpdatingAccessTimes) )] + [SeamUnionVariant( + "waiting_for_access_on_acs_system", + typeof(AccessMethodPendingMutationsWaitingForAccessOnAcsSystem) + )] [SeamUnionFallback(typeof(AccessMethodPendingMutationsUnrecognized))] public abstract record AccessMethodPendingMutations { @@ -231,6 +242,13 @@ public sealed record AccessMethodPendingMutationsUpdatingAccessTimesTo public string? StartsAt { get; init; } } + public sealed record AccessMethodPendingMutationsWaitingForAccessOnAcsSystem + : AccessMethodPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "waiting_for_access_on_acs_system"; + } + public sealed record AccessMethodPendingMutationsUnrecognized : AccessMethodPendingMutations, ISeamUnrecognizedVariant @@ -260,6 +278,11 @@ public sealed record AccessMethodPendingMutationsUnrecognized "user_identity_missing_phone_number", typeof(AccessMethodWarningsUserIdentityMissingPhoneNumber) )] + [SeamUnionVariant( + "requested_code_unavailable", + typeof(AccessMethodWarningsRequestedCodeUnavailable) + )] + [SeamUnionVariant("schedule_rounded_up", typeof(AccessMethodWarningsScheduleRoundedUp))] [SeamUnionFallback(typeof(AccessMethodWarningsUnrecognized))] public abstract record AccessMethodWarnings { @@ -323,6 +346,30 @@ public sealed record AccessMethodWarningsUserIdentityMissingPhoneNumber public override string WarningCode { get; } = "user_identity_missing_phone_number"; } + public sealed record AccessMethodWarningsRequestedCodeUnavailable : AccessMethodWarnings + { + [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 AccessMethodWarningsScheduleRoundedUp : AccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "schedule_rounded_up"; + } + public sealed record AccessMethodWarningsUnrecognized : AccessMethodWarnings, ISeamUnrecognizedVariant @@ -414,7 +461,7 @@ public sealed record AccessMethodWarningsUnrecognized 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. + /// Indicates whether the access method is ready to be encoded. This is true when the card has not yet been issued and the access system has received all the access the card needs. While it is false, `pending_mutations` contains `waiting_for_access_on_acs_system`. /// [JsonPropertyName("is_ready_for_encoding")] public bool? IsReadyForEncoding { get; init; } diff --git a/src/Seam/Models/AcsCredential.cs b/src/Seam/Models/AcsCredential.cs index 30a3d00..bfdef47 100644 --- a/src/Seam/Models/AcsCredential.cs +++ b/src/Seam/Models/AcsCredential.cs @@ -112,6 +112,7 @@ public enum ExternalTypeEnum "requested_code_unavailable", typeof(AcsCredentialWarningsRequestedCodeUnavailable) )] + [SeamUnionVariant("schedule_rounded_up", typeof(AcsCredentialWarningsScheduleRoundedUp))] [SeamUnionFallback(typeof(AcsCredentialWarningsUnrecognized))] public abstract record AcsCredentialWarnings { @@ -186,6 +187,12 @@ public sealed record AcsCredentialWarningsRequestedCodeUnavailable : AcsCredenti public string OriginalCode { get; init; } = default!; } + public sealed record AcsCredentialWarningsScheduleRoundedUp : AcsCredentialWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "schedule_rounded_up"; + } + public sealed record AcsCredentialWarningsUnrecognized : AcsCredentialWarnings, ISeamUnrecognizedVariant diff --git a/src/Seam/Models/AcsEntrance.cs b/src/Seam/Models/AcsEntrance.cs index f3159c4..fc7ff13 100644 --- a/src/Seam/Models/AcsEntrance.cs +++ b/src/Seam/Models/AcsEntrance.cs @@ -16,6 +16,46 @@ namespace Seam.Models /// public sealed record AcsEntrance { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("entrance_removed", typeof(AcsEntranceErrorsEntranceRemoved))] + [SeamUnionFallback(typeof(AcsEntranceErrorsUnrecognized))] + public abstract record AcsEntranceErrors + { + /// 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 AcsEntranceErrorsEntranceRemoved : AcsEntranceErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "entrance_removed"; + } + + public sealed record AcsEntranceErrorsUnrecognized + : AcsEntranceErrors, + 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( @@ -424,27 +464,6 @@ public sealed record AcsEntranceDormakabaCommunityMetadata 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 { /// diff --git a/src/Seam/Models/AcsSystem.cs b/src/Seam/Models/AcsSystem.cs index 341a92b..34ad874 100644 --- a/src/Seam/Models/AcsSystem.cs +++ b/src/Seam/Models/AcsSystem.cs @@ -33,6 +33,10 @@ public sealed record AcsSystem "salto_ks_subscription_limit_exceeded", typeof(AcsSystemErrorsSaltoKsSubscriptionLimitExceeded) )] + [SeamUnionVariant( + "user_license_limit_reached", + typeof(AcsSystemErrorsUserLicenseLimitReached) + )] [SeamUnionVariant( "insufficient_permissions", typeof(AcsSystemErrorsInsufficientPermissions) @@ -96,6 +100,12 @@ public sealed record AcsSystemErrorsSaltoKsSubscriptionLimitExceeded : AcsSystem public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; } + public sealed record AcsSystemErrorsUserLicenseLimitReached : AcsSystemErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "user_license_limit_reached"; + } + public sealed record AcsSystemErrorsInsufficientPermissions : AcsSystemErrors { [JsonPropertyName("error_code")] diff --git a/src/Seam/Models/ActionAttempt.cs b/src/Seam/Models/ActionAttempt.cs index a05f6c6..436818e 100644 --- a/src/Seam/Models/ActionAttempt.cs +++ b/src/Seam/Models/ActionAttempt.cs @@ -29,6 +29,10 @@ namespace Seam.Models )] [SeamUnionVariant("PUSH_THERMOSTAT_PROGRAMS", typeof(ActionAttemptPushThermostatPrograms))] [SeamUnionVariant("CONFIGURE_AUTO_LOCK", typeof(ActionAttemptConfigureAutoLock))] + [SeamUnionVariant( + "CONVERT_ACCESS_CODE_TO_MANAGED", + typeof(ActionAttemptConvertAccessCodeToManaged) + )] [SeamUnionVariant("SYNC_ACCESS_CODES", typeof(ActionAttemptSyncAccessCodes))] [SeamUnionVariant("CREATE_ACCESS_CODE", typeof(ActionAttemptCreateAccessCode))] [SeamUnionVariant("DELETE_ACCESS_CODE", typeof(ActionAttemptDeleteAccessCode))] @@ -749,6 +753,9 @@ public enum WarningCodeEnum [EnumMember(Value = "requested_code_unavailable")] RequestedCodeUnavailable = 7, + + [EnumMember(Value = "schedule_rounded_up")] + ScheduleRoundedUp = 8, } /// @@ -1268,6 +1275,9 @@ public enum WarningCodeEnum [EnumMember(Value = "requested_code_unavailable")] RequestedCodeUnavailable = 7, + + [EnumMember(Value = "schedule_rounded_up")] + ScheduleRoundedUp = 8, } /// @@ -1759,6 +1769,9 @@ public enum WarningCodeEnum [EnumMember(Value = "requested_code_unavailable")] RequestedCodeUnavailable = 7, + + [EnumMember(Value = "schedule_rounded_up")] + ScheduleRoundedUp = 8, } /// @@ -1940,7 +1953,7 @@ public enum ModeEnum 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. + /// Indicates whether the access method is ready to be encoded. This is true when the card has not yet been issued and the access system has received all the access the card needs. While it is false, `pending_mutations` contains `waiting_for_access_on_acs_system`. /// [JsonPropertyName("is_ready_for_encoding")] public bool? IsReadyForEncoding { get; init; } @@ -1991,6 +2004,9 @@ public enum ErrorCodeEnum [EnumMember(Value = "failed_to_issue")] FailedToIssue = 1, + + [EnumMember(Value = "access_not_provisioned")] + AccessNotProvisioned = 2, } /// @@ -2016,7 +2032,7 @@ public enum ErrorCodeEnum public sealed record ActionAttemptAssignCredentialSuccessResultPendingMutations { /// - /// Mutation code to indicate that Seam is in the process of updating the access times for this access method. + /// Mutation code to indicate that the access system has not yet received all the access this card needs, so the card is not ready to be encoded. /// [JsonConverter(typeof(SeamStringEnumConverter))] public enum MutationCodeEnum @@ -2032,6 +2048,9 @@ public enum MutationCodeEnum [EnumMember(Value = "updating_access_times")] UpdatingAccessTimes = 3, + + [EnumMember(Value = "waiting_for_access_on_acs_system")] + WaitingForAccessOnAcsSystem = 4, } /// @@ -2044,8 +2063,7 @@ public enum MutationCodeEnum /// Previous access time configuration. /// [JsonPropertyName("from")] - public ActionAttemptAssignCredentialSuccessResultPendingMutationsFrom From { get; init; } = - default!; + public ActionAttemptAssignCredentialSuccessResultPendingMutationsFrom? From { get; init; } /// /// Detailed description of the mutation. @@ -2054,7 +2072,7 @@ public enum MutationCodeEnum 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. + /// Mutation code to indicate that the access system has not yet received all the access this card needs, so the card is not ready to be encoded. /// [JsonPropertyName("mutation_code")] public ActionAttemptAssignCredentialSuccessResultPendingMutations.MutationCodeEnum MutationCode { get; init; } = @@ -2064,8 +2082,7 @@ public enum MutationCodeEnum /// New access time configuration. /// [JsonPropertyName("to")] - public ActionAttemptAssignCredentialSuccessResultPendingMutationsTo To { get; init; } = - default!; + public ActionAttemptAssignCredentialSuccessResultPendingMutationsTo? To { get; init; } } public sealed record ActionAttemptAssignCredentialSuccessResultPendingMutationsFrom @@ -2126,6 +2143,12 @@ public enum WarningCodeEnum [EnumMember(Value = "user_identity_missing_phone_number")] UserIdentityMissingPhoneNumber = 6, + + [EnumMember(Value = "requested_code_unavailable")] + RequestedCodeUnavailable = 7, + + [EnumMember(Value = "schedule_rounded_up")] + ScheduleRoundedUp = 8, } /// @@ -2152,6 +2175,18 @@ public enum WarningCodeEnum /// [JsonPropertyName("original_access_method_id")] public string? OriginalAccessMethodId { get; init; } + + /// + /// 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 ActionAttemptAssignCredentialPending : ActionAttemptAssignCredential { } @@ -2604,6 +2639,56 @@ public sealed record ActionAttemptConfigureAutoLockUnrecognized public JsonElement RawJson { get; set; } } + /// + /// Converting an unmanaged access code to managed is pending. + /// + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("status")] + [SeamUnionVariant("success", typeof(ActionAttemptConvertAccessCodeToManagedSuccess))] + [SeamUnionVariant("pending", typeof(ActionAttemptConvertAccessCodeToManagedPending))] + [SeamUnionVariant("error", typeof(ActionAttemptConvertAccessCodeToManagedError))] + [SeamUnionFallback(typeof(ActionAttemptConvertAccessCodeToManagedUnrecognized))] + public abstract record ActionAttemptConvertAccessCodeToManaged : ActionAttempt + { + [JsonPropertyName("action_type")] + public override string ActionType { get; } = "CONVERT_ACCESS_CODE_TO_MANAGED"; + } + + public sealed record ActionAttemptConvertAccessCodeToManagedSuccess + : ActionAttemptConvertAccessCodeToManaged + { + /// + /// Result of the action. + /// + [JsonPropertyName("result")] + public ActionAttemptConvertAccessCodeToManagedSuccessResult Result { get; init; } = + default!; + } + + public sealed record ActionAttemptConvertAccessCodeToManagedSuccessResult { } + + public sealed record ActionAttemptConvertAccessCodeToManagedPending + : ActionAttemptConvertAccessCodeToManaged { } + + public sealed record ActionAttemptConvertAccessCodeToManagedError + : ActionAttemptConvertAccessCodeToManaged + { + /// + /// Error associated with the action. + /// + [JsonPropertyName("error")] + public ActionAttemptError Error { get; init; } = default!; + } + + public sealed record ActionAttemptConvertAccessCodeToManagedUnrecognized + : ActionAttemptConvertAccessCodeToManaged, + ISeamUnrecognizedVariant + { + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + [JsonConverter(typeof(SeamUnionConverter))] [SeamUnion("status")] [SeamUnionVariant("success", typeof(ActionAttemptSyncAccessCodesSuccess))] diff --git a/src/Seam/Models/ConnectWebview.cs b/src/Seam/Models/ConnectWebview.cs index 7f6c3a3..ffc4353 100644 --- a/src/Seam/Models/ConnectWebview.cs +++ b/src/Seam/Models/ConnectWebview.cs @@ -47,6 +47,9 @@ public enum AcceptedCapabilitiesEnum [EnumMember(Value = "camera")] Camera = 5, + + [EnumMember(Value = "speaker")] + Speaker = 6, } /// diff --git a/src/Seam/Models/ConnectedAccount.cs b/src/Seam/Models/ConnectedAccount.cs index ca0002e..232da42 100644 --- a/src/Seam/Models/ConnectedAccount.cs +++ b/src/Seam/Models/ConnectedAccount.cs @@ -37,6 +37,9 @@ public enum AcceptedCapabilitiesEnum [EnumMember(Value = "camera")] Camera = 5, + + [EnumMember(Value = "speaker")] + Speaker = 6, } [JsonConverter(typeof(SeamUnionConverter))] diff --git a/src/Seam/Models/Device.cs b/src/Seam/Models/Device.cs index dff65b9..b538286 100644 --- a/src/Seam/Models/Device.cs +++ b/src/Seam/Models/Device.cs @@ -144,50 +144,59 @@ public enum DeviceTypeEnum [EnumMember(Value = "aqara_lock")] AqaraLock = 31, + [EnumMember(Value = "eufy_lock")] + EufyLock = 32, + [EnumMember(Value = "keynest_key")] - KeynestKey = 32, + KeynestKey = 33, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, + NoiseawareActivityZone = 34, [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, + MinutSensor = 35, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, + EcobeeThermostat = 36, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, + NestThermostat = 37, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, + HoneywellResideoThermostat = 38, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, + TadoThermostat = 39, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, + SensiThermostat = 40, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, + SmartthingsThermostat = 41, [EnumMember(Value = "ios_phone")] - IosPhone = 41, + IosPhone = 42, [EnumMember(Value = "android_phone")] - AndroidPhone = 42, + AndroidPhone = 43, [EnumMember(Value = "ring_camera")] - RingCamera = 43, + RingCamera = 44, [EnumMember(Value = "tapo_camera")] - TapoCamera = 44, + TapoCamera = 45, [EnumMember(Value = "arlo_camera")] - ArloCamera = 45, + ArloCamera = 46, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 46, + ReolinkCamera = 47, + + [EnumMember(Value = "unifi_protect_camera")] + UnifiProtectCamera = 48, + + [EnumMember(Value = "sonos_speaker")] + SonosSpeaker = 49, } [JsonConverter(typeof(SeamUnionConverter))] @@ -529,6 +538,10 @@ public sealed record DeviceErrorsUnrecognized : DeviceErrors, ISeamUnrecognizedV )] [SeamUnionVariant("unreliable_online_status", typeof(DeviceWarningsUnreliableOnlineStatus))] [SeamUnionVariant("max_access_codes_reached", typeof(DeviceWarningsMaxAccessCodesReached))] + [SeamUnionVariant( + "cloud_recording_not_enabled", + typeof(DeviceWarningsCloudRecordingNotEnabled) + )] [SeamUnionFallback(typeof(DeviceWarningsUnrecognized))] public abstract record DeviceWarnings { @@ -732,6 +745,12 @@ public sealed record DeviceWarningsMaxAccessCodesReached : DeviceWarnings public int MaxActiveAccessCodeCount { get; init; } = default!; } + public sealed record DeviceWarningsCloudRecordingNotEnabled : DeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "cloud_recording_not_enabled"; + } + public sealed record DeviceWarningsUnrecognized : DeviceWarnings, ISeamUnrecognizedVariant { [JsonPropertyName("warning_code")] @@ -1329,6 +1348,12 @@ public enum FanModeSettingEnum [JsonPropertyName("ecobee_metadata")] public DevicePropertiesEcobeeMetadata? EcobeeMetadata { get; init; } + /// + /// Metadata for a Eufy device. + /// + [JsonPropertyName("eufy_metadata")] + public DevicePropertiesEufyMetadata? EufyMetadata { get; init; } + /// /// Metadata for a 4SUITES device. /// @@ -1504,6 +1529,12 @@ public enum FanModeSettingEnum [JsonPropertyName("ultraloq_metadata")] public DevicePropertiesUltraloqMetadata? UltraloqMetadata { get; init; } + /// + /// Metadata for a UniFi Protect camera. + /// + [JsonPropertyName("unifi_protect_metadata")] + public DevicePropertiesUnifiProtectMetadata? UnifiProtectMetadata { get; init; } + /// /// Metadata for an ASSA ABLOY Visionline system. /// @@ -2356,6 +2387,18 @@ public sealed record DevicePropertiesEcobeeMetadata public string? EcobeeDeviceId { get; init; } } + public sealed record DevicePropertiesEufyMetadata + { + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + [JsonPropertyName("model")] + public string? Model { get; init; } + } + public sealed record DevicePropertiesFourSuitesMetadata { /// @@ -3222,7 +3265,7 @@ public sealed record DevicePropertiesSensiMetadata public string? DeviceName { get; init; } /// - /// Set to true when the device does not support the /dual-setpoints API endpoint. + /// Deprecated. Seam no longer sets this field. /// [JsonPropertyName("dual_setpoints_not_supported")] public bool? DualSetpointsNotSupported { get; init; } @@ -3264,16 +3307,58 @@ public sealed record DevicePropertiesSmartthingsMetadata public sealed record DevicePropertiesTadoMetadata { /// - /// Device type for a tado° device. + /// Serial numbers of all tado° devices in the zone. + /// + [JsonPropertyName("device_serial_numbers")] + public List? DeviceSerialNumbers { get; init; } + + /// + /// Device type of the main tado° device in the zone, such as `RU02`, `VA02` or `WR02`. /// [JsonPropertyName("device_type")] public string? DeviceType { get; init; } /// - /// Serial number for a tado° device. + /// Generation of the tado° home, such as `PRE_LINE_X`. + /// + [JsonPropertyName("home_generation")] + public string? HomeGeneration { get; init; } + + /// + /// ID of the tado° home. + /// + [JsonPropertyName("home_id")] + public string? HomeId { get; init; } + + /// + /// Name of the tado° home. + /// + [JsonPropertyName("home_name")] + public string? HomeName { get; init; } + + /// + /// Serial number of the main tado° device in the zone, such as its wall thermostat or Smart AC Control. /// [JsonPropertyName("serial_no")] public string? SerialNo { get; init; } + + /// + /// ID of the tado° zone within its home. + /// + [JsonPropertyName("zone_id")] + public string? ZoneId { get; init; } + + /// + /// Name of the tado° zone. + /// + [JsonPropertyName("zone_name")] + public string? ZoneName { get; init; } + + /// + /// Type of the tado° zone: `HEATING` or `AIR_CONDITIONING`. + /// + [JsonPropertyName("zone_type")] + public string? ZoneType { get; init; } } public sealed record DevicePropertiesTapoMetadata @@ -3489,6 +3574,45 @@ public sealed record DevicePropertiesUltraloqMetadata public string? TimeZone { get; init; } } + public sealed record DevicePropertiesUnifiProtectMetadata + { + /// + /// Camera ID reported by UniFi Protect. + /// + [JsonPropertyName("camera_id")] + public string? CameraId { get; init; } + + /// + /// Camera name reported by UniFi Protect. + /// + [JsonPropertyName("camera_name")] + public string? CameraName { get; init; } + + /// + /// Whether the camera has a microphone. + /// + [JsonPropertyName("has_mic")] + public bool? HasMic { get; init; } + + /// + /// MAC address reported by the UniFi Protect camera. + /// + [JsonPropertyName("mac")] + public string? Mac { get; init; } + + /// + /// Model reported by the UniFi Protect camera. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + + /// + /// Name of the UniFi Protect console that manages the camera. + /// + [JsonPropertyName("nvr_name")] + public string? NvrName { get; init; } + } + public sealed record DevicePropertiesVisionlineMetadata { /// diff --git a/src/Seam/Models/DeviceProvider.cs b/src/Seam/Models/DeviceProvider.cs index a3eed2b..1da305d 100644 --- a/src/Seam/Models/DeviceProvider.cs +++ b/src/Seam/Models/DeviceProvider.cs @@ -200,29 +200,38 @@ public enum DeviceProviderNameEnum [EnumMember(Value = "reolink")] Reolink = 60, + [EnumMember(Value = "unifi_protect")] + UnifiProtect = 61, + [EnumMember(Value = "ical")] - Ical = 61, + Ical = 62, [EnumMember(Value = "lodgify")] - Lodgify = 62, + Lodgify = 63, [EnumMember(Value = "hostaway")] - Hostaway = 63, + Hostaway = 64, [EnumMember(Value = "guesty")] - Guesty = 64, + Guesty = 65, [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 65, + AcuityScheduling = 66, [EnumMember(Value = "omnitec")] - Omnitec = 66, + Omnitec = 67, [EnumMember(Value = "kisi")] - Kisi = 67, + Kisi = 68, [EnumMember(Value = "aqara")] - Aqara = 68, + Aqara = 69, + + [EnumMember(Value = "eufy")] + Eufy = 70, + + [EnumMember(Value = "sonos")] + Sonos = 71, } /// diff --git a/src/Seam/Models/Event.cs b/src/Seam/Models/Event.cs index 22f8f7e..65e851c 100644 --- a/src/Seam/Models/Event.cs +++ b/src/Seam/Models/Event.cs @@ -5628,6 +5628,9 @@ public enum ReasonCodeEnum [EnumMember(Value = "credential_error")] CredentialError = 6, + + [EnumMember(Value = "connection_error")] + ConnectionError = 7, } /// @@ -6152,7 +6155,7 @@ public sealed record EventDeviceNameChanged : Event } /// - /// A camera was activated, for example, by motion detection. + /// A camera was activated, for example, by motion detection. For Ring cameras, this event is available only in the Seam Console, not through the API or webhooks. /// public sealed record EventCameraActivated : Event { @@ -6256,7 +6259,7 @@ public enum MotionSubTypeEnum } /// - /// A doorbell button was pressed on a device. + /// A doorbell button was pressed on a device. For Ring cameras, this event is available only in the Seam Console, not through the API or webhooks. /// public sealed record EventDeviceDoorbellRang : Event { diff --git a/src/Seam/Models/Phone.cs b/src/Seam/Models/Phone.cs index f71400b..6e4973a 100644 --- a/src/Seam/Models/Phone.cs +++ b/src/Seam/Models/Phone.cs @@ -30,6 +30,565 @@ public enum DeviceTypeEnum AndroidPhone = 2, } + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("error_code")] + [SeamUnionVariant("account_disconnected", typeof(PhoneErrorsAccountDisconnected))] + [SeamUnionVariant( + "salto_ks_subscription_limit_exceeded", + typeof(PhoneErrorsSaltoKsSubscriptionLimitExceeded) + )] + [SeamUnionVariant("insufficient_permissions", typeof(PhoneErrorsInsufficientPermissions))] + [SeamUnionVariant( + "dormakaba_sites_disconnected", + typeof(PhoneErrorsDormakabaSitesDisconnected) + )] + [SeamUnionVariant("device_offline", typeof(PhoneErrorsDeviceOffline))] + [SeamUnionVariant("device_removed", typeof(PhoneErrorsDeviceRemoved))] + [SeamUnionVariant("hub_disconnected", typeof(PhoneErrorsHubDisconnected))] + [SeamUnionVariant("device_disconnected", typeof(PhoneErrorsDeviceDisconnected))] + [SeamUnionVariant( + "empty_backup_access_code_pool", + typeof(PhoneErrorsEmptyBackupAccessCodePool) + )] + [SeamUnionVariant("august_lock_not_authorized", typeof(PhoneErrorsAugustLockNotAuthorized))] + [SeamUnionVariant( + "missing_device_credentials", + typeof(PhoneErrorsMissingDeviceCredentials) + )] + [SeamUnionVariant("auxiliary_heat_running", typeof(PhoneErrorsAuxiliaryHeatRunning))] + [SeamUnionVariant("subscription_required", typeof(PhoneErrorsSubscriptionRequired))] + [SeamUnionVariant("bridge_disconnected", typeof(PhoneErrorsBridgeDisconnected))] + [SeamUnionFallback(typeof(PhoneErrorsUnrecognized))] + public abstract record PhoneErrors + { + /// 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 PhoneErrorsAccountDisconnected : PhoneErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "account_disconnected"; + + /// + /// Indicates that the error is a [connected account](https://www.seam.co/docs/api/connected_accounts/object) 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 PhoneErrorsSaltoKsSubscriptionLimitExceeded : PhoneErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "salto_ks_subscription_limit_exceeded"; + + /// + /// Indicates that the error is a [connected account](https://www.seam.co/docs/api/connected_accounts/object) 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 PhoneErrorsInsufficientPermissions : PhoneErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "insufficient_permissions"; + + /// + /// Indicates that the error is a [connected account](https://www.seam.co/docs/api/connected_accounts/object) 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 PhoneErrorsDormakabaSitesDisconnected : PhoneErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "dormakaba_sites_disconnected"; + + /// + /// Indicates that the error is a [connected account](https://www.seam.co/docs/api/connected_accounts/object) 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 PhoneErrorsDeviceOffline : PhoneErrors + { + [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 PhoneErrorsDeviceRemoved : PhoneErrors + { + [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 PhoneErrorsHubDisconnected : PhoneErrors + { + [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 PhoneErrorsDeviceDisconnected : PhoneErrors + { + [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 PhoneErrorsEmptyBackupAccessCodePool : PhoneErrors + { + [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 PhoneErrorsAugustLockNotAuthorized : PhoneErrors + { + [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 PhoneErrorsMissingDeviceCredentials : PhoneErrors + { + [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 PhoneErrorsAuxiliaryHeatRunning : PhoneErrors + { + [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 PhoneErrorsSubscriptionRequired : PhoneErrors + { + [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 PhoneErrorsBridgeDisconnected : PhoneErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "bridge_disconnected"; + + /// + /// Indicates whether the error is related to [Seam Bridge](https://www.seam.co/docs/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 PhoneErrorsUnrecognized : PhoneErrors, 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(PhoneWarningsPartialBackupAccessCodePool) + )] + [SeamUnionVariant("many_active_backup_codes", typeof(PhoneWarningsManyActiveBackupCodes))] + [SeamUnionVariant( + "third_party_integration_detected", + typeof(PhoneWarningsThirdPartyIntegrationDetected) + )] + [SeamUnionVariant( + "ttlock_lock_gateway_unlocking_not_enabled", + typeof(PhoneWarningsTtlockLockGatewayUnlockingNotEnabled) + )] + [SeamUnionVariant( + "ttlock_weak_gateway_signal", + typeof(PhoneWarningsTtlockWeakGatewaySignal) + )] + [SeamUnionVariant("power_saving_mode", typeof(PhoneWarningsPowerSavingMode))] + [SeamUnionVariant( + "temperature_threshold_exceeded", + typeof(PhoneWarningsTemperatureThresholdExceeded) + )] + [SeamUnionVariant( + "device_communication_degraded", + typeof(PhoneWarningsDeviceCommunicationDegraded) + )] + [SeamUnionVariant( + "scheduled_maintenance_window", + typeof(PhoneWarningsScheduledMaintenanceWindow) + )] + [SeamUnionVariant( + "device_has_flaky_connection", + typeof(PhoneWarningsDeviceHasFlakyConnection) + )] + [SeamUnionVariant("salto_ks_office_mode", typeof(PhoneWarningsSaltoKsOfficeMode))] + [SeamUnionVariant("salto_ks_privacy_mode", typeof(PhoneWarningsSaltoKsPrivacyMode))] + [SeamUnionVariant("privacy_mode", typeof(PhoneWarningsPrivacyMode))] + [SeamUnionVariant( + "salto_ks_subscription_limit_almost_reached", + typeof(PhoneWarningsSaltoKsSubscriptionLimitAlmostReached) + )] + [SeamUnionVariant( + "salto_ks_lock_access_code_support_removed", + typeof(PhoneWarningsSaltoKsLockAccessCodeSupportRemoved) + )] + [SeamUnionVariant("unknown_issue_with_phone", typeof(PhoneWarningsUnknownIssueWithPhone))] + [SeamUnionVariant( + "lockly_time_zone_not_configured", + typeof(PhoneWarningsLocklyTimeZoneNotConfigured) + )] + [SeamUnionVariant( + "ultraloq_time_zone_unknown", + typeof(PhoneWarningsUltraloqTimeZoneUnknown) + )] + [SeamUnionVariant("time_zone_unknown", typeof(PhoneWarningsTimeZoneUnknown))] + [SeamUnionVariant("time_zone_mismatch", typeof(PhoneWarningsTimeZoneMismatch))] + [SeamUnionVariant( + "two_n_device_missing_timezone", + typeof(PhoneWarningsTwoNDeviceMissingTimezone) + )] + [SeamUnionVariant( + "hub_required_for_additional_capabilities", + typeof(PhoneWarningsHubRequiredForAdditionalCapabilities) + )] + [SeamUnionVariant("provider_issue", typeof(PhoneWarningsProviderIssue))] + [SeamUnionVariant( + "keynest_unsupported_locker", + typeof(PhoneWarningsKeynestUnsupportedLocker) + )] + [SeamUnionVariant( + "accessory_keypad_setup_required", + typeof(PhoneWarningsAccessoryKeypadSetupRequired) + )] + [SeamUnionVariant( + "accessory_keypad_low_battery", + typeof(PhoneWarningsAccessoryKeypadLowBattery) + )] + [SeamUnionVariant("unreliable_online_status", typeof(PhoneWarningsUnreliableOnlineStatus))] + [SeamUnionVariant("max_access_codes_reached", typeof(PhoneWarningsMaxAccessCodesReached))] + [SeamUnionVariant( + "cloud_recording_not_enabled", + typeof(PhoneWarningsCloudRecordingNotEnabled) + )] + [SeamUnionFallback(typeof(PhoneWarningsUnrecognized))] + public abstract record PhoneWarnings + { + /// 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 PhoneWarningsPartialBackupAccessCodePool : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "partial_backup_access_code_pool"; + } + + public sealed record PhoneWarningsManyActiveBackupCodes : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "many_active_backup_codes"; + } + + public sealed record PhoneWarningsThirdPartyIntegrationDetected : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "third_party_integration_detected"; + } + + public sealed record PhoneWarningsTtlockLockGatewayUnlockingNotEnabled : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "ttlock_lock_gateway_unlocking_not_enabled"; + } + + public sealed record PhoneWarningsTtlockWeakGatewaySignal : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "ttlock_weak_gateway_signal"; + } + + public sealed record PhoneWarningsPowerSavingMode : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "power_saving_mode"; + } + + public sealed record PhoneWarningsTemperatureThresholdExceeded : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "temperature_threshold_exceeded"; + } + + public sealed record PhoneWarningsDeviceCommunicationDegraded : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_communication_degraded"; + } + + public sealed record PhoneWarningsScheduledMaintenanceWindow : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "scheduled_maintenance_window"; + } + + public sealed record PhoneWarningsDeviceHasFlakyConnection : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_has_flaky_connection"; + } + + public sealed record PhoneWarningsSaltoKsOfficeMode : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "salto_ks_office_mode"; + } + + public sealed record PhoneWarningsSaltoKsPrivacyMode : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "salto_ks_privacy_mode"; + } + + public sealed record PhoneWarningsPrivacyMode : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "privacy_mode"; + } + + public sealed record PhoneWarningsSaltoKsSubscriptionLimitAlmostReached : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "salto_ks_subscription_limit_almost_reached"; + } + + public sealed record PhoneWarningsSaltoKsLockAccessCodeSupportRemoved : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "salto_ks_lock_access_code_support_removed"; + } + + public sealed record PhoneWarningsUnknownIssueWithPhone : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unknown_issue_with_phone"; + } + + public sealed record PhoneWarningsLocklyTimeZoneNotConfigured : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "lockly_time_zone_not_configured"; + } + + public sealed record PhoneWarningsUltraloqTimeZoneUnknown : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "ultraloq_time_zone_unknown"; + } + + public sealed record PhoneWarningsTimeZoneUnknown : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "time_zone_unknown"; + } + + public sealed record PhoneWarningsTimeZoneMismatch : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "time_zone_mismatch"; + } + + public sealed record PhoneWarningsTwoNDeviceMissingTimezone : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "two_n_device_missing_timezone"; + } + + public sealed record PhoneWarningsHubRequiredForAdditionalCapabilities : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = + "hub_required_for_additional_capabilities"; + } + + public sealed record PhoneWarningsProviderIssue : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "provider_issue"; + } + + public sealed record PhoneWarningsKeynestUnsupportedLocker : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "keynest_unsupported_locker"; + } + + public sealed record PhoneWarningsAccessoryKeypadSetupRequired : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "accessory_keypad_setup_required"; + } + + public sealed record PhoneWarningsAccessoryKeypadLowBattery : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "accessory_keypad_low_battery"; + } + + public sealed record PhoneWarningsUnreliableOnlineStatus : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unreliable_online_status"; + } + + public sealed record PhoneWarningsMaxAccessCodesReached : PhoneWarnings + { + [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 PhoneWarningsCloudRecordingNotEnabled : PhoneWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "cloud_recording_not_enabled"; + } + + public sealed record PhoneWarningsUnrecognized : PhoneWarnings, ISeamUnrecognizedVariant + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "unrecognized"; + + /// The complete raw JSON of the unrecognized payload. + [JsonIgnore] + public JsonElement RawJson { get; set; } + } + /// /// Date and time at which the phone was created. /// @@ -61,7 +620,7 @@ public enum DeviceTypeEnum public string DisplayName { get; init; } = default!; /// - /// Errors associated with the phone. + /// 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!; @@ -79,7 +638,7 @@ public enum DeviceTypeEnum public PhoneProperties Properties { get; init; } = default!; /// - /// Warnings associated with the phone. + /// 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!; @@ -91,27 +650,6 @@ public enum DeviceTypeEnum 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 { /// @@ -165,25 +703,4 @@ public sealed record PhonePropertiesSaltoSpaceCredentialServiceMetadata [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 index edc956a..c467fb5 100644 --- a/src/Seam/Models/Space.cs +++ b/src/Seam/Models/Space.cs @@ -14,6 +14,60 @@ namespace Seam.Models /// public sealed record Space { + [JsonConverter(typeof(SeamUnionConverter))] + [SeamUnion("warning_code")] + [SeamUnionVariant("being_deleted", typeof(SpaceWarningsBeingDeleted))] + [SeamUnionVariant( + "noise_sensor_configuration_mismatch", + typeof(SpaceWarningsNoiseSensorConfigurationMismatch) + )] + [SeamUnionFallback(typeof(SpaceWarningsUnrecognized))] + public abstract record SpaceWarnings + { + /// 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 SpaceWarningsBeingDeleted : SpaceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "being_deleted"; + } + + public sealed record SpaceWarningsNoiseSensorConfigurationMismatch : SpaceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "noise_sensor_configuration_mismatch"; + + /// + /// IDs of the noise sensors in the space that Seam could not bring in line with the noise sensor automation. + /// + [JsonPropertyName("device_ids")] + public List DeviceIds { get; init; } = default!; + } + + public sealed record SpaceWarningsUnrecognized : SpaceWarnings, 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 entrances in the space. /// @@ -74,6 +128,12 @@ public sealed record Space [JsonPropertyName("space_key")] public string? SpaceKey { get; init; } + /// + /// Warnings associated with the space. + /// + [JsonPropertyName("warnings")] + public List Warnings { get; init; } = default!; + /// /// ID of the workspace associated with the space. /// diff --git a/src/Seam/Models/UnmanagedAccessCode.cs b/src/Seam/Models/UnmanagedAccessCode.cs index 013eddc..1aaa0f4 100644 --- a/src/Seam/Models/UnmanagedAccessCode.cs +++ b/src/Seam/Models/UnmanagedAccessCode.cs @@ -758,6 +758,10 @@ public enum TypeEnum typeof(UnmanagedAccessCodeWarningsUsingBackupAccessCode) )] [SeamUnionVariant("being_deleted", typeof(UnmanagedAccessCodeWarningsBeingDeleted))] + [SeamUnionVariant( + "device_unreachable_for_extended_period", + typeof(UnmanagedAccessCodeWarningsDeviceUnreachableForExtendedPeriod) + )] [SeamUnionVariant( "unknown_issue_with_access_code", typeof(UnmanagedAccessCodeWarningsUnknownIssueWithAccessCode) @@ -907,6 +911,19 @@ public sealed record UnmanagedAccessCodeWarningsBeingDeleted : UnmanagedAccessCo public override string WarningCode { get; } = "being_deleted"; } + public sealed record UnmanagedAccessCodeWarningsDeviceUnreachableForExtendedPeriod + : UnmanagedAccessCodeWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "device_unreachable_for_extended_period"; + + /// + /// Date and time since which Seam has been unable to reach the device. + /// + [JsonPropertyName("device_unreachable_since")] + public string DeviceUnreachableSince { get; init; } = default!; + } + public sealed record UnmanagedAccessCodeWarningsUnknownIssueWithAccessCode : UnmanagedAccessCodeWarnings { diff --git a/src/Seam/Models/UnmanagedAccessGrant.cs b/src/Seam/Models/UnmanagedAccessGrant.cs index 6ae7019..d9c1bf7 100644 --- a/src/Seam/Models/UnmanagedAccessGrant.cs +++ b/src/Seam/Models/UnmanagedAccessGrant.cs @@ -20,6 +20,10 @@ public sealed record UnmanagedAccessGrant "cannot_create_requested_access_methods", typeof(UnmanagedAccessGrantErrorsCannotCreateRequestedAccessMethods) )] + [SeamUnionVariant( + "access_not_provisioned", + typeof(UnmanagedAccessGrantErrorsAccessNotProvisioned) + )] [SeamUnionFallback(typeof(UnmanagedAccessGrantErrorsUnrecognized))] public abstract record UnmanagedAccessGrantErrors { @@ -52,6 +56,13 @@ public sealed record UnmanagedAccessGrantErrorsCannotCreateRequestedAccessMethod public List? MissingDeviceIds { get; init; } } + public sealed record UnmanagedAccessGrantErrorsAccessNotProvisioned + : UnmanagedAccessGrantErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "access_not_provisioned"; + } + public sealed record UnmanagedAccessGrantErrorsUnrecognized : UnmanagedAccessGrantErrors, ISeamUnrecognizedVariant @@ -234,6 +245,7 @@ public sealed record UnmanagedAccessGrantPendingMutationsUnrecognized "device_time_constraints_violated", typeof(UnmanagedAccessGrantWarningsDeviceTimeConstraintsViolated) )] + [SeamUnionVariant("access_revoked", typeof(UnmanagedAccessGrantWarningsAccessRevoked))] [SeamUnionFallback(typeof(UnmanagedAccessGrantWarningsUnrecognized))] public abstract record UnmanagedAccessGrantWarnings { @@ -281,6 +293,19 @@ public sealed record UnmanagedAccessGrantWarningsOverprovisionedAccess public sealed record UnmanagedAccessGrantWarningsOverprovisionedAccessFailedDevices { + /// + /// Reason the access code could not be revoked. + /// + [JsonConverter(typeof(SeamStringEnumConverter))] + public enum ErrorCodeEnum + { + [EnumMember(Value = "unrecognized")] + Unrecognized = 0, + + [EnumMember(Value = "offline_access_code_not_revocable")] + OfflineAccessCodeNotRevocable = 1, + } + /// /// Device whose access code could not be revoked. /// @@ -288,10 +313,11 @@ public sealed record UnmanagedAccessGrantWarningsOverprovisionedAccessFailedDevi public string DeviceId { get; init; } = default!; /// - /// Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`). + /// Reason the access code could not be revoked. /// [JsonPropertyName("error_code")] - public string ErrorCode { get; init; } = default!; + public UnmanagedAccessGrantWarningsOverprovisionedAccessFailedDevices.ErrorCodeEnum ErrorCode { get; init; } = + default!; /// /// Human-readable description of why revocation failed. @@ -320,10 +346,16 @@ public sealed record UnmanagedAccessGrantWarningsRequestedCodeUnavailable public override string WarningCode { get; } = "requested_code_unavailable"; /// - /// ID of the device where the requested code was unavailable. + /// ID of the access method whose requested code was unavailable. Present when an access system, such as Salto KS, assigned a different code. + /// + [JsonPropertyName("access_method_id")] + public string? AccessMethodId { get; init; } + + /// + /// ID of the device where the requested code was unavailable. Present when the code was set directly on a device. /// [JsonPropertyName("device_id")] - public string DeviceId { get; init; } = default!; + public string? DeviceId { get; init; } /// /// The new PIN code that was assigned instead. @@ -390,6 +422,19 @@ public enum ReasonEnum default!; } + public sealed record UnmanagedAccessGrantWarningsAccessRevoked + : UnmanagedAccessGrantWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "access_revoked"; + + /// + /// ID of the access method whose access was revoked. + /// + [JsonPropertyName("access_method_id")] + public string AccessMethodId { get; init; } = default!; + } + public sealed record UnmanagedAccessGrantWarningsUnrecognized : UnmanagedAccessGrantWarnings, ISeamUnrecognizedVariant diff --git a/src/Seam/Models/UnmanagedAccessMethod.cs b/src/Seam/Models/UnmanagedAccessMethod.cs index 2525282..412a5ef 100644 --- a/src/Seam/Models/UnmanagedAccessMethod.cs +++ b/src/Seam/Models/UnmanagedAccessMethod.cs @@ -17,6 +17,10 @@ public sealed record UnmanagedAccessMethod [JsonConverter(typeof(SeamUnionConverter))] [SeamUnion("error_code")] [SeamUnionVariant("failed_to_issue", typeof(UnmanagedAccessMethodErrorsFailedToIssue))] + [SeamUnionVariant( + "access_not_provisioned", + typeof(UnmanagedAccessMethodErrorsAccessNotProvisioned) + )] [SeamUnionFallback(typeof(UnmanagedAccessMethodErrorsUnrecognized))] public abstract record UnmanagedAccessMethodErrors { @@ -42,6 +46,13 @@ public sealed record UnmanagedAccessMethodErrorsFailedToIssue : UnmanagedAccessM public override string ErrorCode { get; } = "failed_to_issue"; } + public sealed record UnmanagedAccessMethodErrorsAccessNotProvisioned + : UnmanagedAccessMethodErrors + { + [JsonPropertyName("error_code")] + public override string ErrorCode { get; } = "access_not_provisioned"; + } + public sealed record UnmanagedAccessMethodErrorsUnrecognized : UnmanagedAccessMethodErrors, ISeamUnrecognizedVariant @@ -90,6 +101,10 @@ public enum ModeEnum "updating_access_times", typeof(UnmanagedAccessMethodPendingMutationsUpdatingAccessTimes) )] + [SeamUnionVariant( + "waiting_for_access_on_acs_system", + typeof(UnmanagedAccessMethodPendingMutationsWaitingForAccessOnAcsSystem) + )] [SeamUnionFallback(typeof(UnmanagedAccessMethodPendingMutationsUnrecognized))] public abstract record UnmanagedAccessMethodPendingMutations { @@ -238,6 +253,13 @@ public sealed record UnmanagedAccessMethodPendingMutationsUpdatingAccessTimesTo public string? StartsAt { get; init; } } + public sealed record UnmanagedAccessMethodPendingMutationsWaitingForAccessOnAcsSystem + : UnmanagedAccessMethodPendingMutations + { + [JsonPropertyName("mutation_code")] + public override string MutationCode { get; } = "waiting_for_access_on_acs_system"; + } + public sealed record UnmanagedAccessMethodPendingMutationsUnrecognized : UnmanagedAccessMethodPendingMutations, ISeamUnrecognizedVariant @@ -270,6 +292,14 @@ public sealed record UnmanagedAccessMethodPendingMutationsUnrecognized "user_identity_missing_phone_number", typeof(UnmanagedAccessMethodWarningsUserIdentityMissingPhoneNumber) )] + [SeamUnionVariant( + "requested_code_unavailable", + typeof(UnmanagedAccessMethodWarningsRequestedCodeUnavailable) + )] + [SeamUnionVariant( + "schedule_rounded_up", + typeof(UnmanagedAccessMethodWarningsScheduleRoundedUp) + )] [SeamUnionFallback(typeof(UnmanagedAccessMethodWarningsUnrecognized))] public abstract record UnmanagedAccessMethodWarnings { @@ -337,6 +367,32 @@ public sealed record UnmanagedAccessMethodWarningsUserIdentityMissingPhoneNumber public override string WarningCode { get; } = "user_identity_missing_phone_number"; } + public sealed record UnmanagedAccessMethodWarningsRequestedCodeUnavailable + : UnmanagedAccessMethodWarnings + { + [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 UnmanagedAccessMethodWarningsScheduleRoundedUp + : UnmanagedAccessMethodWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "schedule_rounded_up"; + } + public sealed record UnmanagedAccessMethodWarningsUnrecognized : UnmanagedAccessMethodWarnings, ISeamUnrecognizedVariant @@ -410,7 +466,7 @@ public sealed record UnmanagedAccessMethodWarningsUnrecognized 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. + /// Indicates whether the access method is ready to be encoded. This is true when the card has not yet been issued and the access system has received all the access the card needs. While it is false, `pending_mutations` contains `waiting_for_access_on_acs_system`. /// [JsonPropertyName("is_ready_for_encoding")] public bool? IsReadyForEncoding { get; init; } diff --git a/src/Seam/Models/UnmanagedDevice.cs b/src/Seam/Models/UnmanagedDevice.cs index 26df2dd..b0657f5 100644 --- a/src/Seam/Models/UnmanagedDevice.cs +++ b/src/Seam/Models/UnmanagedDevice.cs @@ -144,50 +144,59 @@ public enum DeviceTypeEnum [EnumMember(Value = "aqara_lock")] AqaraLock = 31, + [EnumMember(Value = "eufy_lock")] + EufyLock = 32, + [EnumMember(Value = "keynest_key")] - KeynestKey = 32, + KeynestKey = 33, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, + NoiseawareActivityZone = 34, [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, + MinutSensor = 35, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, + EcobeeThermostat = 36, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, + NestThermostat = 37, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, + HoneywellResideoThermostat = 38, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, + TadoThermostat = 39, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, + SensiThermostat = 40, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, + SmartthingsThermostat = 41, [EnumMember(Value = "ios_phone")] - IosPhone = 41, + IosPhone = 42, [EnumMember(Value = "android_phone")] - AndroidPhone = 42, + AndroidPhone = 43, [EnumMember(Value = "ring_camera")] - RingCamera = 43, + RingCamera = 44, [EnumMember(Value = "tapo_camera")] - TapoCamera = 44, + TapoCamera = 45, [EnumMember(Value = "arlo_camera")] - ArloCamera = 45, + ArloCamera = 46, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 46, + ReolinkCamera = 47, + + [EnumMember(Value = "unifi_protect_camera")] + UnifiProtectCamera = 48, + + [EnumMember(Value = "sonos_speaker")] + SonosSpeaker = 49, } [JsonConverter(typeof(SeamUnionConverter))] @@ -556,6 +565,10 @@ public sealed record UnmanagedDeviceErrorsUnrecognized "max_access_codes_reached", typeof(UnmanagedDeviceWarningsMaxAccessCodesReached) )] + [SeamUnionVariant( + "cloud_recording_not_enabled", + typeof(UnmanagedDeviceWarningsCloudRecordingNotEnabled) + )] [SeamUnionFallback(typeof(UnmanagedDeviceWarningsUnrecognized))] public abstract record UnmanagedDeviceWarnings { @@ -776,6 +789,13 @@ public sealed record UnmanagedDeviceWarningsMaxAccessCodesReached : UnmanagedDev public int MaxActiveAccessCodeCount { get; init; } = default!; } + public sealed record UnmanagedDeviceWarningsCloudRecordingNotEnabled + : UnmanagedDeviceWarnings + { + [JsonPropertyName("warning_code")] + public override string WarningCode { get; } = "cloud_recording_not_enabled"; + } + public sealed record UnmanagedDeviceWarningsUnrecognized : UnmanagedDeviceWarnings, ISeamUnrecognizedVariant diff --git a/src/Seam/Routes/AccessCodes.cs b/src/Seam/Routes/AccessCodes.cs index c468a4e..73f415c 100644 --- a/src/Seam/Routes/AccessCodes.cs +++ b/src/Seam/Routes/AccessCodes.cs @@ -465,25 +465,25 @@ public async Task GetAsync( 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`. + /// IDs of the access codes that you want to retrieve. /// [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`. + /// ID of the access grant for which you want to list access codes. /// [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`. + /// Key of the access grant for which you want to list access codes. /// [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`. + /// ID of the access method for which you want to list access codes. /// [JsonPropertyName("access_method_id")] public string? AccessMethodId { get; init; } @@ -495,7 +495,7 @@ public sealed record ListRequest 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`. + /// ID of the device for which you want to list access codes. /// [JsonPropertyName("device_id")] public string? DeviceId { get; init; } @@ -523,25 +523,6 @@ public sealed record ListRequest /// [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 - && Search == null - && UserIdentifierKey == null - ) - { - throw new ArgumentException( - "At least one parameter is required for /access_codes/list" - ); - } - } } public sealed record ListResponse @@ -562,14 +543,13 @@ public sealed record ListResponse /// /// Returns a list of all [access codes](https://www.seam.co/docs/low-level-apis/smart-locks/access-codes). /// - /// Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. + /// Without `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`, returns access codes across the workspace, or across the customer when `customer_key` is set. Use `limit` and `page_cursor` to page through them. /// public async Task> ListAsync( - ListRequest request, + ListRequest? request = null, CancellationToken cancellationToken = default ) { - request.Validate(); var response = await _transport .SendAsync( HttpMethod.Get, @@ -584,11 +564,10 @@ public async Task> ListAsync( /// Fetches one page of /access_codes/list with its pagination metadata. public async Task> ListPageAsync( - ListRequest request, + ListRequest? request = null, CancellationToken cancellationToken = default ) { - request.Validate(); var response = await _transport .SendAsync( HttpMethod.Get, @@ -605,12 +584,17 @@ public async Task> ListPageAsync( } /// Creates a paginator over /access_codes/list. - public SeamPaginator ListPager(ListRequest request) + public SeamPaginator ListPager(ListRequest? request = null) { return new SeamPaginator( (pageCursor, cancellationToken) => ListPageAsync( - pageCursor == null ? request : request with { PageCursor = pageCursor }, + pageCursor == null + ? request + : (request ?? new ListRequest()) with + { + PageCursor = pageCursor, + }, cancellationToken ) ); diff --git a/src/Seam/Routes/AccessGrantsUnmanaged.cs b/src/Seam/Routes/AccessGrantsUnmanaged.cs index fcbec7b..f18a0f7 100644 --- a/src/Seam/Routes/AccessGrantsUnmanaged.cs +++ b/src/Seam/Routes/AccessGrantsUnmanaged.cs @@ -83,6 +83,12 @@ public sealed record ListRequest [JsonPropertyName("acs_system_id")] public string? AcsSystemId { get; init; } + /// + /// Customer key for which you want to list unmanaged Access Grants. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + /// /// Numerical limit on the number of unmanaged access grants to return. /// diff --git a/src/Seam/Routes/AccessMethods.cs b/src/Seam/Routes/AccessMethods.cs index 84c181a..a9115a3 100644 --- a/src/Seam/Routes/AccessMethods.cs +++ b/src/Seam/Routes/AccessMethods.cs @@ -367,6 +367,12 @@ public sealed record ListRequest [JsonPropertyName("acs_entrance_id")] public string? AcsEntranceId { get; init; } + /// + /// Customer key for which you want to list access methods. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { 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`. /// @@ -398,6 +404,7 @@ internal void Validate() && AccessGrantId == null && AccessGrantKey == null && AcsEntranceId == null + && CustomerKey == null && DeviceId == null && SpaceId == null ) diff --git a/src/Seam/Routes/CamerasLiveViews.cs b/src/Seam/Routes/CamerasLiveViews.cs index 7b6f4d7..6bb12ee 100644 --- a/src/Seam/Routes/CamerasLiveViews.cs +++ b/src/Seam/Routes/CamerasLiveViews.cs @@ -61,7 +61,7 @@ public sealed record CreateResponse /// /// Creates a short-lived live view session for a single camera. Pass the returned session ID and token to `/cameras/live_views/offer` to start a WebRTC stream, and to `/cameras/live_views/stop` to end the session. /// - /// Camera live view is in beta. To enable it for your workspace, contact Seam support. To check whether a camera supports live view, use `device.can_stream_live_video`. + /// Camera live view is in public beta and enabled by default in production and sandbox workspaces. Use your API key on your backend to create a client session with access to the camera's connected account, then authenticate live view requests with that client session's token. To check whether a camera supports live view, use `device.can_stream_live_video`. /// public async Task CreateAsync( CreateRequest request, @@ -116,7 +116,7 @@ public sealed record OfferResponse /// /// Exchanges a WebRTC SDP offer for an SDP answer that starts streaming video from the camera, for a live view session that you created using `/cameras/live_views/create`. /// - /// Camera live view is in beta. To enable it for your workspace, contact Seam support. + /// Camera live view is in public beta and enabled by default in production and sandbox workspaces. Authenticate with the client session token used to create the live view session. /// public async Task OfferAsync( OfferRequest request, @@ -156,7 +156,7 @@ public sealed record StopRequest /// /// Stops a camera live view session that the current client session owns. /// - /// Camera live view is in beta. To enable it for your workspace, contact Seam support. + /// Camera live view is in public beta and enabled by default in production and sandbox workspaces. Authenticate with the client session token used to create the live view session. /// public async Task StopAsync( StopRequest request, diff --git a/src/Seam/Routes/ConnectWebviews.cs b/src/Seam/Routes/ConnectWebviews.cs index dc7c804..20ca79a 100644 --- a/src/Seam/Routes/ConnectWebviews.cs +++ b/src/Seam/Routes/ConnectWebviews.cs @@ -53,6 +53,9 @@ public enum AcceptedCapabilitiesEnum [EnumMember(Value = "camera")] Camera = 5, + + [EnumMember(Value = "speaker")] + Speaker = 6, } /// @@ -244,41 +247,50 @@ public enum AcceptedProvidersEnum [EnumMember(Value = "reolink")] Reolink = 60, + [EnumMember(Value = "unifi_protect")] + UnifiProtect = 61, + [EnumMember(Value = "ical")] - Ical = 61, + Ical = 62, [EnumMember(Value = "lodgify")] - Lodgify = 62, + Lodgify = 63, [EnumMember(Value = "hostaway")] - Hostaway = 63, + Hostaway = 64, [EnumMember(Value = "guesty")] - Guesty = 64, + Guesty = 65, [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 65, + AcuityScheduling = 66, [EnumMember(Value = "omnitec")] - Omnitec = 66, + Omnitec = 67, [EnumMember(Value = "kisi")] - Kisi = 67, + Kisi = 68, [EnumMember(Value = "aqara")] - Aqara = 68, + Aqara = 69, + + [EnumMember(Value = "eufy")] + Eufy = 70, + + [EnumMember(Value = "sonos")] + Sonos = 71, [EnumMember(Value = "yale_access")] - YaleAccess = 69, + YaleAccess = 72, [EnumMember(Value = "hid_cm")] - HidCm = 70, + HidCm = 73, [EnumMember(Value = "google_nest")] - GoogleNest = 71, + GoogleNest = 74, [EnumMember(Value = "slack")] - Slack = 72, + Slack = 75, } /// diff --git a/src/Seam/Routes/ConnectedAccounts.cs b/src/Seam/Routes/ConnectedAccounts.cs index 4749f5c..e709f9d 100644 --- a/src/Seam/Routes/ConnectedAccounts.cs +++ b/src/Seam/Routes/ConnectedAccounts.cs @@ -294,6 +294,9 @@ public enum AcceptedCapabilitiesEnum [EnumMember(Value = "camera")] Camera = 5, + + [EnumMember(Value = "speaker")] + Speaker = 6, } /// diff --git a/src/Seam/Routes/Customers.cs b/src/Seam/Routes/Customers.cs index 4b2f512..225a09f 100644 --- a/src/Seam/Routes/Customers.cs +++ b/src/Seam/Routes/Customers.cs @@ -113,6 +113,9 @@ public enum NavigationModeEnum [JsonPropertyName("exclude_locale_picker")] public bool? ExcludeLocalePicker { get; init; } + /// + /// Features to include in the portal. Settings you omit use the portal's customization profile, then the Seam default. Settings you pass take precedence over the customization profile's, so changing the profile doesn't change them. + /// [JsonPropertyName("features")] public CreatePortalRequestFeatures? Features { get; init; } @@ -179,6 +182,12 @@ public sealed record CreatePortalRequestCustomerData [JsonPropertyName("customer_key")] public string? CustomerKey { get; init; } + /// + /// ID of the customization profile to use for this customer. Access grants that automations create for this customer use this profile. Pass `null` to remove the customer's customization profile. + /// + [JsonPropertyName("customization_profile_id")] + public Optional CustomizationProfileId { get; init; } + /// /// List of gym or fitness facilities. /// @@ -197,6 +206,12 @@ public sealed record CreatePortalRequestCustomerData [JsonPropertyName("listings")] public List? Listings { get; init; } + /// + /// Battery level, from 0 to 1, at or below which `device.low_battery` events fire for this customer's devices. Overrides the workspace and device defaults. Pass `null` to remove the customer's override. + /// + [JsonPropertyName("low_battery_alert_threshold")] + public Optional LowBatteryAlertThreshold { get; init; } + /// /// List of short-term rental properties. /// @@ -321,10 +336,10 @@ public sealed record CreatePortalRequestCustomerDataAccessGrants public string? Name { get; init; } /// - /// Preferred PIN code to use when creating access for this reservation. + /// Preferred PIN code to use when creating access for this reservation. Set to `null` to remove a previously set preferred code, so that access falls back to an automatically generated code. Omitting this field keeps any previously set preferred code. /// [JsonPropertyName("preferred_code")] - public string? PreferredCode { get; init; } + public Optional PreferredCode { get; init; } /// /// Property keys associated with the access grant. @@ -432,10 +447,10 @@ public sealed record CreatePortalRequestCustomerDataBookings public string? Name { get; init; } /// - /// Preferred PIN code to use when creating access for this reservation. + /// Preferred PIN code to use when creating access for this reservation. Set to `null` to remove a previously set preferred code, so that access falls back to an automatically generated code. Omitting this field keeps any previously set preferred code. /// [JsonPropertyName("preferred_code")] - public string? PreferredCode { get; init; } + public Optional PreferredCode { get; init; } /// /// Property keys associated with the access grant. @@ -672,10 +687,10 @@ public sealed record CreatePortalRequestCustomerDataReservations public string? Name { get; init; } /// - /// Preferred PIN code to use when creating access for this reservation. + /// Preferred PIN code to use when creating access for this reservation. Set to `null` to remove a previously set preferred code, so that access falls back to an automatically generated code. Omitting this field keeps any previously set preferred code. /// [JsonPropertyName("preferred_code")] - public string? PreferredCode { get; init; } + public Optional PreferredCode { get; init; } /// /// Property keys associated with the access grant. @@ -713,6 +728,135 @@ public sealed record CreatePortalRequestCustomerDataReservations [JsonPropertyName("starts_at")] public string? StartsAt { get; init; } + /// + /// Parts of the reservation that each get their own access, for example one per room. Each sub-reservation inherits the reservation's name, times, preferred code, guest and custom metadata unless it sets its own, and must set its own location keys. A reservation with sub-reservations must not set location keys itself. Sending this list replaces the reservation's sub-reservations: any not included are removed, and an empty list removes all of them. Omitting it leaves existing sub-reservations unchanged. + /// + [JsonPropertyName("sub_reservations")] + public List? SubReservations { 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 CreatePortalRequestCustomerDataReservationsSubReservations + { + /// + /// 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 sub-reservations by custom criteria. Merged over the reservation's 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; } + + /// + /// 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; } + + /// + /// Whether this is the reservation's primary sub-reservation, for example the room the guest stays in. Only the primary sub-reservation passes the guest's phone number to access systems that require a phone number to be unique per user. At most one sub-reservation of a reservation can be primary. If none is, the first sub-reservation in the list is primary. + /// + [JsonPropertyName("is_primary")] + public bool? IsPrimary { 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. Set to `null` to remove a previously set preferred code, so that access falls back to an automatically generated code. Omitting this field keeps any previously set preferred code. + /// + [JsonPropertyName("preferred_code")] + public Optional 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; } + + /// + /// Your identifier for the sub-reservation. Must be unique within its reservation. + /// + [JsonPropertyName("sub_reservation_key")] + public string? SubReservationKey { get; init; } + /// /// Tenant key associated with the access grant. /// @@ -1192,6 +1336,24 @@ public sealed record CreatePortalRequestFeaturesConfigure [JsonPropertyName("allow_instant_key_customization")] public bool? AllowInstantKeyCustomization { get; init; } + /// + /// Indicates whether the customer can customize their notification settings, such as the low-battery alert threshold. + /// + [JsonPropertyName("allow_notification_customization")] + public bool? AllowNotificationCustomization { get; init; } + + /// + /// Indicates whether the customer can customize the sensor automation rules for their properties. + /// + [JsonPropertyName("allow_sensor_automation_rule_customization")] + public bool? AllowSensorAutomationRuleCustomization { get; init; } + + /// + /// Indicates whether the customer can customize the sound automation rules for their properties. + /// + [JsonPropertyName("allow_sound_automation_rule_customization")] + public bool? AllowSoundAutomationRuleCustomization { get; init; } + /// /// Whether to exclude this feature from the portal. /// @@ -1240,6 +1402,12 @@ public sealed record CreatePortalRequestFeaturesManage [JsonPropertyName("exclude")] public bool? Exclude { get; init; } + /// + /// Indicates whether to prevent the customer from converting their devices between managed and unmanaged. Managed devices are billed. + /// + [JsonPropertyName("exclude_device_management")] + public bool? ExcludeDeviceManagement { get; init; } + /// /// Indicates whether the customer can manage reservations for their properties. /// @@ -1519,6 +1687,7 @@ public sealed record DeleteDataRequest /// /// 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). + /// Space keys also match spaces created directly with a `space_key` (for example, through `/spaces/create`). /// public async Task DeleteDataAsync( DeleteDataRequest? request = null, @@ -1565,6 +1734,12 @@ public sealed record PushDataRequest [JsonPropertyName("customer_key")] public required string CustomerKey { get; init; } + /// + /// ID of the customization profile to use for this customer. Access grants that automations create for this customer use this profile. Pass `null` to remove the customer's customization profile. + /// + [JsonPropertyName("customization_profile_id")] + public Optional CustomizationProfileId { get; init; } + /// /// List of gym or fitness facilities. /// @@ -1583,6 +1758,12 @@ public sealed record PushDataRequest [JsonPropertyName("listings")] public List? Listings { get; init; } + /// + /// Battery level, from 0 to 1, at or below which `device.low_battery` events fire for this customer's devices. Overrides the workspace and device defaults. Pass `null` to remove the customer's override. + /// + [JsonPropertyName("low_battery_alert_threshold")] + public Optional LowBatteryAlertThreshold { get; init; } + /// /// List of short-term rental properties. /// @@ -1707,10 +1888,10 @@ public sealed record PushDataRequestAccessGrants public string? Name { get; init; } /// - /// Preferred PIN code to use when creating access for this reservation. + /// Preferred PIN code to use when creating access for this reservation. Set to `null` to remove a previously set preferred code, so that access falls back to an automatically generated code. Omitting this field keeps any previously set preferred code. /// [JsonPropertyName("preferred_code")] - public string? PreferredCode { get; init; } + public Optional PreferredCode { get; init; } /// /// Property keys associated with the access grant. @@ -1818,10 +1999,10 @@ public sealed record PushDataRequestBookings public string? Name { get; init; } /// - /// Preferred PIN code to use when creating access for this reservation. + /// Preferred PIN code to use when creating access for this reservation. Set to `null` to remove a previously set preferred code, so that access falls back to an automatically generated code. Omitting this field keeps any previously set preferred code. /// [JsonPropertyName("preferred_code")] - public string? PreferredCode { get; init; } + public Optional PreferredCode { get; init; } /// /// Property keys associated with the access grant. @@ -2058,10 +2239,10 @@ public sealed record PushDataRequestReservations public string? Name { get; init; } /// - /// Preferred PIN code to use when creating access for this reservation. + /// Preferred PIN code to use when creating access for this reservation. Set to `null` to remove a previously set preferred code, so that access falls back to an automatically generated code. Omitting this field keeps any previously set preferred code. /// [JsonPropertyName("preferred_code")] - public string? PreferredCode { get; init; } + public Optional PreferredCode { get; init; } /// /// Property keys associated with the access grant. @@ -2099,6 +2280,135 @@ public sealed record PushDataRequestReservations [JsonPropertyName("starts_at")] public string? StartsAt { get; init; } + /// + /// Parts of the reservation that each get their own access, for example one per room. Each sub-reservation inherits the reservation's name, times, preferred code, guest and custom metadata unless it sets its own, and must set its own location keys. A reservation with sub-reservations must not set location keys itself. Sending this list replaces the reservation's sub-reservations: any not included are removed, and an empty list removes all of them. Omitting it leaves existing sub-reservations unchanged. + /// + [JsonPropertyName("sub_reservations")] + public List? SubReservations { 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 PushDataRequestReservationsSubReservations + { + /// + /// 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 sub-reservations by custom criteria. Merged over the reservation's 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; } + + /// + /// 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; } + + /// + /// Whether this is the reservation's primary sub-reservation, for example the room the guest stays in. Only the primary sub-reservation passes the guest's phone number to access systems that require a phone number to be unique per user. At most one sub-reservation of a reservation can be primary. If none is, the first sub-reservation in the list is primary. + /// + [JsonPropertyName("is_primary")] + public bool? IsPrimary { 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. Set to `null` to remove a previously set preferred code, so that access falls back to an automatically generated code. Omitting this field keeps any previously set preferred code. + /// + [JsonPropertyName("preferred_code")] + public Optional 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; } + + /// + /// Your identifier for the sub-reservation. Must be unique within its reservation. + /// + [JsonPropertyName("sub_reservation_key")] + public string? SubReservationKey { get; init; } + /// /// Tenant key associated with the access grant. /// diff --git a/src/Seam/Routes/Devices.cs b/src/Seam/Routes/Devices.cs index e5d3925..09a5d35 100644 --- a/src/Seam/Routes/Devices.cs +++ b/src/Seam/Routes/Devices.cs @@ -195,50 +195,59 @@ public enum DeviceTypeEnum [EnumMember(Value = "aqara_lock")] AqaraLock = 31, + [EnumMember(Value = "eufy_lock")] + EufyLock = 32, + [EnumMember(Value = "keynest_key")] - KeynestKey = 32, + KeynestKey = 33, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, + NoiseawareActivityZone = 34, [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, + MinutSensor = 35, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, + EcobeeThermostat = 36, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, + NestThermostat = 37, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, + HoneywellResideoThermostat = 38, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, + TadoThermostat = 39, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, + SensiThermostat = 40, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, + SmartthingsThermostat = 41, [EnumMember(Value = "ios_phone")] - IosPhone = 41, + IosPhone = 42, [EnumMember(Value = "android_phone")] - AndroidPhone = 42, + AndroidPhone = 43, [EnumMember(Value = "ring_camera")] - RingCamera = 43, + RingCamera = 44, [EnumMember(Value = "tapo_camera")] - TapoCamera = 44, + TapoCamera = 45, [EnumMember(Value = "arlo_camera")] - ArloCamera = 45, + ArloCamera = 46, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 46, + ReolinkCamera = 47, + + [EnumMember(Value = "unifi_protect_camera")] + UnifiProtectCamera = 48, + + [EnumMember(Value = "sonos_speaker")] + SonosSpeaker = 49, } /// @@ -343,50 +352,59 @@ public enum DeviceTypesEnum [EnumMember(Value = "aqara_lock")] AqaraLock = 31, + [EnumMember(Value = "eufy_lock")] + EufyLock = 32, + [EnumMember(Value = "keynest_key")] - KeynestKey = 32, + KeynestKey = 33, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, + NoiseawareActivityZone = 34, [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, + MinutSensor = 35, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, + EcobeeThermostat = 36, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, + NestThermostat = 37, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, + HoneywellResideoThermostat = 38, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, + TadoThermostat = 39, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, + SensiThermostat = 40, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, + SmartthingsThermostat = 41, [EnumMember(Value = "ios_phone")] - IosPhone = 41, + IosPhone = 42, [EnumMember(Value = "android_phone")] - AndroidPhone = 42, + AndroidPhone = 43, [EnumMember(Value = "ring_camera")] - RingCamera = 43, + RingCamera = 44, [EnumMember(Value = "tapo_camera")] - TapoCamera = 44, + TapoCamera = 45, [EnumMember(Value = "arlo_camera")] - ArloCamera = 45, + ArloCamera = 46, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 46, + ReolinkCamera = 47, + + [EnumMember(Value = "unifi_protect_camera")] + UnifiProtectCamera = 48, + + [EnumMember(Value = "sonos_speaker")] + SonosSpeaker = 49, } /// @@ -479,95 +497,104 @@ public enum ManufacturerEnum [EnumMember(Value = "keyincode")] Keyincode = 27, + [EnumMember(Value = "ubiquiti")] + Ubiquiti = 28, + [EnumMember(Value = "akiles")] - Akiles = 28, + Akiles = 29, [EnumMember(Value = "aqara")] - Aqara = 29, + Aqara = 30, [EnumMember(Value = "ecobee")] - Ecobee = 30, + Ecobee = 31, [EnumMember(Value = "eufy")] - Eufy = 31, + Eufy = 32, [EnumMember(Value = "dormakaba_oracode")] - DormakabaOracode = 32, + DormakabaOracode = 33, [EnumMember(Value = "dormakaba_oracode_iho")] - DormakabaOracodeIho = 33, + DormakabaOracodeIho = 34, [EnumMember(Value = "honeywell_resideo")] - HoneywellResideo = 34, + HoneywellResideo = 35, [EnumMember(Value = "keynest")] - Keynest = 35, + Keynest = 36, [EnumMember(Value = "korelock")] - Korelock = 36, + Korelock = 37, [EnumMember(Value = "lockly")] - Lockly = 37, + Lockly = 38, [EnumMember(Value = "minut")] - Minut = 38, + Minut = 39, [EnumMember(Value = "nest")] - Nest = 39, + Nest = 40, [EnumMember(Value = "noiseaware")] - Noiseaware = 40, + Noiseaware = 41, [EnumMember(Value = "sensi")] - Sensi = 41, + Sensi = 42, [EnumMember(Value = "smartthings")] - Smartthings = 42, + Smartthings = 43, [EnumMember(Value = "tado")] - Tado = 43, + Tado = 44, [EnumMember(Value = "ultraloq")] - Ultraloq = 44, + Ultraloq = 45, [EnumMember(Value = "ring")] - Ring = 45, + Ring = 46, [EnumMember(Value = "tapo")] - Tapo = 46, + Tapo = 47, [EnumMember(Value = "arlo")] - Arlo = 47, + Arlo = 48, [EnumMember(Value = "reolink")] - Reolink = 48, + Reolink = 49, + + [EnumMember(Value = "unifi_protect")] + UnifiProtect = 50, [EnumMember(Value = "ical")] - Ical = 49, + Ical = 51, [EnumMember(Value = "lodgify")] - Lodgify = 50, + Lodgify = 52, [EnumMember(Value = "hostaway")] - Hostaway = 51, + Hostaway = 53, [EnumMember(Value = "guesty")] - Guesty = 52, + Guesty = 54, [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 53, + AcuityScheduling = 55, [EnumMember(Value = "omnitec")] - Omnitec = 54, + Omnitec = 56, [EnumMember(Value = "kisi")] - Kisi = 55, + Kisi = 57, [EnumMember(Value = "slack")] - Slack = 56, + Slack = 58, [EnumMember(Value = "yacan")] - Yacan = 57, + Yacan = 59, + + [EnumMember(Value = "sonos")] + Sonos = 60, } /// diff --git a/src/Seam/Routes/DevicesUnmanaged.cs b/src/Seam/Routes/DevicesUnmanaged.cs index 84dbb83..421d13a 100644 --- a/src/Seam/Routes/DevicesUnmanaged.cs +++ b/src/Seam/Routes/DevicesUnmanaged.cs @@ -194,50 +194,59 @@ public enum DeviceTypeEnum [EnumMember(Value = "aqara_lock")] AqaraLock = 31, + [EnumMember(Value = "eufy_lock")] + EufyLock = 32, + [EnumMember(Value = "keynest_key")] - KeynestKey = 32, + KeynestKey = 33, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, + NoiseawareActivityZone = 34, [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, + MinutSensor = 35, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, + EcobeeThermostat = 36, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, + NestThermostat = 37, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, + HoneywellResideoThermostat = 38, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, + TadoThermostat = 39, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, + SensiThermostat = 40, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, + SmartthingsThermostat = 41, [EnumMember(Value = "ios_phone")] - IosPhone = 41, + IosPhone = 42, [EnumMember(Value = "android_phone")] - AndroidPhone = 42, + AndroidPhone = 43, [EnumMember(Value = "ring_camera")] - RingCamera = 43, + RingCamera = 44, [EnumMember(Value = "tapo_camera")] - TapoCamera = 44, + TapoCamera = 45, [EnumMember(Value = "arlo_camera")] - ArloCamera = 45, + ArloCamera = 46, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 46, + ReolinkCamera = 47, + + [EnumMember(Value = "unifi_protect_camera")] + UnifiProtectCamera = 48, + + [EnumMember(Value = "sonos_speaker")] + SonosSpeaker = 49, } /// @@ -342,50 +351,59 @@ public enum DeviceTypesEnum [EnumMember(Value = "aqara_lock")] AqaraLock = 31, + [EnumMember(Value = "eufy_lock")] + EufyLock = 32, + [EnumMember(Value = "keynest_key")] - KeynestKey = 32, + KeynestKey = 33, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 33, + NoiseawareActivityZone = 34, [EnumMember(Value = "minut_sensor")] - MinutSensor = 34, + MinutSensor = 35, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 35, + EcobeeThermostat = 36, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 36, + NestThermostat = 37, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 37, + HoneywellResideoThermostat = 38, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 38, + TadoThermostat = 39, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 39, + SensiThermostat = 40, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 40, + SmartthingsThermostat = 41, [EnumMember(Value = "ios_phone")] - IosPhone = 41, + IosPhone = 42, [EnumMember(Value = "android_phone")] - AndroidPhone = 42, + AndroidPhone = 43, [EnumMember(Value = "ring_camera")] - RingCamera = 43, + RingCamera = 44, [EnumMember(Value = "tapo_camera")] - TapoCamera = 44, + TapoCamera = 45, [EnumMember(Value = "arlo_camera")] - ArloCamera = 45, + ArloCamera = 46, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 46, + ReolinkCamera = 47, + + [EnumMember(Value = "unifi_protect_camera")] + UnifiProtectCamera = 48, + + [EnumMember(Value = "sonos_speaker")] + SonosSpeaker = 49, } /// @@ -478,95 +496,104 @@ public enum ManufacturerEnum [EnumMember(Value = "keyincode")] Keyincode = 27, + [EnumMember(Value = "ubiquiti")] + Ubiquiti = 28, + [EnumMember(Value = "akiles")] - Akiles = 28, + Akiles = 29, [EnumMember(Value = "aqara")] - Aqara = 29, + Aqara = 30, [EnumMember(Value = "ecobee")] - Ecobee = 30, + Ecobee = 31, [EnumMember(Value = "eufy")] - Eufy = 31, + Eufy = 32, [EnumMember(Value = "dormakaba_oracode")] - DormakabaOracode = 32, + DormakabaOracode = 33, [EnumMember(Value = "dormakaba_oracode_iho")] - DormakabaOracodeIho = 33, + DormakabaOracodeIho = 34, [EnumMember(Value = "honeywell_resideo")] - HoneywellResideo = 34, + HoneywellResideo = 35, [EnumMember(Value = "keynest")] - Keynest = 35, + Keynest = 36, [EnumMember(Value = "korelock")] - Korelock = 36, + Korelock = 37, [EnumMember(Value = "lockly")] - Lockly = 37, + Lockly = 38, [EnumMember(Value = "minut")] - Minut = 38, + Minut = 39, [EnumMember(Value = "nest")] - Nest = 39, + Nest = 40, [EnumMember(Value = "noiseaware")] - Noiseaware = 40, + Noiseaware = 41, [EnumMember(Value = "sensi")] - Sensi = 41, + Sensi = 42, [EnumMember(Value = "smartthings")] - Smartthings = 42, + Smartthings = 43, [EnumMember(Value = "tado")] - Tado = 43, + Tado = 44, [EnumMember(Value = "ultraloq")] - Ultraloq = 44, + Ultraloq = 45, [EnumMember(Value = "ring")] - Ring = 45, + Ring = 46, [EnumMember(Value = "tapo")] - Tapo = 46, + Tapo = 47, [EnumMember(Value = "arlo")] - Arlo = 47, + Arlo = 48, [EnumMember(Value = "reolink")] - Reolink = 48, + Reolink = 49, + + [EnumMember(Value = "unifi_protect")] + UnifiProtect = 50, [EnumMember(Value = "ical")] - Ical = 49, + Ical = 51, [EnumMember(Value = "lodgify")] - Lodgify = 50, + Lodgify = 52, [EnumMember(Value = "hostaway")] - Hostaway = 51, + Hostaway = 53, [EnumMember(Value = "guesty")] - Guesty = 52, + Guesty = 54, [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 53, + AcuityScheduling = 55, [EnumMember(Value = "omnitec")] - Omnitec = 54, + Omnitec = 56, [EnumMember(Value = "kisi")] - Kisi = 55, + Kisi = 57, [EnumMember(Value = "slack")] - Slack = 56, + Slack = 58, [EnumMember(Value = "yacan")] - Yacan = 57, + Yacan = 59, + + [EnumMember(Value = "sonos")] + Sonos = 60, } /// diff --git a/src/Seam/Routes/Events.cs b/src/Seam/Routes/Events.cs index 75f4cca..ac1a49f 100644 --- a/src/Seam/Routes/Events.cs +++ b/src/Seam/Routes/Events.cs @@ -66,7 +66,7 @@ public sealed record GetResponse } /// - /// Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://www.seam.co/docs/developer-tools/webhooks), but it enables you to retrieve an event that already took place. + /// Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://www.seam.co/docs/developer-tools/webhooks), but it enables you to retrieve an event that already took place. Events older than 90 days are not returned. /// public async Task GetAsync( GetRequest request, @@ -874,7 +874,7 @@ public enum EventTypesEnum 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`. + /// Lower and upper timestamps to define an exclusive interval containing the events that you want to list. You must include `since` or `between`. Only events from the last 90 days are returned, so a lower timestamp older than 90 days is treated as 90 days ago. /// [JsonPropertyName("between")] public List? Between { get; init; } @@ -934,7 +934,7 @@ public enum EventTypesEnum 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`. + /// Timestamp to indicate the beginning generation time for the events that you want to list. You must include `since` or `between`. Only events from the last 90 days are returned, so a `since` older than 90 days is treated as 90 days ago. /// [JsonPropertyName("since")] public string? Since { get; init; } @@ -1012,7 +1012,7 @@ public sealed record ListResponse } /// - /// Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://www.seam.co/docs/developer-tools/webhooks), but it enables you to filter or see events that already took place. + /// Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://www.seam.co/docs/developer-tools/webhooks), but it enables you to filter or see events that already took place. Only events from the last 90 days are returned. /// public async Task> ListAsync( ListRequest request, diff --git a/src/Seam/Routes/Locks.cs b/src/Seam/Routes/Locks.cs index 8067ad1..36327b6 100644 --- a/src/Seam/Routes/Locks.cs +++ b/src/Seam/Routes/Locks.cs @@ -253,6 +253,9 @@ public enum DeviceTypeEnum [EnumMember(Value = "aqara_lock")] AqaraLock = 31, + + [EnumMember(Value = "eufy_lock")] + EufyLock = 32, } /// @@ -356,6 +359,9 @@ public enum DeviceTypesEnum [EnumMember(Value = "aqara_lock")] AqaraLock = 31, + + [EnumMember(Value = "eufy_lock")] + EufyLock = 32, } /// diff --git a/src/Seam/Routes/UserIdentities.cs b/src/Seam/Routes/UserIdentities.cs index 66f8182..dc2fe4d 100644 --- a/src/Seam/Routes/UserIdentities.cs +++ b/src/Seam/Routes/UserIdentities.cs @@ -85,6 +85,12 @@ public sealed record CreateRequest [JsonPropertyName("acs_system_ids")] public List? AcsSystemIds { get; init; } + /// + /// Customer key of the customer that owns the new user identity. Set it when the user identity will be used in access grants created through that customer's client session or Customer Portal. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + /// /// Unique email address for the new user identity. /// @@ -322,6 +328,12 @@ public sealed record ListRequest [JsonPropertyName("credential_manager_acs_system_id")] public string? CredentialManagerAcsSystemId { get; init; } + /// + /// Customer key for which you want to list user identities. + /// + [JsonPropertyName("customer_key")] + public string? CustomerKey { get; init; } + /// /// Maximum number of records to return per page. /// From 6c6912e9ea1efa7243cb9a9cbb967659e7c91a5b Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 5 Nov 2026 15:50:18 -0800 Subject: [PATCH 4/7] Update seamapi types --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 86b31cd..56e7422 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@seamapi/blueprint": "^1.12.0", "@seamapi/fake-seam-connect": "2.0.6", "@seamapi/smith": "^1.1.1", - "@seamapi/types": "1.1159.0", + "@seamapi/types": "1.1181.0", "change-case": "^5.4.4", "del": "^8.0.0", "execa": "^10.0.1", @@ -855,9 +855,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1159.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1159.0.tgz", - "integrity": "sha512-QuJY2XT/A61PlEN/8+QsEcYzJk13dc8v1rNC5yWXWv0iJfwc0zOIly+Z3RdcEX+Gg+ghRUoaIHVk4WSJlzRHJQ==", + "version": "1.1181.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1181.0.tgz", + "integrity": "sha512-Ba2I7kLW5RxN3CnCacEF+1nvLDwpS61vGSkPeB4IqeL4Ccy4NtTRQMlyCDQNNhT9y3A6WAQrz87u2XhSYu1XUw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 83757a1..07a5644 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@seamapi/blueprint": "^1.12.0", "@seamapi/fake-seam-connect": "2.0.6", "@seamapi/smith": "^1.1.1", - "@seamapi/types": "1.1159.0", + "@seamapi/types": "1.1181.0", "change-case": "^5.4.4", "del": "^8.0.0", "execa": "^10.0.1", From d5b8d1c209a97165a42be11ed6b86f8ff8a69be4 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Thu, 5 Nov 2026 23:51:27 +0000 Subject: [PATCH 5/7] ci: Generate code --- src/Seam/Models/Device.cs | 124 ++++++++++++++------ src/Seam/Models/DeviceProvider.cs | 131 +++++++++++---------- src/Seam/Models/UnmanagedDevice.cs | 79 +++++++------ src/Seam/Routes/ClientSessions.cs | 62 ++++++++++ src/Seam/Routes/ConnectWebviews.cs | 138 ++++++++++++----------- src/Seam/Routes/Customers.cs | 4 +- src/Seam/Routes/Devices.cs | 169 ++++++++++++++++------------ src/Seam/Routes/DevicesUnmanaged.cs | 169 ++++++++++++++++------------ src/Seam/Routes/Locks.cs | 87 ++++++++------ 9 files changed, 583 insertions(+), 380 deletions(-) diff --git a/src/Seam/Models/Device.cs b/src/Seam/Models/Device.cs index b538286..ccc7d67 100644 --- a/src/Seam/Models/Device.cs +++ b/src/Seam/Models/Device.cs @@ -43,7 +43,7 @@ public enum CapabilitiesSupportedEnum } /// - /// Type of the device. + /// Type of the device. The `august_lock` and `yale_lock` values are deprecated. Use `yale_access_lock` in place of `august_lock`, and `yale_access_lock` or `yale_home_lock` in place of `yale_lock`. /// [JsonConverter(typeof(SeamStringEnumConverter))] public enum DeviceTypeEnum @@ -102,101 +102,110 @@ public enum DeviceTypeEnum [EnumMember(Value = "yale_lock")] YaleLock = 17, + [EnumMember(Value = "yale_access_lock")] + YaleAccessLock = 18, + + [EnumMember(Value = "yale_home_lock")] + YaleHomeLock = 19, + + [EnumMember(Value = "yale_connect_lock")] + YaleConnectLock = 20, + [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, + TwoNIntercom = 21, [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, + ControlbywebDevice = 22, [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, + TtlockLock = 23, [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, + IgloohomeLock = 24, [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, + FourSuitesDoor = 25, [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, + DormakabaOracodeDoor = 26, [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, + TedeeLock = 27, [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, + AkilesLock = 28, [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, + UltraloqLock = 29, [EnumMember(Value = "yacan_lock")] - YacanLock = 27, + YacanLock = 30, [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, + KeyincodeLock = 31, [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, + OmnitecLock = 32, [EnumMember(Value = "kisi_lock")] - KisiLock = 30, + KisiLock = 33, [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, + AqaraLock = 34, [EnumMember(Value = "eufy_lock")] - EufyLock = 32, + EufyLock = 35, [EnumMember(Value = "keynest_key")] - KeynestKey = 33, + KeynestKey = 36, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 34, + NoiseawareActivityZone = 37, [EnumMember(Value = "minut_sensor")] - MinutSensor = 35, + MinutSensor = 38, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 36, + EcobeeThermostat = 39, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 37, + NestThermostat = 40, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 38, + HoneywellResideoThermostat = 41, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 39, + TadoThermostat = 42, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 40, + SensiThermostat = 43, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 41, + SmartthingsThermostat = 44, [EnumMember(Value = "ios_phone")] - IosPhone = 42, + IosPhone = 45, [EnumMember(Value = "android_phone")] - AndroidPhone = 43, + AndroidPhone = 46, [EnumMember(Value = "ring_camera")] - RingCamera = 44, + RingCamera = 47, [EnumMember(Value = "tapo_camera")] - TapoCamera = 45, + TapoCamera = 48, [EnumMember(Value = "arlo_camera")] - ArloCamera = 46, + ArloCamera = 49, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 47, + ReolinkCamera = 50, [EnumMember(Value = "unifi_protect_camera")] - UnifiProtectCamera = 48, + UnifiProtectCamera = 51, [EnumMember(Value = "sonos_speaker")] - SonosSpeaker = 49, + SonosSpeaker = 52, } [JsonConverter(typeof(SeamUnionConverter))] @@ -876,7 +885,7 @@ public sealed record DeviceWarningsUnrecognized : DeviceWarnings, ISeamUnrecogni public bool? CanSimulateRemoval { get; init; } /// - /// Indicates whether the camera supports streaming live video through a camera live view session. + /// Indicates whether the camera can stream live video through a camera live view session. `false` while the camera is offline. /// [JsonPropertyName("can_stream_live_video")] public bool? CanStreamLiveVideo { get; init; } @@ -937,7 +946,7 @@ public sealed record DeviceWarningsUnrecognized : DeviceWarnings, ISeamUnrecogni public DeviceDeviceProvider? DeviceProvider { get; init; } /// - /// Type of the device. + /// Type of the device. The `august_lock` and `yale_lock` values are deprecated. Use `yale_access_lock` in place of `august_lock`, and `yale_access_lock` or `yale_home_lock` in place of `yale_lock`. /// [JsonPropertyName("device_type")] public Device.DeviceTypeEnum DeviceType { get; init; } = default!; @@ -1553,6 +1562,12 @@ public enum FanModeSettingEnum [JsonPropertyName("yacan_metadata")] public DevicePropertiesYacanMetadata? YacanMetadata { get; init; } + /// + /// Metadata for a Yale Connect lock. + /// + [JsonPropertyName("yale_connect_metadata")] + public DevicePropertiesYaleConnectMetadata? YaleConnectMetadata { get; init; } + /// /// The delay in seconds before the lock automatically locks after being unlocked. /// @@ -3700,6 +3715,45 @@ public sealed record DevicePropertiesYacanMetadata public string? SerialNumber { get; init; } } + public sealed record DevicePropertiesYaleConnectMetadata + { + /// + /// Device ID for a Yale Connect lock. + /// + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + /// + /// Device name for a Yale Connect lock. + /// + [JsonPropertyName("device_name")] + public string? DeviceName { get; init; } + + /// + /// Firmware version reported by the Yale Connect lock. + /// + [JsonPropertyName("firmware_version")] + public string? FirmwareVersion { get; init; } + + /// + /// Name of the Yale Connect home that contains the lock. + /// + [JsonPropertyName("home_name")] + public string? HomeName { get; init; } + + /// + /// Model reported by the Yale Connect lock. + /// + [JsonPropertyName("model")] + public string? Model { get; init; } + + /// + /// Time zone of the Yale Connect home, as Yale reports it. + /// + [JsonPropertyName("time_zone_description")] + public string? TimeZoneDescription { get; init; } + } + public sealed record DevicePropertiesCodeConstraints { [JsonConverter(typeof(SeamStringEnumConverter))] diff --git a/src/Seam/Models/DeviceProvider.cs b/src/Seam/Models/DeviceProvider.cs index 1da305d..83d06b6 100644 --- a/src/Seam/Models/DeviceProvider.cs +++ b/src/Seam/Models/DeviceProvider.cs @@ -53,185 +53,194 @@ public enum DeviceProviderNameEnum [EnumMember(Value = "yale")] Yale = 11, + [EnumMember(Value = "yale_access")] + YaleAccess = 12, + + [EnumMember(Value = "yale_home")] + YaleHome = 13, + [EnumMember(Value = "genie")] - Genie = 12, + Genie = 14, [EnumMember(Value = "doorking")] - Doorking = 13, + Doorking = 15, [EnumMember(Value = "salto")] - Salto = 14, + Salto = 16, [EnumMember(Value = "salto_ks")] - SaltoKs = 15, + SaltoKs = 17, [EnumMember(Value = "salto_ks_accept")] - SaltoKsAccept = 16, + SaltoKsAccept = 18, [EnumMember(Value = "lockly")] - Lockly = 17, + Lockly = 19, [EnumMember(Value = "ttlock")] - Ttlock = 18, + Ttlock = 20, [EnumMember(Value = "linear")] - Linear = 19, + Linear = 21, [EnumMember(Value = "noiseaware")] - Noiseaware = 20, + Noiseaware = 22, [EnumMember(Value = "nuki")] - Nuki = 21, + Nuki = 23, [EnumMember(Value = "igloo")] - Igloo = 22, + Igloo = 24, [EnumMember(Value = "kwikset")] - Kwikset = 23, + Kwikset = 25, [EnumMember(Value = "minut")] - Minut = 24, + Minut = 26, [EnumMember(Value = "my_2n")] - My_2n = 25, + My_2n = 27, [EnumMember(Value = "controlbyweb")] - Controlbyweb = 26, + Controlbyweb = 28, [EnumMember(Value = "nest")] - Nest = 27, + Nest = 29, [EnumMember(Value = "igloohome")] - Igloohome = 28, + Igloohome = 30, [EnumMember(Value = "ecobee")] - Ecobee = 29, + Ecobee = 31, [EnumMember(Value = "four_suites")] - FourSuites = 30, + FourSuites = 32, [EnumMember(Value = "dormakaba_oracode")] - DormakabaOracode = 31, + DormakabaOracode = 33, [EnumMember(Value = "dormakaba_oracode_iho")] - DormakabaOracodeIho = 32, + DormakabaOracodeIho = 34, [EnumMember(Value = "pti")] - Pti = 33, + Pti = 35, [EnumMember(Value = "wyze")] - Wyze = 34, + Wyze = 36, [EnumMember(Value = "seam_passport")] - SeamPassport = 35, + SeamPassport = 37, [EnumMember(Value = "visionline")] - Visionline = 36, + Visionline = 38, [EnumMember(Value = "assa_abloy_credential_service")] - AssaAbloyCredentialService = 37, + AssaAbloyCredentialService = 39, [EnumMember(Value = "tedee")] - Tedee = 38, + Tedee = 40, [EnumMember(Value = "honeywell_resideo")] - HoneywellResideo = 39, + HoneywellResideo = 41, [EnumMember(Value = "first_alert")] - FirstAlert = 40, + FirstAlert = 42, [EnumMember(Value = "latch")] - Latch = 41, + Latch = 43, [EnumMember(Value = "akiles")] - Akiles = 42, + Akiles = 44, [EnumMember(Value = "assa_abloy_vostio")] - AssaAbloyVostio = 43, + AssaAbloyVostio = 45, [EnumMember(Value = "assa_abloy_vostio_credential_service")] - AssaAbloyVostioCredentialService = 44, + AssaAbloyVostioCredentialService = 46, [EnumMember(Value = "tado")] - Tado = 45, + Tado = 47, [EnumMember(Value = "salto_space")] - SaltoSpace = 46, + SaltoSpace = 48, [EnumMember(Value = "sensi")] - Sensi = 47, + Sensi = 49, [EnumMember(Value = "keynest")] - Keynest = 48, + Keynest = 50, [EnumMember(Value = "korelock")] - Korelock = 49, + Korelock = 51, [EnumMember(Value = "keyincode")] - Keyincode = 50, + Keyincode = 52, [EnumMember(Value = "dormakaba_ambiance")] - DormakabaAmbiance = 51, + DormakabaAmbiance = 53, [EnumMember(Value = "ultraloq")] - Ultraloq = 52, + Ultraloq = 54, [EnumMember(Value = "yacan")] - Yacan = 53, + Yacan = 55, [EnumMember(Value = "dusaw")] - Dusaw = 54, + Dusaw = 56, [EnumMember(Value = "sifely")] - Sifely = 55, + Sifely = 57, [EnumMember(Value = "thirty_three_lock")] - ThirtyThreeLock = 56, + ThirtyThreeLock = 58, [EnumMember(Value = "ring")] - Ring = 57, + Ring = 59, [EnumMember(Value = "tapo")] - Tapo = 58, + Tapo = 60, [EnumMember(Value = "arlo")] - Arlo = 59, + Arlo = 61, [EnumMember(Value = "reolink")] - Reolink = 60, + Reolink = 62, [EnumMember(Value = "unifi_protect")] - UnifiProtect = 61, + UnifiProtect = 63, + + [EnumMember(Value = "yale_connect")] + YaleConnect = 64, [EnumMember(Value = "ical")] - Ical = 62, + Ical = 65, [EnumMember(Value = "lodgify")] - Lodgify = 63, + Lodgify = 66, [EnumMember(Value = "hostaway")] - Hostaway = 64, + Hostaway = 67, [EnumMember(Value = "guesty")] - Guesty = 65, + Guesty = 68, [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 66, + AcuityScheduling = 69, [EnumMember(Value = "omnitec")] - Omnitec = 67, + Omnitec = 70, [EnumMember(Value = "kisi")] - Kisi = 68, + Kisi = 71, [EnumMember(Value = "aqara")] - Aqara = 69, + Aqara = 72, [EnumMember(Value = "eufy")] - Eufy = 70, + Eufy = 73, [EnumMember(Value = "sonos")] - Sonos = 71, + Sonos = 74, } /// @@ -383,7 +392,7 @@ public enum ProviderCategoriesEnum public bool? CanSimulateRemoval { get; init; } /// - /// Indicates whether the camera supports streaming live video through a camera live view session. + /// Indicates whether the camera can stream live video through a camera live view session. `false` while the camera is offline. /// [JsonPropertyName("can_stream_live_video")] public bool? CanStreamLiveVideo { get; init; } diff --git a/src/Seam/Models/UnmanagedDevice.cs b/src/Seam/Models/UnmanagedDevice.cs index b0657f5..1c911ae 100644 --- a/src/Seam/Models/UnmanagedDevice.cs +++ b/src/Seam/Models/UnmanagedDevice.cs @@ -43,7 +43,7 @@ public enum CapabilitiesSupportedEnum } /// - /// Type of the device. + /// Type of the device. The `august_lock` and `yale_lock` values are deprecated. Use `yale_access_lock` in place of `august_lock`, and `yale_access_lock` or `yale_home_lock` in place of `yale_lock`. /// [JsonConverter(typeof(SeamStringEnumConverter))] public enum DeviceTypeEnum @@ -102,101 +102,110 @@ public enum DeviceTypeEnum [EnumMember(Value = "yale_lock")] YaleLock = 17, + [EnumMember(Value = "yale_access_lock")] + YaleAccessLock = 18, + + [EnumMember(Value = "yale_home_lock")] + YaleHomeLock = 19, + + [EnumMember(Value = "yale_connect_lock")] + YaleConnectLock = 20, + [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, + TwoNIntercom = 21, [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, + ControlbywebDevice = 22, [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, + TtlockLock = 23, [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, + IgloohomeLock = 24, [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, + FourSuitesDoor = 25, [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, + DormakabaOracodeDoor = 26, [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, + TedeeLock = 27, [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, + AkilesLock = 28, [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, + UltraloqLock = 29, [EnumMember(Value = "yacan_lock")] - YacanLock = 27, + YacanLock = 30, [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, + KeyincodeLock = 31, [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, + OmnitecLock = 32, [EnumMember(Value = "kisi_lock")] - KisiLock = 30, + KisiLock = 33, [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, + AqaraLock = 34, [EnumMember(Value = "eufy_lock")] - EufyLock = 32, + EufyLock = 35, [EnumMember(Value = "keynest_key")] - KeynestKey = 33, + KeynestKey = 36, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 34, + NoiseawareActivityZone = 37, [EnumMember(Value = "minut_sensor")] - MinutSensor = 35, + MinutSensor = 38, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 36, + EcobeeThermostat = 39, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 37, + NestThermostat = 40, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 38, + HoneywellResideoThermostat = 41, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 39, + TadoThermostat = 42, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 40, + SensiThermostat = 43, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 41, + SmartthingsThermostat = 44, [EnumMember(Value = "ios_phone")] - IosPhone = 42, + IosPhone = 45, [EnumMember(Value = "android_phone")] - AndroidPhone = 43, + AndroidPhone = 46, [EnumMember(Value = "ring_camera")] - RingCamera = 44, + RingCamera = 47, [EnumMember(Value = "tapo_camera")] - TapoCamera = 45, + TapoCamera = 48, [EnumMember(Value = "arlo_camera")] - ArloCamera = 46, + ArloCamera = 49, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 47, + ReolinkCamera = 50, [EnumMember(Value = "unifi_protect_camera")] - UnifiProtectCamera = 48, + UnifiProtectCamera = 51, [EnumMember(Value = "sonos_speaker")] - SonosSpeaker = 49, + SonosSpeaker = 52, } [JsonConverter(typeof(SeamUnionConverter))] @@ -923,7 +932,7 @@ public sealed record UnmanagedDeviceWarningsUnrecognized public bool? CanSimulateRemoval { get; init; } /// - /// Indicates whether the camera supports streaming live video through a camera live view session. + /// Indicates whether the camera can stream live video through a camera live view session. `false` while the camera is offline. /// [JsonPropertyName("can_stream_live_video")] public bool? CanStreamLiveVideo { get; init; } @@ -972,7 +981,7 @@ public sealed record UnmanagedDeviceWarningsUnrecognized public string DeviceId { get; init; } = default!; /// - /// Type of the device. + /// Type of the device. The `august_lock` and `yale_lock` values are deprecated. Use `yale_access_lock` in place of `august_lock`, and `yale_access_lock` or `yale_home_lock` in place of `yale_lock`. /// [JsonPropertyName("device_type")] public UnmanagedDevice.DeviceTypeEnum DeviceType { get; init; } = default!; diff --git a/src/Seam/Routes/ClientSessions.cs b/src/Seam/Routes/ClientSessions.cs index 6ca96f7..bc6fe46 100644 --- a/src/Seam/Routes/ClientSessions.cs +++ b/src/Seam/Routes/ClientSessions.cs @@ -349,6 +349,24 @@ public sealed record ListRequest [JsonPropertyName("connect_webview_id")] public Optional ConnectWebviewId { get; init; } + /// + /// Customer key for which you want to list client sessions. + /// + [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; } + /// /// Your user ID for the user by which you want to filter client sessions. /// @@ -375,6 +393,12 @@ public sealed record ListResponse /// [JsonPropertyName("client_sessions")] public List? ClientSessions { get; init; } + + /// + /// The pagination metadata for the page of results. + /// + [JsonPropertyName("pagination")] + public Pagination? Pagination { get; init; } } /// @@ -397,6 +421,44 @@ public async Task> ListAsync( return response.Read(r => r.ClientSessions); } + /// Fetches one page of /client_sessions/list with its pagination metadata. + public async Task> ListPageAsync( + ListRequest? request = null, + CancellationToken cancellationToken = default + ) + { + var response = await _transport + .SendAsync( + HttpMethod.Get, + "/client_sessions/list", + request, + "client_sessions", + cancellationToken + ) + .ConfigureAwait(false); + return new SeamPage( + response.Read(r => r.ClientSessions), + response.Read("pagination", r => r.Pagination) + ); + } + + /// Creates a paginator over /client_sessions/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 Revoke a Client Session. /// diff --git a/src/Seam/Routes/ConnectWebviews.cs b/src/Seam/Routes/ConnectWebviews.cs index 20ca79a..c8e2015 100644 --- a/src/Seam/Routes/ConnectWebviews.cs +++ b/src/Seam/Routes/ConnectWebviews.cs @@ -100,197 +100,203 @@ public enum AcceptedProvidersEnum [EnumMember(Value = "yale")] Yale = 11, + [EnumMember(Value = "yale_access")] + YaleAccess = 12, + + [EnumMember(Value = "yale_home")] + YaleHome = 13, + [EnumMember(Value = "genie")] - Genie = 12, + Genie = 14, [EnumMember(Value = "doorking")] - Doorking = 13, + Doorking = 15, [EnumMember(Value = "salto")] - Salto = 14, + Salto = 16, [EnumMember(Value = "salto_ks")] - SaltoKs = 15, + SaltoKs = 17, [EnumMember(Value = "salto_ks_accept")] - SaltoKsAccept = 16, + SaltoKsAccept = 18, [EnumMember(Value = "lockly")] - Lockly = 17, + Lockly = 19, [EnumMember(Value = "ttlock")] - Ttlock = 18, + Ttlock = 20, [EnumMember(Value = "linear")] - Linear = 19, + Linear = 21, [EnumMember(Value = "noiseaware")] - Noiseaware = 20, + Noiseaware = 22, [EnumMember(Value = "nuki")] - Nuki = 21, + Nuki = 23, [EnumMember(Value = "igloo")] - Igloo = 22, + Igloo = 24, [EnumMember(Value = "kwikset")] - Kwikset = 23, + Kwikset = 25, [EnumMember(Value = "minut")] - Minut = 24, + Minut = 26, [EnumMember(Value = "my_2n")] - My_2n = 25, + My_2n = 27, [EnumMember(Value = "controlbyweb")] - Controlbyweb = 26, + Controlbyweb = 28, [EnumMember(Value = "nest")] - Nest = 27, + Nest = 29, [EnumMember(Value = "igloohome")] - Igloohome = 28, + Igloohome = 30, [EnumMember(Value = "ecobee")] - Ecobee = 29, + Ecobee = 31, [EnumMember(Value = "four_suites")] - FourSuites = 30, + FourSuites = 32, [EnumMember(Value = "dormakaba_oracode")] - DormakabaOracode = 31, + DormakabaOracode = 33, [EnumMember(Value = "dormakaba_oracode_iho")] - DormakabaOracodeIho = 32, + DormakabaOracodeIho = 34, [EnumMember(Value = "pti")] - Pti = 33, + Pti = 35, [EnumMember(Value = "wyze")] - Wyze = 34, + Wyze = 36, [EnumMember(Value = "seam_passport")] - SeamPassport = 35, + SeamPassport = 37, [EnumMember(Value = "visionline")] - Visionline = 36, + Visionline = 38, [EnumMember(Value = "assa_abloy_credential_service")] - AssaAbloyCredentialService = 37, + AssaAbloyCredentialService = 39, [EnumMember(Value = "tedee")] - Tedee = 38, + Tedee = 40, [EnumMember(Value = "honeywell_resideo")] - HoneywellResideo = 39, + HoneywellResideo = 41, [EnumMember(Value = "first_alert")] - FirstAlert = 40, + FirstAlert = 42, [EnumMember(Value = "latch")] - Latch = 41, + Latch = 43, [EnumMember(Value = "akiles")] - Akiles = 42, + Akiles = 44, [EnumMember(Value = "assa_abloy_vostio")] - AssaAbloyVostio = 43, + AssaAbloyVostio = 45, [EnumMember(Value = "assa_abloy_vostio_credential_service")] - AssaAbloyVostioCredentialService = 44, + AssaAbloyVostioCredentialService = 46, [EnumMember(Value = "tado")] - Tado = 45, + Tado = 47, [EnumMember(Value = "salto_space")] - SaltoSpace = 46, + SaltoSpace = 48, [EnumMember(Value = "sensi")] - Sensi = 47, + Sensi = 49, [EnumMember(Value = "keynest")] - Keynest = 48, + Keynest = 50, [EnumMember(Value = "korelock")] - Korelock = 49, + Korelock = 51, [EnumMember(Value = "keyincode")] - Keyincode = 50, + Keyincode = 52, [EnumMember(Value = "dormakaba_ambiance")] - DormakabaAmbiance = 51, + DormakabaAmbiance = 53, [EnumMember(Value = "ultraloq")] - Ultraloq = 52, + Ultraloq = 54, [EnumMember(Value = "yacan")] - Yacan = 53, + Yacan = 55, [EnumMember(Value = "dusaw")] - Dusaw = 54, + Dusaw = 56, [EnumMember(Value = "sifely")] - Sifely = 55, + Sifely = 57, [EnumMember(Value = "thirty_three_lock")] - ThirtyThreeLock = 56, + ThirtyThreeLock = 58, [EnumMember(Value = "ring")] - Ring = 57, + Ring = 59, [EnumMember(Value = "tapo")] - Tapo = 58, + Tapo = 60, [EnumMember(Value = "arlo")] - Arlo = 59, + Arlo = 61, [EnumMember(Value = "reolink")] - Reolink = 60, + Reolink = 62, [EnumMember(Value = "unifi_protect")] - UnifiProtect = 61, + UnifiProtect = 63, + + [EnumMember(Value = "yale_connect")] + YaleConnect = 64, [EnumMember(Value = "ical")] - Ical = 62, + Ical = 65, [EnumMember(Value = "lodgify")] - Lodgify = 63, + Lodgify = 66, [EnumMember(Value = "hostaway")] - Hostaway = 64, + Hostaway = 67, [EnumMember(Value = "guesty")] - Guesty = 65, + Guesty = 68, [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 66, + AcuityScheduling = 69, [EnumMember(Value = "omnitec")] - Omnitec = 67, + Omnitec = 70, [EnumMember(Value = "kisi")] - Kisi = 68, + Kisi = 71, [EnumMember(Value = "aqara")] - Aqara = 69, + Aqara = 72, [EnumMember(Value = "eufy")] - Eufy = 70, + Eufy = 73, [EnumMember(Value = "sonos")] - Sonos = 71, - - [EnumMember(Value = "yale_access")] - YaleAccess = 72, + Sonos = 74, [EnumMember(Value = "hid_cm")] - HidCm = 73, + HidCm = 75, [EnumMember(Value = "google_nest")] - GoogleNest = 74, + GoogleNest = 76, [EnumMember(Value = "slack")] - Slack = 75, + Slack = 77, } /// diff --git a/src/Seam/Routes/Customers.cs b/src/Seam/Routes/Customers.cs index 225a09f..d549dfb 100644 --- a/src/Seam/Routes/Customers.cs +++ b/src/Seam/Routes/Customers.cs @@ -852,7 +852,7 @@ public sealed record CreatePortalRequestCustomerDataReservationsSubReservations public string? StartsAt { get; init; } /// - /// Your identifier for the sub-reservation. Must be unique within its reservation. + /// Your identifier for the sub-reservation. Must be unique across all your reservations and sub-reservations, and stay with the same reservation. /// [JsonPropertyName("sub_reservation_key")] public string? SubReservationKey { get; init; } @@ -2404,7 +2404,7 @@ public sealed record PushDataRequestReservationsSubReservations public string? StartsAt { get; init; } /// - /// Your identifier for the sub-reservation. Must be unique within its reservation. + /// Your identifier for the sub-reservation. Must be unique across all your reservations and sub-reservations, and stay with the same reservation. /// [JsonPropertyName("sub_reservation_key")] public string? SubReservationKey { get; init; } diff --git a/src/Seam/Routes/Devices.cs b/src/Seam/Routes/Devices.cs index 09a5d35..7311ae9 100644 --- a/src/Seam/Routes/Devices.cs +++ b/src/Seam/Routes/Devices.cs @@ -153,101 +153,110 @@ public enum DeviceTypeEnum [EnumMember(Value = "yale_lock")] YaleLock = 17, + [EnumMember(Value = "yale_access_lock")] + YaleAccessLock = 18, + + [EnumMember(Value = "yale_home_lock")] + YaleHomeLock = 19, + + [EnumMember(Value = "yale_connect_lock")] + YaleConnectLock = 20, + [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, + TwoNIntercom = 21, [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, + ControlbywebDevice = 22, [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, + TtlockLock = 23, [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, + IgloohomeLock = 24, [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, + FourSuitesDoor = 25, [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, + DormakabaOracodeDoor = 26, [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, + TedeeLock = 27, [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, + AkilesLock = 28, [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, + UltraloqLock = 29, [EnumMember(Value = "yacan_lock")] - YacanLock = 27, + YacanLock = 30, [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, + KeyincodeLock = 31, [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, + OmnitecLock = 32, [EnumMember(Value = "kisi_lock")] - KisiLock = 30, + KisiLock = 33, [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, + AqaraLock = 34, [EnumMember(Value = "eufy_lock")] - EufyLock = 32, + EufyLock = 35, [EnumMember(Value = "keynest_key")] - KeynestKey = 33, + KeynestKey = 36, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 34, + NoiseawareActivityZone = 37, [EnumMember(Value = "minut_sensor")] - MinutSensor = 35, + MinutSensor = 38, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 36, + EcobeeThermostat = 39, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 37, + NestThermostat = 40, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 38, + HoneywellResideoThermostat = 41, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 39, + TadoThermostat = 42, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 40, + SensiThermostat = 43, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 41, + SmartthingsThermostat = 44, [EnumMember(Value = "ios_phone")] - IosPhone = 42, + IosPhone = 45, [EnumMember(Value = "android_phone")] - AndroidPhone = 43, + AndroidPhone = 46, [EnumMember(Value = "ring_camera")] - RingCamera = 44, + RingCamera = 47, [EnumMember(Value = "tapo_camera")] - TapoCamera = 45, + TapoCamera = 48, [EnumMember(Value = "arlo_camera")] - ArloCamera = 46, + ArloCamera = 49, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 47, + ReolinkCamera = 50, [EnumMember(Value = "unifi_protect_camera")] - UnifiProtectCamera = 48, + UnifiProtectCamera = 51, [EnumMember(Value = "sonos_speaker")] - SonosSpeaker = 49, + SonosSpeaker = 52, } /// @@ -310,101 +319,110 @@ public enum DeviceTypesEnum [EnumMember(Value = "yale_lock")] YaleLock = 17, + [EnumMember(Value = "yale_access_lock")] + YaleAccessLock = 18, + + [EnumMember(Value = "yale_home_lock")] + YaleHomeLock = 19, + + [EnumMember(Value = "yale_connect_lock")] + YaleConnectLock = 20, + [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, + TwoNIntercom = 21, [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, + ControlbywebDevice = 22, [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, + TtlockLock = 23, [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, + IgloohomeLock = 24, [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, + FourSuitesDoor = 25, [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, + DormakabaOracodeDoor = 26, [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, + TedeeLock = 27, [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, + AkilesLock = 28, [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, + UltraloqLock = 29, [EnumMember(Value = "yacan_lock")] - YacanLock = 27, + YacanLock = 30, [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, + KeyincodeLock = 31, [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, + OmnitecLock = 32, [EnumMember(Value = "kisi_lock")] - KisiLock = 30, + KisiLock = 33, [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, + AqaraLock = 34, [EnumMember(Value = "eufy_lock")] - EufyLock = 32, + EufyLock = 35, [EnumMember(Value = "keynest_key")] - KeynestKey = 33, + KeynestKey = 36, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 34, + NoiseawareActivityZone = 37, [EnumMember(Value = "minut_sensor")] - MinutSensor = 35, + MinutSensor = 38, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 36, + EcobeeThermostat = 39, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 37, + NestThermostat = 40, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 38, + HoneywellResideoThermostat = 41, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 39, + TadoThermostat = 42, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 40, + SensiThermostat = 43, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 41, + SmartthingsThermostat = 44, [EnumMember(Value = "ios_phone")] - IosPhone = 42, + IosPhone = 45, [EnumMember(Value = "android_phone")] - AndroidPhone = 43, + AndroidPhone = 46, [EnumMember(Value = "ring_camera")] - RingCamera = 44, + RingCamera = 47, [EnumMember(Value = "tapo_camera")] - TapoCamera = 45, + TapoCamera = 48, [EnumMember(Value = "arlo_camera")] - ArloCamera = 46, + ArloCamera = 49, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 47, + ReolinkCamera = 50, [EnumMember(Value = "unifi_protect_camera")] - UnifiProtectCamera = 48, + UnifiProtectCamera = 51, [EnumMember(Value = "sonos_speaker")] - SonosSpeaker = 49, + SonosSpeaker = 52, } /// @@ -566,35 +584,38 @@ public enum ManufacturerEnum [EnumMember(Value = "unifi_protect")] UnifiProtect = 50, + [EnumMember(Value = "yale_connect")] + YaleConnect = 51, + [EnumMember(Value = "ical")] - Ical = 51, + Ical = 52, [EnumMember(Value = "lodgify")] - Lodgify = 52, + Lodgify = 53, [EnumMember(Value = "hostaway")] - Hostaway = 53, + Hostaway = 54, [EnumMember(Value = "guesty")] - Guesty = 54, + Guesty = 55, [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 55, + AcuityScheduling = 56, [EnumMember(Value = "omnitec")] - Omnitec = 56, + Omnitec = 57, [EnumMember(Value = "kisi")] - Kisi = 57, + Kisi = 58, [EnumMember(Value = "slack")] - Slack = 58, + Slack = 59, [EnumMember(Value = "yacan")] - Yacan = 59, + Yacan = 60, [EnumMember(Value = "sonos")] - Sonos = 60, + Sonos = 61, } /// diff --git a/src/Seam/Routes/DevicesUnmanaged.cs b/src/Seam/Routes/DevicesUnmanaged.cs index 421d13a..21b2ccd 100644 --- a/src/Seam/Routes/DevicesUnmanaged.cs +++ b/src/Seam/Routes/DevicesUnmanaged.cs @@ -152,101 +152,110 @@ public enum DeviceTypeEnum [EnumMember(Value = "yale_lock")] YaleLock = 17, + [EnumMember(Value = "yale_access_lock")] + YaleAccessLock = 18, + + [EnumMember(Value = "yale_home_lock")] + YaleHomeLock = 19, + + [EnumMember(Value = "yale_connect_lock")] + YaleConnectLock = 20, + [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, + TwoNIntercom = 21, [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, + ControlbywebDevice = 22, [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, + TtlockLock = 23, [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, + IgloohomeLock = 24, [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, + FourSuitesDoor = 25, [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, + DormakabaOracodeDoor = 26, [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, + TedeeLock = 27, [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, + AkilesLock = 28, [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, + UltraloqLock = 29, [EnumMember(Value = "yacan_lock")] - YacanLock = 27, + YacanLock = 30, [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, + KeyincodeLock = 31, [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, + OmnitecLock = 32, [EnumMember(Value = "kisi_lock")] - KisiLock = 30, + KisiLock = 33, [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, + AqaraLock = 34, [EnumMember(Value = "eufy_lock")] - EufyLock = 32, + EufyLock = 35, [EnumMember(Value = "keynest_key")] - KeynestKey = 33, + KeynestKey = 36, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 34, + NoiseawareActivityZone = 37, [EnumMember(Value = "minut_sensor")] - MinutSensor = 35, + MinutSensor = 38, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 36, + EcobeeThermostat = 39, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 37, + NestThermostat = 40, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 38, + HoneywellResideoThermostat = 41, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 39, + TadoThermostat = 42, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 40, + SensiThermostat = 43, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 41, + SmartthingsThermostat = 44, [EnumMember(Value = "ios_phone")] - IosPhone = 42, + IosPhone = 45, [EnumMember(Value = "android_phone")] - AndroidPhone = 43, + AndroidPhone = 46, [EnumMember(Value = "ring_camera")] - RingCamera = 44, + RingCamera = 47, [EnumMember(Value = "tapo_camera")] - TapoCamera = 45, + TapoCamera = 48, [EnumMember(Value = "arlo_camera")] - ArloCamera = 46, + ArloCamera = 49, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 47, + ReolinkCamera = 50, [EnumMember(Value = "unifi_protect_camera")] - UnifiProtectCamera = 48, + UnifiProtectCamera = 51, [EnumMember(Value = "sonos_speaker")] - SonosSpeaker = 49, + SonosSpeaker = 52, } /// @@ -309,101 +318,110 @@ public enum DeviceTypesEnum [EnumMember(Value = "yale_lock")] YaleLock = 17, + [EnumMember(Value = "yale_access_lock")] + YaleAccessLock = 18, + + [EnumMember(Value = "yale_home_lock")] + YaleHomeLock = 19, + + [EnumMember(Value = "yale_connect_lock")] + YaleConnectLock = 20, + [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, + TwoNIntercom = 21, [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, + ControlbywebDevice = 22, [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, + TtlockLock = 23, [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, + IgloohomeLock = 24, [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, + FourSuitesDoor = 25, [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, + DormakabaOracodeDoor = 26, [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, + TedeeLock = 27, [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, + AkilesLock = 28, [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, + UltraloqLock = 29, [EnumMember(Value = "yacan_lock")] - YacanLock = 27, + YacanLock = 30, [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, + KeyincodeLock = 31, [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, + OmnitecLock = 32, [EnumMember(Value = "kisi_lock")] - KisiLock = 30, + KisiLock = 33, [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, + AqaraLock = 34, [EnumMember(Value = "eufy_lock")] - EufyLock = 32, + EufyLock = 35, [EnumMember(Value = "keynest_key")] - KeynestKey = 33, + KeynestKey = 36, [EnumMember(Value = "noiseaware_activity_zone")] - NoiseawareActivityZone = 34, + NoiseawareActivityZone = 37, [EnumMember(Value = "minut_sensor")] - MinutSensor = 35, + MinutSensor = 38, [EnumMember(Value = "ecobee_thermostat")] - EcobeeThermostat = 36, + EcobeeThermostat = 39, [EnumMember(Value = "nest_thermostat")] - NestThermostat = 37, + NestThermostat = 40, [EnumMember(Value = "honeywell_resideo_thermostat")] - HoneywellResideoThermostat = 38, + HoneywellResideoThermostat = 41, [EnumMember(Value = "tado_thermostat")] - TadoThermostat = 39, + TadoThermostat = 42, [EnumMember(Value = "sensi_thermostat")] - SensiThermostat = 40, + SensiThermostat = 43, [EnumMember(Value = "smartthings_thermostat")] - SmartthingsThermostat = 41, + SmartthingsThermostat = 44, [EnumMember(Value = "ios_phone")] - IosPhone = 42, + IosPhone = 45, [EnumMember(Value = "android_phone")] - AndroidPhone = 43, + AndroidPhone = 46, [EnumMember(Value = "ring_camera")] - RingCamera = 44, + RingCamera = 47, [EnumMember(Value = "tapo_camera")] - TapoCamera = 45, + TapoCamera = 48, [EnumMember(Value = "arlo_camera")] - ArloCamera = 46, + ArloCamera = 49, [EnumMember(Value = "reolink_camera")] - ReolinkCamera = 47, + ReolinkCamera = 50, [EnumMember(Value = "unifi_protect_camera")] - UnifiProtectCamera = 48, + UnifiProtectCamera = 51, [EnumMember(Value = "sonos_speaker")] - SonosSpeaker = 49, + SonosSpeaker = 52, } /// @@ -565,35 +583,38 @@ public enum ManufacturerEnum [EnumMember(Value = "unifi_protect")] UnifiProtect = 50, + [EnumMember(Value = "yale_connect")] + YaleConnect = 51, + [EnumMember(Value = "ical")] - Ical = 51, + Ical = 52, [EnumMember(Value = "lodgify")] - Lodgify = 52, + Lodgify = 53, [EnumMember(Value = "hostaway")] - Hostaway = 53, + Hostaway = 54, [EnumMember(Value = "guesty")] - Guesty = 54, + Guesty = 55, [EnumMember(Value = "acuity_scheduling")] - AcuityScheduling = 55, + AcuityScheduling = 56, [EnumMember(Value = "omnitec")] - Omnitec = 56, + Omnitec = 57, [EnumMember(Value = "kisi")] - Kisi = 57, + Kisi = 58, [EnumMember(Value = "slack")] - Slack = 58, + Slack = 59, [EnumMember(Value = "yacan")] - Yacan = 59, + Yacan = 60, [EnumMember(Value = "sonos")] - Sonos = 60, + Sonos = 61, } /// diff --git a/src/Seam/Routes/Locks.cs b/src/Seam/Routes/Locks.cs index 36327b6..2156b5b 100644 --- a/src/Seam/Routes/Locks.cs +++ b/src/Seam/Routes/Locks.cs @@ -212,50 +212,59 @@ public enum DeviceTypeEnum [EnumMember(Value = "yale_lock")] YaleLock = 17, + [EnumMember(Value = "yale_access_lock")] + YaleAccessLock = 18, + + [EnumMember(Value = "yale_home_lock")] + YaleHomeLock = 19, + + [EnumMember(Value = "yale_connect_lock")] + YaleConnectLock = 20, + [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, + TwoNIntercom = 21, [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, + ControlbywebDevice = 22, [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, + TtlockLock = 23, [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, + IgloohomeLock = 24, [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, + FourSuitesDoor = 25, [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, + DormakabaOracodeDoor = 26, [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, + TedeeLock = 27, [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, + AkilesLock = 28, [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, + UltraloqLock = 29, [EnumMember(Value = "yacan_lock")] - YacanLock = 27, + YacanLock = 30, [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, + KeyincodeLock = 31, [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, + OmnitecLock = 32, [EnumMember(Value = "kisi_lock")] - KisiLock = 30, + KisiLock = 33, [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, + AqaraLock = 34, [EnumMember(Value = "eufy_lock")] - EufyLock = 32, + EufyLock = 35, } /// @@ -318,50 +327,59 @@ public enum DeviceTypesEnum [EnumMember(Value = "yale_lock")] YaleLock = 17, + [EnumMember(Value = "yale_access_lock")] + YaleAccessLock = 18, + + [EnumMember(Value = "yale_home_lock")] + YaleHomeLock = 19, + + [EnumMember(Value = "yale_connect_lock")] + YaleConnectLock = 20, + [EnumMember(Value = "two_n_intercom")] - TwoNIntercom = 18, + TwoNIntercom = 21, [EnumMember(Value = "controlbyweb_device")] - ControlbywebDevice = 19, + ControlbywebDevice = 22, [EnumMember(Value = "ttlock_lock")] - TtlockLock = 20, + TtlockLock = 23, [EnumMember(Value = "igloohome_lock")] - IgloohomeLock = 21, + IgloohomeLock = 24, [EnumMember(Value = "four_suites_door")] - FourSuitesDoor = 22, + FourSuitesDoor = 25, [EnumMember(Value = "dormakaba_oracode_door")] - DormakabaOracodeDoor = 23, + DormakabaOracodeDoor = 26, [EnumMember(Value = "tedee_lock")] - TedeeLock = 24, + TedeeLock = 27, [EnumMember(Value = "akiles_lock")] - AkilesLock = 25, + AkilesLock = 28, [EnumMember(Value = "ultraloq_lock")] - UltraloqLock = 26, + UltraloqLock = 29, [EnumMember(Value = "yacan_lock")] - YacanLock = 27, + YacanLock = 30, [EnumMember(Value = "keyincode_lock")] - KeyincodeLock = 28, + KeyincodeLock = 31, [EnumMember(Value = "omnitec_lock")] - OmnitecLock = 29, + OmnitecLock = 32, [EnumMember(Value = "kisi_lock")] - KisiLock = 30, + KisiLock = 33, [EnumMember(Value = "aqara_lock")] - AqaraLock = 31, + AqaraLock = 34, [EnumMember(Value = "eufy_lock")] - EufyLock = 32, + EufyLock = 35, } /// @@ -469,14 +487,17 @@ public enum ManufacturerEnum [EnumMember(Value = "ultraloq")] Ultraloq = 32, + [EnumMember(Value = "yale_connect")] + YaleConnect = 33, + [EnumMember(Value = "omnitec")] - Omnitec = 33, + Omnitec = 34, [EnumMember(Value = "kisi")] - Kisi = 34, + Kisi = 35, [EnumMember(Value = "yacan")] - Yacan = 35, + Yacan = 36, } /// From d187ab9e5e8ac1fc32a8a18508b36be3f6202029 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 5 Nov 2026 16:08:04 -0800 Subject: [PATCH 6/7] Unit test RequireAtLeastOne --- codegen/layouts/partials/model-class.hbs | 8 +- src/Seam/Http/RequestParameters.cs | 16 ++++ .../PaginatedRequestValidationTests.cs | 68 +++++++++------ test/Seam.Test/RequiredParametersTests.cs | 86 +++---------------- 4 files changed, 74 insertions(+), 104 deletions(-) create mode 100644 src/Seam/Http/RequestParameters.cs diff --git a/codegen/layouts/partials/model-class.hbs b/codegen/layouts/partials/model-class.hbs index acdded9..e377fe8 100644 --- a/codegen/layouts/partials/model-class.hbs +++ b/codegen/layouts/partials/model-class.hbs @@ -25,12 +25,10 @@ public JsonElement RawJson { get; set; } internal void Validate() { -if ({{#each requireAnyOf.conditions}}{{this}}{{#unless @last}} && {{/unless}}{{/each}}) -{ -throw new ArgumentException( -"At least one parameter is required for {{requireAnyOf.path}}" +RequestParameters.RequireAtLeastOne( +"{{requireAnyOf.path}}", +!({{#each requireAnyOf.conditions}}{{this}}{{#unless @last}} && {{/unless}}{{/each}}) ); } -} {{/if}} } diff --git a/src/Seam/Http/RequestParameters.cs b/src/Seam/Http/RequestParameters.cs new file mode 100644 index 0000000..e1be9df --- /dev/null +++ b/src/Seam/Http/RequestParameters.cs @@ -0,0 +1,16 @@ +using System; +using System.Linq; + +namespace Seam.Http +{ + internal static class RequestParameters + { + internal static void RequireAtLeastOne(string path, params bool[] parametersGiven) + { + if (parametersGiven.Any(parameterGiven => parameterGiven)) + return; + + throw new ArgumentException($"At least one parameter is required for {path}"); + } + } +} diff --git a/test/Seam.Test/PaginatedRequestValidationTests.cs b/test/Seam.Test/PaginatedRequestValidationTests.cs index 1df3621..39a1526 100644 --- a/test/Seam.Test/PaginatedRequestValidationTests.cs +++ b/test/Seam.Test/PaginatedRequestValidationTests.cs @@ -1,55 +1,71 @@ namespace Seam.Test; -using Seam.Test.Support; +using Seam.Http; public class PaginatedRequestValidationTests { - private static SeamClient CreateSeam(RecordingHandler handler) + private static (SeamPaginator Paginator, Func FetchCount) CreatePaginator() { - return new SeamClient( - new SeamClientOptions + var fetchCount = 0; + var paginator = new SeamPaginator( + (_, _) => { - ApiKey = "seam_apikey1_token", - Endpoint = "https://example.com", - HttpMessageHandler = handler, - MaxRetries = 0, + RequestParameters.RequireAtLeastOne("/test/list", false); + fetchCount++; + return Task.FromResult( + new SeamPage([], new Pagination { HasNextPage = false }) + ); } ); + + return (paginator, () => fetchCount); } - private static async Task AssertValidatesBeforeSendingAsync(Func request) + private static async Task AssertValidatesBeforeFetchingAsync( + Func, Task> request + ) { - var handler = new RecordingHandler(); - using var seam = CreateSeam(handler); + var (paginator, fetchCount) = CreatePaginator(); - var exception = await Assert.ThrowsAsync(() => request(seam)); + var exception = await Assert.ThrowsAsync(() => request(paginator)); - Assert.Equal( - "At least one parameter is required for /access_codes/list", - exception.Message - ); - Assert.Equal(0, handler.AttemptCount); + Assert.Equal("At least one parameter is required for /test/list", exception.Message); + Assert.Equal(0, fetchCount()); } [Fact] - public Task PageMethodValidatesTheRequest() + public Task FirstPageValidatesTheRequest() { - return AssertValidatesBeforeSendingAsync(seam => seam.AccessCodes.ListPageAsync(new())); + return AssertValidatesBeforeFetchingAsync(paginator => paginator.FirstPageAsync()); } [Fact] - public Task FirstPageValidatesTheRequest() + public Task NextPageValidatesTheRequest() { - return AssertValidatesBeforeSendingAsync(seam => - seam.AccessCodes.ListPager(new()).FirstPageAsync() - ); + return AssertValidatesBeforeFetchingAsync(paginator => paginator.NextPageAsync("c1")); } [Fact] public Task FlattenToListValidatesTheRequest() { - return AssertValidatesBeforeSendingAsync(seam => - seam.AccessCodes.ListPager(new()).FlattenToListAsync() - ); + return AssertValidatesBeforeFetchingAsync(paginator => paginator.FlattenToListAsync()); + } + + [Fact] + public Task FlattenValidatesTheRequest() + { + return AssertValidatesBeforeFetchingAsync(async paginator => + { + await foreach (var _ in paginator.Flatten()) { } + }); + } + + [Fact] + public Task PagesValidatesTheRequest() + { + return AssertValidatesBeforeFetchingAsync(async paginator => + { + await foreach (var _ in paginator.Pages()) { } + }); } } diff --git a/test/Seam.Test/RequiredParametersTests.cs b/test/Seam.Test/RequiredParametersTests.cs index 021da7e..f288119 100644 --- a/test/Seam.Test/RequiredParametersTests.cs +++ b/test/Seam.Test/RequiredParametersTests.cs @@ -1,99 +1,39 @@ namespace Seam.Test; -using System.Net; using System.Reflection; -using Seam.Test.Support; +using Seam.Http; public class RequiredParametersTests { - private static SeamClient CreateSeam(RecordingHandler handler) + private static void AssertRequiresAParameter(params bool[] parametersGiven) { - return new SeamClient( - new SeamClientOptions - { - ApiKey = "seam_apikey1_token", - Endpoint = "https://example.com", - HttpMessageHandler = handler, - MaxRetries = 0, - } - ); - } - - private static async Task AssertRequiresAParameterAsync( - string path, - Func request - ) - { - var handler = new RecordingHandler(); - using var seam = CreateSeam(handler); - - var exception = await Assert.ThrowsAsync(() => request(seam)); - - Assert.Equal($"At least one parameter is required for {path}", exception.Message); - Assert.Equal(0, handler.AttemptCount); - } - - [Fact] - public Task AccessCodesListDoesNotCountLimit() - { - return AssertRequiresAParameterAsync( - "/access_codes/list", - seam => seam.AccessCodes.ListAsync(new() { Limit = 20 }) - ); - } - - [Fact] - public Task AccessCodesListDoesNotCountPageCursor() - { - return AssertRequiresAParameterAsync( - "/access_codes/list", - seam => seam.AccessCodes.ListAsync(new() { PageCursor = "c1" }) + var exception = Assert.Throws( + () => RequestParameters.RequireAtLeastOne("/test/list", parametersGiven) ); - } - [Fact] - public Task AccessMethodsListDoesNotCountLimitOrPageCursor() - { - return AssertRequiresAParameterAsync( - "/access_methods/list", - seam => seam.AccessMethods.ListAsync(new() { Limit = 20, PageCursor = "c1" }) - ); + Assert.Equal("At least one parameter is required for /test/list", exception.Message); } [Fact] - public Task EventsListDoesNotCountLimit() + public void EmptyRequestIsRejected() { - return AssertRequiresAParameterAsync( - "/events/list", - seam => seam.Events.ListAsync(new() { Limit = 20 }) - ); + AssertRequiresAParameter(false); } [Fact] - public Task DevicesGetRequiresAParameter() + public void PaginationParametersDoNotSatisfyTheRequirement() { - return AssertRequiresAParameterAsync("/devices/get", seam => seam.Devices.GetAsync(new())); + AssertRequiresAParameter(false); } [Fact] - public async Task AccessCodesListAcceptsAFilterWithALimit() + public void AFilterWithPaginationSatisfiesTheRequirement() { - var handler = new RecordingHandler().RespondWith( - HttpStatusCode.OK, - "{\"access_codes\":[]}" - ); - using var seam = CreateSeam(handler); - - var accessCodes = await seam.AccessCodes.ListAsync( - new() { DeviceId = "device1", Limit = 20 } - ); - - Assert.Empty(accessCodes); - Assert.Equal(1, handler.AttemptCount); + RequestParameters.RequireAtLeastOne("/test/list", true); } [Fact] - public void NoGuardIsSatisfiedByPaginationParametersAlone() + public void NoGeneratedGuardIsSatisfiedByPaginationParametersAlone() { var guardedRequests = typeof(SeamClient) .Assembly.GetTypes() @@ -141,6 +81,6 @@ public void NoGuardIsSatisfiedByPaginationParametersAlone() } } - Assert.True(checkedRequests >= 5); + Assert.True(checkedRequests > 0); } } From e5521456e9f135520f5ec13bfd2948fb220bd9b4 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Fri, 6 Nov 2026 00:08:56 +0000 Subject: [PATCH 7/7] ci: Generate code --- src/Seam/Routes/AccessCodes.cs | 10 ++- src/Seam/Routes/AccessCodesUnmanaged.cs | 10 ++- src/Seam/Routes/AccessGrants.cs | 52 +++++++------- src/Seam/Routes/AccessMethods.cs | 36 +++++----- src/Seam/Routes/AcsUsers.cs | 90 +++++++++++-------------- src/Seam/Routes/ClientSessions.cs | 24 +++---- src/Seam/Routes/ConnectedAccounts.cs | 10 ++- src/Seam/Routes/Devices.cs | 10 ++- src/Seam/Routes/DevicesUnmanaged.cs | 10 ++- src/Seam/Routes/Events.cs | 76 ++++++++++----------- src/Seam/Routes/InstantKeys.cs | 10 ++- src/Seam/Routes/Locks.cs | 10 ++- src/Seam/Routes/Spaces.cs | 20 +++--- src/Seam/Routes/UserIdentities.cs | 30 ++++----- 14 files changed, 173 insertions(+), 225 deletions(-) diff --git a/src/Seam/Routes/AccessCodes.cs b/src/Seam/Routes/AccessCodes.cs index 73f415c..bc9bed9 100644 --- a/src/Seam/Routes/AccessCodes.cs +++ b/src/Seam/Routes/AccessCodes.cs @@ -418,12 +418,10 @@ public sealed record GetRequest internal void Validate() { - if (AccessCodeId == null && Code == null && DeviceId == null) - { - throw new ArgumentException( - "At least one parameter is required for /access_codes/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/access_codes/get", + !(AccessCodeId == null && Code == null && DeviceId == null) + ); } } diff --git a/src/Seam/Routes/AccessCodesUnmanaged.cs b/src/Seam/Routes/AccessCodesUnmanaged.cs index c6d7b4d..c896886 100644 --- a/src/Seam/Routes/AccessCodesUnmanaged.cs +++ b/src/Seam/Routes/AccessCodesUnmanaged.cs @@ -132,12 +132,10 @@ public sealed record GetRequest internal void Validate() { - if (AccessCodeId == null && Code == null && DeviceId == null) - { - throw new ArgumentException( - "At least one parameter is required for /access_codes/unmanaged/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/access_codes/unmanaged/get", + !(AccessCodeId == null && Code == null && DeviceId == null) + ); } } diff --git a/src/Seam/Routes/AccessGrants.cs b/src/Seam/Routes/AccessGrants.cs index e06cd01..bfe9a02 100644 --- a/src/Seam/Routes/AccessGrants.cs +++ b/src/Seam/Routes/AccessGrants.cs @@ -277,12 +277,10 @@ public sealed record GetRequest internal void Validate() { - if (AccessGrantId == null && AccessGrantKey == null) - { - throw new ArgumentException( - "At least one parameter is required for /access_grants/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/access_grants/get", + !(AccessGrantId == null && AccessGrantKey == null) + ); } } @@ -403,17 +401,15 @@ public enum IncludeEnum 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" - ); - } + RequestParameters.RequireAtLeastOne( + "/access_grants/get_related", + !( + AccessGrantIds == null + && AccessGrantKeys == null + && Exclude == null + && Include == null + ) + ); } } @@ -735,18 +731,16 @@ public sealed record UpdateRequest 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" - ); - } + RequestParameters.RequireAtLeastOne( + "/access_grants/update", + !( + AccessGrantId == null + && AccessGrantKey == null + && !EndsAt.IsSet + && !Name.IsSet + && StartsAt == null + ) + ); } } diff --git a/src/Seam/Routes/AccessMethods.cs b/src/Seam/Routes/AccessMethods.cs index a9115a3..37885b7 100644 --- a/src/Seam/Routes/AccessMethods.cs +++ b/src/Seam/Routes/AccessMethods.cs @@ -109,12 +109,10 @@ public sealed record DeleteRequest internal void Validate() { - if (AccessGrantId == null && AccessMethodId == null && ReservationKey == null) - { - throw new ArgumentException( - "At least one parameter is required for /access_methods/delete" - ); - } + RequestParameters.RequireAtLeastOne( + "/access_methods/delete", + !(AccessGrantId == null && AccessMethodId == null && ReservationKey == null) + ); } } @@ -399,20 +397,18 @@ public sealed record ListRequest internal void Validate() { - if ( - AccessCodeId == null - && AccessGrantId == null - && AccessGrantKey == null - && AcsEntranceId == null - && CustomerKey == null - && DeviceId == null - && SpaceId == null - ) - { - throw new ArgumentException( - "At least one parameter is required for /access_methods/list" - ); - } + RequestParameters.RequireAtLeastOne( + "/access_methods/list", + !( + AccessCodeId == null + && AccessGrantId == null + && AccessGrantKey == null + && AcsEntranceId == null + && CustomerKey == null + && DeviceId == null + && SpaceId == null + ) + ); } } diff --git a/src/Seam/Routes/AcsUsers.cs b/src/Seam/Routes/AcsUsers.cs index 179c507..7b6714e 100644 --- a/src/Seam/Routes/AcsUsers.cs +++ b/src/Seam/Routes/AcsUsers.cs @@ -182,12 +182,10 @@ public sealed record DeleteRequest internal void Validate() { - if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) - { - throw new ArgumentException( - "At least one parameter is required for /acs/users/delete" - ); - } + RequestParameters.RequireAtLeastOne( + "/acs/users/delete", + !(AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + ); } } @@ -230,12 +228,10 @@ public sealed record GetRequest internal void Validate() { - if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) - { - throw new ArgumentException( - "At least one parameter is required for /acs/users/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/acs/users/get", + !(AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + ); } } @@ -421,12 +417,10 @@ public sealed record ListAccessibleEntrancesRequest 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" - ); - } + RequestParameters.RequireAtLeastOne( + "/acs/users/list_accessible_entrances", + !(AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + ); } } @@ -527,12 +521,10 @@ public sealed record RevokeAccessToAllEntrancesRequest 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" - ); - } + RequestParameters.RequireAtLeastOne( + "/acs/users/revoke_access_to_all_entrances", + !(AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + ); } } @@ -580,12 +572,10 @@ public sealed record SuspendRequest internal void Validate() { - if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) - { - throw new ArgumentException( - "At least one parameter is required for /acs/users/suspend" - ); - } + RequestParameters.RequireAtLeastOne( + "/acs/users/suspend", + !(AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + ); } } @@ -628,12 +618,10 @@ public sealed record UnsuspendRequest internal void Validate() { - if (AcsSystemId == null && AcsUserId == null && UserIdentityId == null) - { - throw new ArgumentException( - "At least one parameter is required for /acs/users/unsuspend" - ); - } + RequestParameters.RequireAtLeastOne( + "/acs/users/unsuspend", + !(AcsSystemId == null && AcsUserId == null && UserIdentityId == null) + ); } } @@ -710,22 +698,20 @@ public sealed record UpdateRequest 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" - ); - } + RequestParameters.RequireAtLeastOne( + "/acs/users/update", + !( + !AccessSchedule.IsSet + && AcsSystemId == null + && AcsUserId == null + && Email == null + && EmailAddress == null + && FullName == null + && HidAcsSystemId == null + && PhoneNumber == null + && UserIdentityId == null + ) + ); } } diff --git a/src/Seam/Routes/ClientSessions.cs b/src/Seam/Routes/ClientSessions.cs index bc6fe46..9394800 100644 --- a/src/Seam/Routes/ClientSessions.cs +++ b/src/Seam/Routes/ClientSessions.cs @@ -297,19 +297,17 @@ public sealed record GrantAccessRequest 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" - ); - } + RequestParameters.RequireAtLeastOne( + "/client_sessions/grant_access", + !( + ClientSessionId == null + && ConnectWebviewIds == null + && ConnectedAccountIds == null + && UserIdentifierKey == null + && UserIdentityId == null + && UserIdentityIds == null + ) + ); } } diff --git a/src/Seam/Routes/ConnectedAccounts.cs b/src/Seam/Routes/ConnectedAccounts.cs index e709f9d..0feb984 100644 --- a/src/Seam/Routes/ConnectedAccounts.cs +++ b/src/Seam/Routes/ConnectedAccounts.cs @@ -81,12 +81,10 @@ public sealed record GetRequest internal void Validate() { - if (ConnectedAccountId == null && Email == null) - { - throw new ArgumentException( - "At least one parameter is required for /connected_accounts/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/connected_accounts/get", + !(ConnectedAccountId == null && Email == null) + ); } } diff --git a/src/Seam/Routes/Devices.cs b/src/Seam/Routes/Devices.cs index 7311ae9..e0db08c 100644 --- a/src/Seam/Routes/Devices.cs +++ b/src/Seam/Routes/Devices.cs @@ -47,12 +47,10 @@ public sealed record GetRequest internal void Validate() { - if (DeviceId == null && Name == null) - { - throw new ArgumentException( - "At least one parameter is required for /devices/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/devices/get", + !(DeviceId == null && Name == null) + ); } } diff --git a/src/Seam/Routes/DevicesUnmanaged.cs b/src/Seam/Routes/DevicesUnmanaged.cs index 21b2ccd..2bc5c33 100644 --- a/src/Seam/Routes/DevicesUnmanaged.cs +++ b/src/Seam/Routes/DevicesUnmanaged.cs @@ -44,12 +44,10 @@ public sealed record GetRequest internal void Validate() { - if (DeviceId == null && Name == null) - { - throw new ArgumentException( - "At least one parameter is required for /devices/unmanaged/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/devices/unmanaged/get", + !(DeviceId == null && Name == null) + ); } } diff --git a/src/Seam/Routes/Events.cs b/src/Seam/Routes/Events.cs index ac1a49f..dbbe0c6 100644 --- a/src/Seam/Routes/Events.cs +++ b/src/Seam/Routes/Events.cs @@ -47,12 +47,10 @@ public sealed record GetRequest internal void Validate() { - if (DeviceId == null && EventId == null && EventType == null) - { - throw new ArgumentException( - "At least one parameter is required for /events/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/events/get", + !(DeviceId == null && EventId == null && EventType == null) + ); } } @@ -965,40 +963,38 @@ public enum EventTypesEnum internal void Validate() { - 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 - && Since == null - && SpaceId == null - && SpaceIds == null - && UnstableOffset == null - && UserIdentityId == null - ) - { - throw new ArgumentException( - "At least one parameter is required for /events/list" - ); - } + RequestParameters.RequireAtLeastOne( + "/events/list", + !( + 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 + && Since == null + && SpaceId == null + && SpaceIds == null + && UnstableOffset == null + && UserIdentityId == null + ) + ); } } diff --git a/src/Seam/Routes/InstantKeys.cs b/src/Seam/Routes/InstantKeys.cs index 1d5e38d..71663eb 100644 --- a/src/Seam/Routes/InstantKeys.cs +++ b/src/Seam/Routes/InstantKeys.cs @@ -69,12 +69,10 @@ public sealed record GetRequest internal void Validate() { - if (InstantKeyId == null && InstantKeyUrl == null) - { - throw new ArgumentException( - "At least one parameter is required for /instant_keys/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/instant_keys/get", + !(InstantKeyId == null && InstantKeyUrl == null) + ); } } diff --git a/src/Seam/Routes/Locks.cs b/src/Seam/Routes/Locks.cs index 2156b5b..224d602 100644 --- a/src/Seam/Routes/Locks.cs +++ b/src/Seam/Routes/Locks.cs @@ -107,12 +107,10 @@ public sealed record GetRequest internal void Validate() { - if (DeviceId == null && Name == null) - { - throw new ArgumentException( - "At least one parameter is required for /locks/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/locks/get", + !(DeviceId == null && Name == null) + ); } } diff --git a/src/Seam/Routes/Spaces.cs b/src/Seam/Routes/Spaces.cs index 98101ab..07b3da4 100644 --- a/src/Seam/Routes/Spaces.cs +++ b/src/Seam/Routes/Spaces.cs @@ -268,12 +268,10 @@ public sealed record GetRequest internal void Validate() { - if (SpaceId == null && SpaceKey == null) - { - throw new ArgumentException( - "At least one parameter is required for /spaces/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/spaces/get", + !(SpaceId == null && SpaceKey == null) + ); } } @@ -382,12 +380,10 @@ public enum IncludeEnum 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" - ); - } + RequestParameters.RequireAtLeastOne( + "/spaces/get_related", + !(Exclude == null && Include == null && SpaceIds == null && SpaceKeys == null) + ); } } diff --git a/src/Seam/Routes/UserIdentities.cs b/src/Seam/Routes/UserIdentities.cs index dc2fe4d..1bb43b4 100644 --- a/src/Seam/Routes/UserIdentities.cs +++ b/src/Seam/Routes/UserIdentities.cs @@ -236,12 +236,10 @@ public sealed record GetRequest internal void Validate() { - if (UserIdentityId == null && UserIdentityKey == null) - { - throw new ArgumentException( - "At least one parameter is required for /user_identities/get" - ); - } + RequestParameters.RequireAtLeastOne( + "/user_identities/get", + !(UserIdentityId == null && UserIdentityKey == null) + ); } } @@ -627,17 +625,15 @@ public sealed record MergeRequest internal void Validate() { - if ( - MergedUserIdentityIds == null - && MergedUserIdentityKeys == null - && UserIdentityId == null - && UserIdentityKey == null - ) - { - throw new ArgumentException( - "At least one parameter is required for /user_identities/merge" - ); - } + RequestParameters.RequireAtLeastOne( + "/user_identities/merge", + !( + MergedUserIdentityIds == null + && MergedUserIdentityKeys == null + && UserIdentityId == null + && UserIdentityKey == null + ) + ); } }