Skip to content

Commit 4ad6220

Browse files
committed
Rely on Python annotations for docstring types
1 parent fba3023 commit 4ad6220

73 files changed

Lines changed: 431 additions & 2747 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

codegen/lib/layouts/resources.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ const createResourceDocstring = (
8585
]
8686
.filter(Boolean)
8787
.join(' ')}`,
88-
`:vartype ${toSafeIdentifier(property.name)}: ${mapPropertyToPythonType(property)}`,
8988
)
9089
}
9190
if (isDeprecated) {

codegen/lib/layouts/route.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,18 @@ const methodDocstring = (
7575
lines.push(
7676
'',
7777
`:param ${parameter.name}: ${[deprecated, description].filter(Boolean).join(' ')}`,
78-
`:type ${parameter.name}: ${parameter.type}`,
7978
)
8079
}
8180

8281
if (method.returnResource === 'ActionAttempt') {
8382
lines.push(
8483
'',
8584
':param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish.',
86-
':type wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]',
8785
)
8886
}
8987

9088
if (method.returnResource !== 'None') {
91-
lines.push(
92-
'',
93-
`:returns: ${formatPythonDoc(method.responseDescription)}`,
94-
`:rtype: ${method.returnResource}`,
95-
)
89+
lines.push('', `:returns: ${formatPythonDoc(method.responseDescription)}`)
9690
}
9791

9892
if (method.isDeprecated) {

seam/resources/access_code.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,76 +16,53 @@ class AccessCode:
1616
For granting a person access to a space, `Access Grants <https://docs.seam.co/use-cases/granting-access>`_ are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes.
1717
1818
:ivar access_code_id: Unique identifier for the access code.
19-
:vartype access_code_id: str
2019
2120
:ivar code: Code used for access. Typically, a numeric or alphanumeric string.
22-
:vartype code: str
2321
2422
:ivar common_code_key: Unique identifier for a group of access codes that share the same code.
25-
:vartype common_code_key: str
2623
2724
:ivar created_at: Date and time at which the access code was created.
28-
:vartype created_at: str
2925
3026
:ivar device_id: Unique identifier for the device associated with the access code.
31-
:vartype device_id: str
3227
3328
:ivar dormakaba_oracode_metadata: Metadata for a dormakaba Oracode managed access code. Only present for access codes from dormakaba Oracode devices.
34-
:vartype dormakaba_oracode_metadata: Dict[str, Any]
3529
3630
:ivar ends_at: Date and time after which the time-bound access code becomes inactive.
37-
:vartype ends_at: str
3831
3932
:ivar errors: Errors associated with the `access code <https://docs.seam.co/low-level-apis/smart-locks/access-codes>`_.
40-
:vartype errors: List[Dict[str, Any]]
4133
4234
:ivar is_backup: Indicates whether the access code is a backup code.
43-
:vartype is_backup: bool
4435
4536
:ivar is_backup_access_code_available: Indicates whether a backup access code is available for use if the primary access code is lost or compromised.
46-
:vartype is_backup_access_code_available: bool
4737
4838
:ivar is_external_modification_allowed: Indicates whether changes to the access code from external sources are permitted.
49-
:vartype is_external_modification_allowed: bool
5039
5140
:ivar is_managed: Indicates whether Seam manages the access code.
52-
:vartype is_managed: bool
5341
5442
:ivar is_offline_access_code: Indicates whether the access code is intended for use in offline scenarios. If ``true``, this code can be created on a device without a network connection.
55-
:vartype is_offline_access_code: bool
5643
5744
:ivar is_one_time_use: Indicates whether the access code can only be used once. If ``true``, the code becomes invalid after the first use.
58-
:vartype is_one_time_use: bool
5945
6046
:ivar is_scheduled_on_device: Indicates whether the code is set on the device according to a preconfigured schedule.
61-
:vartype is_scheduled_on_device: bool
6247
6348
:ivar is_waiting_for_code_assignment: Indicates whether the access code is waiting for a code assignment.
64-
:vartype is_waiting_for_code_assignment: bool
6549
6650
:ivar name: Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components).
67-
:vartype name: str
6851
6952
:ivar pending_mutations: Collection of pending mutations for the access code. Indicates changes that Seam is in the process of pushing to the device.
70-
:vartype pending_mutations: List[Dict[str, Any]]
7153
7254
:ivar pulled_backup_access_code_id: Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code.
73-
:vartype pulled_backup_access_code_id: str
7455
7556
:ivar starts_at: Date and time at which the time-bound access code becomes active.
76-
:vartype starts_at: str
7757
7858
:ivar status: Current status of the access code within the operational lifecycle. Values are ``setting``, a transitional phase that indicates that the code is being configured or activated; ``set``, which indicates that the code is active and operational; ``unset``, which indicates a deactivated or unused state, either before activation or after deliberate deactivation; ``removing``, which indicates a transitional period in which the code is being deleted or made inactive; and ``unknown``, which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. See also `Lifecycle of Access Codes <https://docs.seam.co/low-level-apis/smart-locks/access-codes/lifecycle-of-access-codes>`_.
79-
:vartype status: str
8059
8160
:ivar type: Type of the access code. ``ongoing`` access codes are active continuously until deactivated manually. ``time_bound`` access codes have a specific duration.
82-
:vartype type: str
8361
8462
:ivar warnings: Warnings associated with the `access code <https://docs.seam.co/low-level-apis/smart-locks/access-codes>`_.
85-
:vartype warnings: List[Dict[str, Any]]
8663
8764
:ivar workspace_id: Unique identifier for the Seam workspace associated with the access code.
88-
:vartype workspace_id: str"""
65+
"""
8966

