Skip to content

Commit a6e6e36

Browse files
author
William Duncan
committed
document 204 return of PATCH /account/identity
1 parent 408c93e commit a6e6e36

File tree

7 files changed

+16
-7
lines changed

7 files changed

+16
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ Update account identity. Requires token with scope `account.details.identity.upd
331331

332332
- `username` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.
333333
- `name` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [null](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/null)</code> Your full name. Set to `null` to remove.
334-
- Returns: <code>[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Cloudnode.ApiResponse](#class-cloudnodeapiresponset)&lt;[Cloudnode.AccountIdentity](#interface-cloudnodeaccountidentity)>></code>
334+
- Returns: <code>[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Cloudnode.ApiResponse](#class-cloudnodeapiresponset)&lt;[Cloudnode.AccountIdentity](#interface-cloudnodeaccountidentity) | [void](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)>></code> `void` if nothing was changed.
335335
- Throws: <code>[Cloudnode.Error](#interface-cloudnodeerror) & {code: "RESOURCE_NOT_FOUND"}</code>
336336
- Throws: <code>[Cloudnode.Error](#interface-cloudnodeerror) & {code: "CONFLICT"}</code>
337337
- Throws: <code>[Cloudnode.Error](#interface-cloudnodeerror) & {code: "INVALID_DATA"}</code>

browser/Cloudnode.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,10 @@ class Cloudnode {
480480
* @throws {Cloudnode.Error & {code: "RATE_LIMITED"}}
481481
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
482482
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
483+
* @returns `void` if nothing was changed.
483484
*/
484485
updateIdentity: async (username, name) => {
485-
return await this.#sendRequest({ "type": "operation", "description": "Update account identity", "token": "account.details.identity.update", "method": "PATCH", "path": "/account/identity", "parameters": { "body": { "username": { "description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.", "type": "string", "required": true }, "name": { "description": "Your full name. Set to `null` to remove.", "type": "string | null", "required": false } } }, "returns": [{ "status": 200, "type": "AccountIdentity" }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 401, "type": "Error & {code: \"UNAUTHORIZED\"}" }, { "status": 403, "type": "Error & {code: \"NO_PERMISSION\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, name });
486+
return await this.#sendRequest({ "type": "operation", "description": "Update account identity", "token": "account.details.identity.update", "method": "PATCH", "path": "/account/identity", "parameters": { "body": { "username": { "description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.", "type": "string", "required": true }, "name": { "description": "Your full name. Set to `null` to remove.", "type": "string | null", "required": false } } }, "returns": [{ "status": 200, "type": "AccountIdentity" }, { "status": 204, "type": "void", "description": "`void` if nothing was changed." }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 401, "type": "Error & {code: \"UNAUTHORIZED\"}" }, { "status": 403, "type": "Error & {code: \"NO_PERMISSION\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, name });
486487
},
487488
/**
488489
* Replace account identity

browser/Cloudnode.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,11 @@
10531053
"status": 200,
10541054
"type": "AccountIdentity"
10551055
},
1056+
{
1057+
"status": 204,
1058+
"type": "void",
1059+
"description": "`void` if nothing was changed."
1060+
},
10561061
{
10571062
"status": 404,
10581063
"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"

src/Cloudnode.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ declare class Cloudnode {
277277
* @throws {Cloudnode.Error & {code: "RATE_LIMITED"}}
278278
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
279279
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
280+
* @returns `void` if nothing was changed.
280281
*/
281-
readonly updateIdentity: (username: string, name?: string | null) => Promise<Cloudnode.ApiResponse<Cloudnode.AccountIdentity>>;
282+
readonly updateIdentity: (username: string, name?: string | null) => Promise<Cloudnode.ApiResponse<Cloudnode.AccountIdentity | void>>;
282283
/**
283284
* Replace account identity
284285
* @PUT /account/identity

src/Cloudnode.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,10 @@ class Cloudnode {
480480
* @throws {Cloudnode.Error & {code: "RATE_LIMITED"}}
481481
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
482482
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
483+
* @returns `void` if nothing was changed.
483484
*/
484485
updateIdentity: async (username, name) => {
485-
return await this.#sendRequest({ "type": "operation", "description": "Update account identity", "token": "account.details.identity.update", "method": "PATCH", "path": "/account/identity", "parameters": { "body": { "username": { "description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.", "type": "string", "required": true }, "name": { "description": "Your full name. Set to `null` to remove.", "type": "string | null", "required": false } } }, "returns": [{ "status": 200, "type": "AccountIdentity" }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 401, "type": "Error & {code: \"UNAUTHORIZED\"}" }, { "status": 403, "type": "Error & {code: \"NO_PERMISSION\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, name });
486+
return await this.#sendRequest({ "type": "operation", "description": "Update account identity", "token": "account.details.identity.update", "method": "PATCH", "path": "/account/identity", "parameters": { "body": { "username": { "description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.", "type": "string", "required": true }, "name": { "description": "Your full name. Set to `null` to remove.", "type": "string | null", "required": false } } }, "returns": [{ "status": 200, "type": "AccountIdentity" }, { "status": 204, "type": "void", "description": "`void` if nothing was changed." }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 401, "type": "Error & {code: \"UNAUTHORIZED\"}" }, { "status": 403, "type": "Error & {code: \"NO_PERMISSION\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { username, name });
486487
},
487488
/**
488489
* Replace account identity

src/Cloudnode.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,10 @@ class Cloudnode {
494494
* @throws {Cloudnode.Error & {code: "RATE_LIMITED"}}
495495
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
496496
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
497+
* @returns `void` if nothing was changed.
497498
*/
498-
updateIdentity: async (username: string, name?: string | null): Promise<Cloudnode.ApiResponse<Cloudnode.AccountIdentity>> => {
499-
return await this.#sendRequest<Cloudnode.AccountIdentity>({"type":"operation","description":"Update account identity","token":"account.details.identity.update","method":"PATCH","path":"/account/identity","parameters":{"body":{"username":{"description":"Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.","type":"string","required":true},"name":{"description":"Your full name. Set to `null` to remove.","type":"string | null","required":false}}},"returns":[{"status":200,"type":"AccountIdentity"},{"status":404,"type":"Error & {code: \"RESOURCE_NOT_FOUND\"}"},{"status":409,"type":"Error & {code: \"CONFLICT\"}"},{"status":422,"type":"Error & {code: \"INVALID_DATA\"}"},{"status":401,"type":"Error & {code: \"UNAUTHORIZED\"}"},{"status":403,"type":"Error & {code: \"NO_PERMISSION\"}"},{"status":429,"type":"Error & {code: \"RATE_LIMITED\"}"},{"status":500,"type":"Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status":503,"type":"Error & {code: \"MAINTENANCE\"}"}]}, {}, {}, {username, name});
499+
updateIdentity: async (username: string, name?: string | null): Promise<Cloudnode.ApiResponse<Cloudnode.AccountIdentity | void>> => {
500+
return await this.#sendRequest<Cloudnode.AccountIdentity | void>({"type":"operation","description":"Update account identity","token":"account.details.identity.update","method":"PATCH","path":"/account/identity","parameters":{"body":{"username":{"description":"Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.","type":"string","required":true},"name":{"description":"Your full name. Set to `null` to remove.","type":"string | null","required":false}}},"returns":[{"status":200,"type":"AccountIdentity"},{"status":204,"type":"void","description":"`void` if nothing was changed."},{"status":404,"type":"Error & {code: \"RESOURCE_NOT_FOUND\"}"},{"status":409,"type":"Error & {code: \"CONFLICT\"}"},{"status":422,"type":"Error & {code: \"INVALID_DATA\"}"},{"status":401,"type":"Error & {code: \"UNAUTHORIZED\"}"},{"status":403,"type":"Error & {code: \"NO_PERMISSION\"}"},{"status":429,"type":"Error & {code: \"RATE_LIMITED\"}"},{"status":500,"type":"Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status":503,"type":"Error & {code: \"MAINTENANCE\"}"}]}, {}, {}, {username, name});
500501
},
501502
/**
502503
* Replace account identity

0 commit comments

Comments
 (0)