Skip to content

Commit

Permalink
Merge pull request #219 from seamapi/dependabot/npm_and_yarn/seam-41e…
Browse files Browse the repository at this point in the history
…fb398fe

feat(deps-dev): Bump @seamapi/types from 1.301.0 to 1.302.2 in the seam group across 1 directory
  • Loading branch information
seambot authored Nov 26, 2024
2 parents e29b247 + 0056191 commit 4ec29a2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@prettier/plugin-php": "^0.22.1",
"@seamapi/nextlove-sdk-generator": "1.14.12",
"@seamapi/types": "1.301.0",
"@seamapi/types": "1.302.2",
"del": "^7.1.0",
"prettier": "^3.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions src/Objects/DeviceNestMetadata.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 38 additions & 1 deletion src/SeamClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public function pull_backup_access_code(string $access_code_id): AccessCode
"POST",
"/access_codes/pull_backup_access_code",
json: $request_payload,
inner_object: "backup_access_code"
inner_object: "access_code"
);

return AccessCode::from_json($res);
Expand Down Expand Up @@ -1185,6 +1185,43 @@ public function create(
return AcsCredential::from_json($res);
}

public function create_offline_code(
string $acs_user_id,
string $allowed_acs_entrance_id = null,
string $ends_at = null,
bool $is_one_time_use = null,
string $starts_at = null
): AcsCredential {
$request_payload = [];

if ($acs_user_id !== null) {
$request_payload["acs_user_id"] = $acs_user_id;
}
if ($allowed_acs_entrance_id !== null) {
$request_payload[
"allowed_acs_entrance_id"
] = $allowed_acs_entrance_id;
}
if ($ends_at !== null) {
$request_payload["ends_at"] = $ends_at;
}
if ($is_one_time_use !== null) {
$request_payload["is_one_time_use"] = $is_one_time_use;
}
if ($starts_at !== null) {
$request_payload["starts_at"] = $starts_at;
}

$res = $this->seam->request(
"POST",
"/acs/credentials/create_offline_code",
json: $request_payload,
inner_object: "acs_credential"
);

return AcsCredential::from_json($res);
}

public function delete(string $acs_credential_id): void
{
$request_payload = [];
Expand Down

0 comments on commit 4ec29a2

Please sign in to comment.