9067
access_code_id: str
9168
code: str

seam/resources/access_grant.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,44 @@ class AccessGrant:
88
"""Represents an Access Grant. Access Grants enable you to grant a user identity access to spaces, entrances, and devices through one or more access methods, such as mobile keys, plastic cards, and PIN codes. You can create an Access Grant for an existing user identity, or you can create a new user identity *while* creating the new Access Grant.
99
1010
:ivar access_grant_id: ID of the Access Grant.
11-
:vartype access_grant_id: str
1211
1312
:ivar access_grant_key: Unique key for the access grant within the workspace.
14-
:vartype access_grant_key: str
1513
1614
:ivar access_method_ids: IDs of the access methods created for the Access Grant.
17-
:vartype access_method_ids: List[str]
1815
1916
:ivar client_session_token: Client Session Token. Only returned if the Access Grant has a mobile_key access method.
20-
:vartype client_session_token: str
2117
2218
:ivar created_at: Date and time at which the Access Grant was created.
23-
:vartype created_at: str
2419
2520
:ivar customization_profile_id: ID of the customization profile associated with the Access Grant.
26-
:vartype customization_profile_id: str
2721
2822
:ivar display_name: Display name of the Access Grant.
29-
:vartype display_name: str
3023
3124
:ivar ends_at: Date and time at which the Access Grant ends.
32-
:vartype ends_at: str
3325
3426
:ivar errors: Errors associated with the `access grant <https://docs.seam.co/use-cases/granting-access>`_.
35-
:vartype errors: List[Dict[str, Any]]
3627
3728
:ivar instant_key_url: Instant Key URL. Only returned if the Access Grant has a single mobile_key access_method.
38-
:vartype instant_key_url: str
3929
4030
:ivar location_ids: Deprecated: Use ``space_ids``.
41-
:vartype location_ids: List[str]
4231
4332
:ivar name: Name of the Access Grant. If not provided, the display name will be computed.
44-
:vartype name: str
4533
4634
:ivar pending_mutations: List of pending mutations for the access grant. This shows updates that are in progress.
47-
:vartype pending_mutations: List[Dict[str, Any]]
4835
4936
:ivar requested_access_methods: Access methods that the user requested for the Access Grant.
50-
:vartype requested_access_methods: List[Dict[str, Any]]
5137
5238
:ivar reservation_key: Reservation key for the access grant.
53-
:vartype reservation_key: str
5439
5540
:ivar space_ids: IDs of the spaces to which the Access Grant gives access.
56-
:vartype space_ids: List[str]
5741
5842
:ivar starts_at: Date and time at which the Access Grant starts.
59-
:vartype starts_at: str
6043
6144
:ivar user_identity_id: ID of user identity to which the Access Grant gives access.
62-
:vartype user_identity_id: str
6345
6446
:ivar warnings: Warnings associated with the `access grant <https://docs.seam.co/use-cases/granting-access>`_.
65-
:vartype warnings: List[Dict[str, Any]]
6647
67-
:ivar workspace_id: ID of the Seam workspace associated with the Access Grant.
68-
:vartype workspace_id: str"""
48+
:ivar workspace_id: ID of the Seam workspace associated with the Access Grant."""
6949

7050
access_grant_id: str
7151
access_grant_key: str

seam/resources/access_method.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,40 @@ class AccessMethod:
88
"""Represents an access method for an Access Grant. Access methods describe the modes of access, such as PIN codes, plastic cards, and mobile keys. For a mobile key, the access method also stores the URL for the associated Instant Key.
99
1010
:ivar access_method_id: ID of the access method.
11-
:vartype access_method_id: str
1211
1312
:ivar client_session_token: Token of the client session associated with the access method.
14-
:vartype client_session_token: str
1513
1614
:ivar code: The actual PIN code for code access methods.
17-
:vartype code: str
1815
1916
:ivar created_at: Date and time at which the access method was created.
20-
:vartype created_at: str
2117
2218
:ivar customization_profile_id: ID of the customization profile associated with the access method.
23-
:vartype customization_profile_id: str
2419
2520
:ivar display_name: Display name of the access method.
26-
:vartype display_name: str
2721
2822
:ivar errors: Errors associated with the `access method <https://docs.seam.co/use-cases/granting-access/creating-an-access-grant>`_.
29-
:vartype errors: List[Dict[str, Any]]
3023
3124
:ivar instant_key_url: URL of the Instant Key for mobile key access methods.
32-
:vartype instant_key_url: str
3325
3426
:ivar is_assignment_required: Indicates whether an existing card credential must be assigned to this access method before it can be issued. Only applies to card-mode access methods on systems that support credential assignment.
35-
:vartype is_assignment_required: bool
3627
3728
:ivar is_encoding_required: Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method.
38-
:vartype is_encoding_required: bool
3929
4030
:ivar is_issued: Indicates whether the access method has been issued.
41-
:vartype is_issued: bool
4231
4332
:ivar is_ready_for_assignment: Indicates whether the access method is ready for card assignment. This is true when the access method is in card mode, has not yet been issued, and the system supports credential assignment.
44-
:vartype is_ready_for_assignment: bool
4533
4634
:ivar is_ready_for_encoding: 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.
47-
:vartype is_ready_for_encoding: bool
4835
4936
:ivar issued_at: Date and time at which the access method was issued.
50-
:vartype issued_at: str
5137
5238
:ivar mode: Access method mode. Supported values: ``code``, ``card``, ``mobile_key``, ``cloud_key``.
53-
:vartype mode: str
5439
5540
:ivar pending_mutations: Pending mutations for the `access method <https://docs.seam.co/use-cases/granting-access/creating-an-access-grant>`_. Indicates operations that are in progress.
56-
:vartype pending_mutations: List[Dict[str, Any]]
5741
5842
:ivar warnings: Warnings associated with the `access method <https://docs.seam.co/use-cases/granting-access/creating-an-access-grant>`_.
59-
:vartype warnings: List[Dict[str, Any]]
6043
61-
:ivar workspace_id: ID of the Seam workspace associated with the access method.
62-
:vartype workspace_id: str"""
44+
:ivar workspace_id: ID of the Seam workspace associated with the access method."""
6345

6446
access_method_id: str
6547
client_session_token: str

seam/resources/acs_access_group.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,36 @@ class AcsAccessGroup:
1212
To learn whether your access control system supports access groups, see the corresponding `system integration guide <https://docs.seam.co/device-and-system-integration-guides#access-control-systems>`_.
1313
1414
:ivar access_group_type: Deprecated: Use ``external_type``.
15-
:vartype access_group_type: str
1615
1716
:ivar access_group_type_display_name: Deprecated: Use ``external_type_display_name``.
18-
:vartype access_group_type_display_name: str
1917
2018
:ivar access_schedule: ``starts_at`` and ``ends_at`` timestamps for the access group's access.
21-
:vartype access_schedule: Dict[str, Any]
2219
2320
:ivar acs_access_group_id: ID of the access group.
24-
:vartype acs_access_group_id: str
2521
2622
:ivar acs_system_id: ID of the access control system that contains the access group.
27-
:vartype acs_system_id: str
2823
2924
:ivar connected_account_id: ID of the connected account that contains the access group.
30-
:vartype connected_account_id: str
3125
3226
:ivar created_at: Date and time at which the access group was created.
33-
:vartype created_at: str
3427
3528
:ivar display_name: Display name for the access group.
36-
:vartype display_name: str
3729
3830
:ivar errors: Errors associated with the ``acs_access_group``.
39-
:vartype errors: List[Dict[str, Any]]
4031
4132
:ivar external_type: Brand-specific terminology for the access group type.
42-
:vartype external_type: str
4333
4434
:ivar external_type_display_name: Display name that corresponds to the brand-specific terminology for the access group type.
45-
:vartype external_type_display_name: str
4635
4736
:ivar is_managed: Indicates whether Seam manages the access group.
48-
:vartype is_managed: bool
4937
5038
:ivar name: Name of the access group.
51-
:vartype name: str
5239
5340
:ivar pending_mutations: Collection of pending mutations for the access group. Represents operations that have been requested but not yet completed on the integrated access system.
54-
:vartype pending_mutations: List[Dict[str, Any]]
5541
5642
:ivar warnings: Warnings associated with the ``acs_access_group``.
57-
:vartype warnings: List[Dict[str, Any]]
5843
59-
:ivar workspace_id: ID of the workspace that contains the access group.
60-
:vartype workspace_id: str"""
44+
:ivar workspace_id: ID of the workspace that contains the access group."""
6145

6246
access_group_type: str
6347
access_group_type_display_name: str

0 commit comments

Comments
 (0)