diff --git a/.fern/metadata.json b/.fern/metadata.json
new file mode 100644
index 0000000000..7b54df604a
--- /dev/null
+++ b/.fern/metadata.json
@@ -0,0 +1,88 @@
+{
+ "cliVersion": "3.4.3",
+ "generatorName": "fernapi/fern-typescript-sdk",
+ "generatorVersion": "3.36.0",
+ "generatorConfig": {
+ "packagePath": "src/management",
+ "namespaceExport": "Management",
+ "allowCustomFetcher": true,
+ "omitFernHeaders": true,
+ "exportAllRequestsAtRoot": true,
+ "useDefaultRequestParameterValues": true,
+ "consolidateTypeFiles": true,
+ "offsetSemantics": "page-index",
+ "linter": "none",
+ "formatter": "prettier",
+ "packageManager": "yarn",
+ "testFramework": "jest",
+ "packageJson": {
+ "bugs": {
+ "url": "https://github.com/auth0/node-auth0/issues"
+ },
+ "homepage": "https://github.com/auth0/node-auth0",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/auth0/node-auth0.git"
+ },
+ "keywords": ["auth0", "authentication", "login", "auth", "jwt", "management api", "json web token"],
+ "files": ["legacy", "package.json"],
+ "description": "Auth0 Node.js SDK for the Management API v2.",
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || ^24.0.0"
+ },
+ "lint-staged": {
+ "*.{js,ts,tsx}": ["eslint --fix", "prettier --write"],
+ "*.{json,md,yml,yaml}": ["prettier --write"]
+ },
+ "scripts": {
+ "prepare": "husky",
+ "lint": "eslint . --ext .js,.ts,.tsx",
+ "lint:fix": "eslint . --ext .js,.ts,.tsx --fix",
+ "lint:check": "eslint . --ext .js,.ts,.tsx",
+ "lint:package": "publint --pack npm",
+ "test:coverage": "jest --config jest.config.mjs --coverage",
+ "test:coverage:unit": "jest --selectProjects unit --coverage",
+ "test:coverage:browser": "jest --selectProjects browser --coverage",
+ "test:coverage:wire": "jest --selectProjects wire --coverage",
+ "docs": "typedoc",
+ "docs:clean": "rm -rf docs",
+ "docs:build": "yarn docs:clean && yarn docs",
+ "precommit": "lint-staged",
+ "validate": "yarn lint:check && yarn format --check && yarn build && yarn test && yarn lint:package"
+ },
+ "dependencies": {
+ "uuid": "^11.1.0",
+ "jose": "^4.13.2",
+ "auth0-legacy": "npm:auth0@^4.27.0"
+ },
+ "devDependencies": {
+ "typedoc": "^0.28.7",
+ "typedoc-plugin-missing-exports": "^4.0.0",
+ "nock": "^14.0.6",
+ "undici": "^7.12.0",
+ "@eslint/js": "^9.32.0",
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
+ "@typescript-eslint/parser": "^8.38.0",
+ "eslint": "^9.32.0",
+ "eslint-config-prettier": "^10.1.8",
+ "eslint-plugin-prettier": "^5.5.3",
+ "husky": "^9.1.7",
+ "lint-staged": "^16.1.4",
+ "publint": "^0.3.12"
+ },
+ "exports": {
+ "./legacy": {
+ "types": "./legacy/exports/index.d.ts",
+ "import": {
+ "types": "./legacy/exports/index.d.mts",
+ "default": "./legacy/exports/index.mjs"
+ },
+ "require": {
+ "types": "./legacy/exports/index.d.ts",
+ "default": "./legacy/exports/index.js"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/.npmignore b/.npmignore
deleted file mode 100644
index 30a92cfa32..0000000000
--- a/.npmignore
+++ /dev/null
@@ -1,11 +0,0 @@
-node_modules
-src/management
-tests
-.gitignore
-.github
-.fernignore
-.prettierrc.yml
-biome.json
-tsconfig.json
-yarn.lock
-pnpm-lock.yaml
\ No newline at end of file
diff --git a/changelog.md b/changelog.md
new file mode 100644
index 0000000000..70ef2f7e0e
--- /dev/null
+++ b/changelog.md
@@ -0,0 +1,4 @@
+## 5.1.1 - 2025-12-08
+* SDK regeneration
+* Unable to analyze changes with AI, incrementing PATCH version.
+
diff --git a/package.json b/package.json
index 02783cc7f0..49f5b43377 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "auth0",
- "version": "5.1.0",
+ "version": "5.1.1",
"private": false,
"repository": {
"type": "git",
@@ -71,6 +71,11 @@
"precommit": "lint-staged",
"validate": "yarn lint:check && yarn format --check && yarn build && yarn test && yarn lint:package"
},
+ "dependencies": {
+ "uuid": "^11.1.0",
+ "jose": "^4.13.2",
+ "auth0-legacy": "npm:auth0@^4.27.0"
+ },
"devDependencies": {
"webpack": "^5.97.1",
"ts-loader": "^9.5.1",
@@ -130,10 +135,5 @@
"*.{json,md,yml,yaml}": [
"prettier --write"
]
- },
- "dependencies": {
- "uuid": "^11.1.0",
- "jose": "^4.13.2",
- "auth0-legacy": "npm:auth0@^4.27.0"
}
}
diff --git a/reference.md b/reference.md
index 2633abfe85..a43c781648 100644
--- a/reference.md
+++ b/reference.md
@@ -80,7 +80,7 @@ const response = page.response;
-
-**requestOptions:** `Actions.RequestOptions`
+**requestOptions:** `ActionsClient.RequestOptions`
@@ -150,7 +150,7 @@ await client.actions.create({
-
-**requestOptions:** `Actions.RequestOptions`
+**requestOptions:** `ActionsClient.RequestOptions`
@@ -213,7 +213,7 @@ await client.actions.get("id");
-
-**requestOptions:** `Actions.RequestOptions`
+**requestOptions:** `ActionsClient.RequestOptions`
@@ -286,7 +286,7 @@ await client.actions.delete("id", {
-
-**requestOptions:** `Actions.RequestOptions`
+**requestOptions:** `ActionsClient.RequestOptions`
@@ -357,7 +357,7 @@ await client.actions.update("id");
-
-**requestOptions:** `Actions.RequestOptions`
+**requestOptions:** `ActionsClient.RequestOptions`
@@ -420,7 +420,7 @@ await client.actions.deploy("id");
-
-**requestOptions:** `Actions.RequestOptions`
+**requestOptions:** `ActionsClient.RequestOptions`
@@ -495,7 +495,7 @@ await client.actions.test("id", {
-
-**requestOptions:** `Actions.RequestOptions`
+**requestOptions:** `ActionsClient.RequestOptions`
@@ -552,7 +552,7 @@ await client.branding.get();
-
-**requestOptions:** `Branding.RequestOptions`
+**requestOptions:** `BrandingClient.RequestOptions`
@@ -615,7 +615,7 @@ await client.branding.update();
-
-**requestOptions:** `Branding.RequestOptions`
+**requestOptions:** `BrandingClient.RequestOptions`
@@ -706,7 +706,7 @@ const response = page.response;
-
-**requestOptions:** `ClientGrants.RequestOptions`
+**requestOptions:** `ClientGrantsClient.RequestOptions`
@@ -772,7 +772,7 @@ await client.clientGrants.create({
-
-**requestOptions:** `ClientGrants.RequestOptions`
+**requestOptions:** `ClientGrantsClient.RequestOptions`
@@ -835,7 +835,7 @@ await client.clientGrants.delete("id");
-
-**requestOptions:** `ClientGrants.RequestOptions`
+**requestOptions:** `ClientGrantsClient.RequestOptions`
@@ -906,7 +906,7 @@ await client.clientGrants.update("id");
-
-**requestOptions:** `ClientGrants.RequestOptions`
+**requestOptions:** `ClientGrantsClient.RequestOptions`
@@ -1034,7 +1034,7 @@ const response = page.response;
-
-**requestOptions:** `Clients.RequestOptions`
+**requestOptions:** `ClientsClient.RequestOptions`
@@ -1112,7 +1112,7 @@ await client.clients.create({
-
-**requestOptions:** `Clients.RequestOptions`
+**requestOptions:** `ClientsClient.RequestOptions`
@@ -1216,7 +1216,7 @@ await client.clients.get("id", {
-
-**requestOptions:** `Clients.RequestOptions`
+**requestOptions:** `ClientsClient.RequestOptions`
@@ -1279,7 +1279,7 @@ await client.clients.delete("id");
-
-**requestOptions:** `Clients.RequestOptions`
+**requestOptions:** `ClientsClient.RequestOptions`
@@ -1358,7 +1358,7 @@ await client.clients.update("id");
-
-**requestOptions:** `Clients.RequestOptions`
+**requestOptions:** `ClientsClient.RequestOptions`
@@ -1425,7 +1425,7 @@ await client.clients.rotateSecret("id");
-
-**requestOptions:** `Clients.RequestOptions`
+**requestOptions:** `ClientsClient.RequestOptions`
@@ -1436,9 +1436,9 @@ await client.clients.rotateSecret("id");
-## Connections
+## ConnectionProfiles
-client.connections.list({ ...params }) -> core.Page
+client.connectionProfiles.list({ ...params }) -> core.Page
-
@@ -1450,27 +1450,7 @@ await client.clients.rotateSecret("id");
-
-Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections.
-
-This endpoint supports two types of pagination:
-
-
-- Offset pagination
-- Checkpoint pagination
-
-
-Checkpoint pagination must be used if you need to retrieve more than 1000 connections.
-
-Checkpoint Pagination
-
-To search by checkpoint, use the following parameters:
-
-
-from: Optional id from which to start selection.
-take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
-
-
-Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining.
+Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination.
@@ -1486,24 +1466,18 @@ To search by checkpoint, use the following parameters:
-
```typescript
-const pageableResponse = await client.connections.list({
+const pageableResponse = await client.connectionProfiles.list({
from: "from",
take: 1,
- name: "name",
- fields: "fields",
- include_fields: true,
});
for await (const item of pageableResponse) {
console.log(item);
}
// Or you can manually iterate page-by-page
-let page = await client.connections.list({
+let page = await client.connectionProfiles.list({
from: "from",
take: 1,
- name: "name",
- fields: "fields",
- include_fields: true,
});
while (page.hasNextPage()) {
page = page.getNextPage();
@@ -1526,7 +1500,7 @@ const response = page.response;
-
-**request:** `Management.ListConnectionsQueryParameters`
+**request:** `Management.ListConnectionProfileRequestParameters`
@@ -1534,7 +1508,7 @@ const response = page.response;
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionProfilesClient.RequestOptions`
@@ -1545,7 +1519,7 @@ const response = page.response;
-client.connections.create({ ...params }) -> Management.CreateConnectionResponseContent
+client.connectionProfiles.create({ ...params }) -> Management.CreateConnectionProfileResponseContent
-
@@ -1557,7 +1531,7 @@ const response = page.response;
-
-Creates a new connection according to the JSON object received in
body.
+Create a Connection Profile.
@@ -1573,9 +1547,8 @@ Creates a new connection according to the JSON object received in body
```typescript
-await client.connections.create({
+await client.connectionProfiles.create({
name: "name",
- strategy: "ad",
});
```
@@ -1592,7 +1565,7 @@ await client.connections.create({
-
-**request:** `Management.CreateConnectionRequestContent`
+**request:** `Management.CreateConnectionProfileRequestContent`
@@ -1600,7 +1573,7 @@ await client.connections.create({
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionProfilesClient.RequestOptions`
@@ -1611,7 +1584,7 @@ await client.connections.create({
-client.connections.get(id, { ...params }) -> Management.GetConnectionResponseContent
+client.connectionProfiles.listTemplates() -> Management.ListConnectionProfileTemplateResponseContent
-
@@ -1623,7 +1596,7 @@ await client.connections.create({
-
-Retrieve details for a specified connection along with options that can be used for identity provider configuration.
+Retrieve a list of Connection Profile Templates.
@@ -1639,10 +1612,7 @@ Retrieve details for a specified
@@ -1658,23 +1628,7 @@ await client.connections.get("id", {
-
-**id:** `string` — The id of the connection to retrieve
-
-
-
-
-
--
-
-**request:** `Management.GetConnectionRequestParameters`
-
-
-
-
-
--
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionProfilesClient.RequestOptions`
@@ -1685,7 +1639,7 @@ await client.connections.get("id", {
-client.connections.delete(id) -> void
+client.connectionProfiles.getTemplate(id) -> Management.GetConnectionProfileTemplateResponseContent
-
@@ -1697,7 +1651,7 @@ await client.connections.get("id", {
-
-Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate.
+Retrieve a Connection Profile Template.
@@ -1713,7 +1667,7 @@ Removes a specific
@@ -1729,7 +1683,7 @@ await client.connections.delete("id");
-
-**id:** `string` — The id of the connection to delete
+**id:** `string` — ID of the connection-profile-template to retrieve.
@@ -1737,7 +1691,7 @@ await client.connections.delete("id");
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionProfilesClient.RequestOptions`
@@ -1748,7 +1702,7 @@ await client.connections.delete("id");
-client.connections.update(id, { ...params }) -> Management.UpdateConnectionResponseContent
+client.connectionProfiles.get(id) -> Management.GetConnectionProfileResponseContent
-
@@ -1760,9 +1714,7 @@ await client.connections.delete("id");
-
-Update details for a specific connection, including option properties for identity provider configuration.
-
-Note: If you use the
options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.
+Retrieve details about a single Connection Profile specified by ID.
@@ -1778,7 +1730,7 @@ Update details for a specific
@@ -1794,15 +1746,7 @@ await client.connections.update("id");
-
-**id:** `string` — The id of the connection to update
-
-
-
-
-
--
-
-**request:** `Management.UpdateConnectionRequestContent`
+**id:** `string` — ID of the connection-profile to retrieve.
@@ -1810,7 +1754,7 @@ await client.connections.update("id");
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionProfilesClient.RequestOptions`
@@ -1821,7 +1765,7 @@ await client.connections.update("id");
-client.connections.checkStatus(id) -> void
+client.connectionProfiles.delete(id) -> void
-
@@ -1833,7 +1777,7 @@ await client.connections.update("id");
-
-Retrieves the status of an ad/ldap connection referenced by its
ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message
+Delete a single Connection Profile specified by ID.
@@ -1849,7 +1793,7 @@ Retrieves the status of an ad/ldap connection referenced by its ID.
-
```typescript
-await client.connections.checkStatus("id");
+await client.connectionProfiles.delete("id");
```
@@ -1865,7 +1809,7 @@ await client.connections.checkStatus("id");
-
-**id:** `string` — ID of the connection to check
+**id:** `string` — ID of the connection-profile to delete.
@@ -1873,7 +1817,7 @@ await client.connections.checkStatus("id");
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionProfilesClient.RequestOptions`
@@ -1884,9 +1828,7 @@ await client.connections.checkStatus("id");
-## CustomDomains
-
-client.customDomains.list() -> Management.ListCustomDomainsResponseContent
+client.connectionProfiles.update(id, { ...params }) -> Management.UpdateConnectionProfileResponseContent
-
@@ -1898,7 +1840,7 @@ await client.connections.checkStatus("id");
-
-Retrieve details on custom domains.
+Update the details of a specific Connection Profile.
@@ -1914,7 +1856,7 @@ Retrieve details on custom domai
-
```typescript
-await client.customDomains.list();
+await client.connectionProfiles.update("id");
```
@@ -1930,7 +1872,23 @@ await client.customDomains.list();
-
-**requestOptions:** `CustomDomains.RequestOptions`
+**id:** `string` — ID of the connection profile to update.
+
+
+
+
+
+-
+
+**request:** `Management.UpdateConnectionProfileRequestContent`
+
+
+
+
+
+-
+
+**requestOptions:** `ConnectionProfilesClient.RequestOptions`
@@ -1941,7 +1899,9 @@ await client.customDomains.list();
-client.customDomains.create({ ...params }) -> Management.CreateCustomDomainResponseContent
+## Connections
+
+client.connections.list({ ...params }) -> core.Page
-
@@ -1953,23 +1913,32 @@ await client.customDomains.list();
-
-Create a new custom domain.
+Retrieves detailed list of all connections that match the specified strategy. If no strategy is provided, all connections within your tenant are retrieved. This action can accept a list of fields to include or exclude from the resulting list of connections.
-Note: The custom domain will need to be verified before it will accept
-requests.
+This endpoint supports two types of pagination:
-Optional attributes that can be updated:
+
+- Offset pagination
+- Checkpoint pagination
+
-- custom_client_ip_header
-- tls_policy
+Checkpoint pagination must be used if you need to retrieve more than 1000 connections.
-TLS Policies:
+Checkpoint Pagination
-- recommended - for modern usage this includes TLS 1.2 only
-
-
-
-
+To search by checkpoint, use the following parameters:
+
+
+from: Optional id from which to start selection.
+take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.
+
+
+Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining.
+
+
+
+
+
#### 🔌 Usage
@@ -1980,10 +1949,31 @@ TLS Policies:
```typescript
-await client.customDomains.create({
- domain: "domain",
- type: "auth0_managed_certs",
+const pageableResponse = await client.connections.list({
+ from: "from",
+ take: 1,
+ name: "name",
+ fields: "fields",
+ include_fields: true,
});
+for await (const item of pageableResponse) {
+ console.log(item);
+}
+
+// Or you can manually iterate page-by-page
+let page = await client.connections.list({
+ from: "from",
+ take: 1,
+ name: "name",
+ fields: "fields",
+ include_fields: true,
+});
+while (page.hasNextPage()) {
+ page = page.getNextPage();
+}
+
+// You can also access the underlying response
+const response = page.response;
```
@@ -1999,7 +1989,7 @@ await client.customDomains.create({
-
-**request:** `Management.CreateCustomDomainRequestContent`
+**request:** `Management.ListConnectionsQueryParameters`
@@ -2007,7 +1997,7 @@ await client.customDomains.create({
-
-**requestOptions:** `CustomDomains.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -2018,7 +2008,7 @@ await client.customDomains.create({
-client.customDomains.get(id) -> Management.GetCustomDomainResponseContent
+client.connections.create({ ...params }) -> Management.CreateConnectionResponseContent
-
@@ -2030,7 +2020,7 @@ await client.customDomains.create({
-
-Retrieve a custom domain configuration and status.
+Creates a new connection according to the JSON object received in
body.
@@ -2046,7 +2036,10 @@ Retrieve a custom domain configuration and status.
-
```typescript
-await client.customDomains.get("id");
+await client.connections.create({
+ name: "name",
+ strategy: "ad",
+});
```
@@ -2062,7 +2055,7 @@ await client.customDomains.get("id");
-
-**id:** `string` — ID of the custom domain to retrieve.
+**request:** `Management.CreateConnectionRequestContent`
@@ -2070,7 +2063,7 @@ await client.customDomains.get("id");
-
-**requestOptions:** `CustomDomains.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -2081,7 +2074,7 @@ await client.customDomains.get("id");
-client.customDomains.delete(id) -> void
+client.connections.get(id, { ...params }) -> Management.GetConnectionResponseContent
-
@@ -2093,7 +2086,7 @@ await client.customDomains.get("id");
-
-Delete a custom domain and stop serving requests for it.
+Retrieve details for a specified connection along with options that can be used for identity provider configuration.
@@ -2109,7 +2102,10 @@ Delete a custom domain and stop serving requests for it.
-
```typescript
-await client.customDomains.delete("id");
+await client.connections.get("id", {
+ fields: "fields",
+ include_fields: true,
+});
```
@@ -2125,7 +2121,15 @@ await client.customDomains.delete("id");
-
-**id:** `string` — ID of the custom domain to delete.
+**id:** `string` — The id of the connection to retrieve
+
+
+
+
+
+-
+
+**request:** `Management.GetConnectionRequestParameters`
@@ -2133,7 +2137,7 @@ await client.customDomains.delete("id");
-
-**requestOptions:** `CustomDomains.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -2144,7 +2148,7 @@ await client.customDomains.delete("id");
-client.customDomains.update(id, { ...params }) -> Management.UpdateCustomDomainResponseContent
+client.connections.delete(id) -> void
-
@@ -2156,32 +2160,12 @@ await client.customDomains.delete("id");
-
-Update a custom domain.
-
-These are the attributes that can be updated:
-
-- custom_client_ip_header
-- tls_policy
-
-
Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to
-send should be:
-{ "custom_client_ip_header": "cf-connecting-ip" }
-
-Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be:
-{ "tls_policy": "recommended" }
-
-TLS Policies:
-
-- recommended - for modern usage this includes TLS 1.2 only
-
-Some considerations:
+Removes a specific connection from your tenant. This action cannot be undone. Once removed, users can no longer use this connection to authenticate.
-- The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
-- The compatible TLS policy is no longer supported.
-
-
-
-
+
+
+
+
#### 🔌 Usage
@@ -2192,7 +2176,7 @@ Some considerations:
```typescript
-await client.customDomains.update("id");
+await client.connections.delete("id");
```
@@ -2208,15 +2192,7 @@ await client.customDomains.update("id");
-
-**id:** `string` — The id of the custom domain to update
-
-
-
-
-
--
-
-**request:** `Management.UpdateCustomDomainRequestContent`
+**id:** `string` — The id of the connection to delete
@@ -2224,7 +2200,7 @@ await client.customDomains.update("id");
-
-**requestOptions:** `CustomDomains.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -2235,7 +2211,7 @@ await client.customDomains.update("id");
-client.customDomains.test(id) -> Management.TestCustomDomainResponseContent
+client.connections.update(id, { ...params }) -> Management.UpdateConnectionResponseContent
-
@@ -2247,7 +2223,9 @@ await client.customDomains.update("id");
-
-Run the test process on a custom domain.
+Update details for a specific connection, including option properties for identity provider configuration.
+
+Note: If you use the
options parameter, the entire options object is overriden. To avoid partial data or other issues, ensure all parameters are present when using this option.
@@ -2263,7 +2241,7 @@ Run the test process on a custom domain.
-
```typescript
-await client.customDomains.test("id");
+await client.connections.update("id");
```
@@ -2279,7 +2257,15 @@ await client.customDomains.test("id");
-
-**id:** `string` — ID of the custom domain to test.
+**id:** `string` — The id of the connection to update
+
+
+
+
+
+-
+
+**request:** `Management.UpdateConnectionRequestContent`
@@ -2287,7 +2273,7 @@ await client.customDomains.test("id");
-
-**requestOptions:** `CustomDomains.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -2298,7 +2284,7 @@ await client.customDomains.test("id");
-client.customDomains.verify(id) -> Management.VerifyCustomDomainResponseContent
+client.connections.checkStatus(id) -> void
-
@@ -2310,14 +2296,7 @@ await client.customDomains.test("id");
-
-Run the verification process on a custom domain.
-
-Note: Check the
status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.
-
-For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.
-
-Learn more about verifying custom domains that use Auth0 Managed certificates.
-Learn more about verifying custom domains that use Self Managed certificates.
+Retrieves the status of an ad/ldap connection referenced by its ID. 200 OK http status code response is returned when the connection is online, otherwise a 404 status code is returned along with an error message
@@ -2333,7 +2312,7 @@ For self_managed_certs, when the custom domain is verified for the
-
```typescript
-await client.customDomains.verify("id");
+await client.connections.checkStatus("id");
```
@@ -2349,7 +2328,7 @@ await client.customDomains.verify("id");
-
-**id:** `string` — ID of the custom domain to verify.
+**id:** `string` — ID of the connection to check
@@ -2357,7 +2336,7 @@ await client.customDomains.verify("id");
-
-**requestOptions:** `CustomDomains.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -2368,9 +2347,9 @@ await client.customDomains.verify("id");
-## DeviceCredentials
+## CustomDomains
-client.deviceCredentials.list({ ...params }) -> core.Page
+client.customDomains.list({ ...params }) -> Management.ListCustomDomainsResponseContent
-
@@ -2382,7 +2361,7 @@ await client.customDomains.verify("id");
-
-Retrieve device credential information (
public_key, refresh_token, or rotating_refresh_token) associated with a specific user.
+Retrieve details on custom domains.
@@ -2398,37 +2377,14 @@ Retrieve device credential information (public_key, refresh_t
-
```typescript
-const pageableResponse = await client.deviceCredentials.list({
- page: 1,
- per_page: 1,
- include_totals: true,
- fields: "fields",
- include_fields: true,
- user_id: "user_id",
- client_id: "client_id",
- type: "public_key",
-});
-for await (const item of pageableResponse) {
- console.log(item);
-}
-
-// Or you can manually iterate page-by-page
-let page = await client.deviceCredentials.list({
- page: 1,
- per_page: 1,
- include_totals: true,
+await client.customDomains.list({
+ take: 1,
+ from: "from",
+ q: "q",
fields: "fields",
include_fields: true,
- user_id: "user_id",
- client_id: "client_id",
- type: "public_key",
+ sort: "sort",
});
-while (page.hasNextPage()) {
- page = page.getNextPage();
-}
-
-// You can also access the underlying response
-const response = page.response;
```
@@ -2444,7 +2400,7 @@ const response = page.response;
-
-**request:** `Management.ListDeviceCredentialsRequestParameters`
+**request:** `Management.ListCustomDomainsRequestParameters`
@@ -2452,7 +2408,7 @@ const response = page.response;
-
-**requestOptions:** `DeviceCredentials.RequestOptions`
+**requestOptions:** `CustomDomainsClient.RequestOptions`
@@ -2463,7 +2419,7 @@ const response = page.response;
-client.deviceCredentials.createPublicKey({ ...params }) -> Management.CreatePublicKeyDeviceCredentialResponseContent
+client.customDomains.create({ ...params }) -> Management.CreateCustomDomainResponseContent
-
@@ -2475,14 +2431,23 @@ const response = page.response;
-
-Create a device credential public key to manage refresh token rotation for a given
user_id. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests.
+Create a new custom domain.
-When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read Signing Keys.
+Note: The custom domain will need to be verified before it will accept
+requests.
-
-
-
-
+Optional attributes that can be updated:
+
+- custom_client_ip_header
+- tls_policy
+
+TLS Policies:
+
+- recommended - for modern usage this includes TLS 1.2 only
+
+
+
+
#### 🔌 Usage
@@ -2493,10 +2458,9 @@ When refresh token rotation is enabled, the endpoint becomes consistent. For mor
```typescript
-await client.deviceCredentials.createPublicKey({
- device_name: "device_name",
- value: "value",
- device_id: "device_id",
+await client.customDomains.create({
+ domain: "domain",
+ type: "auth0_managed_certs",
});
```
@@ -2513,7 +2477,7 @@ await client.deviceCredentials.createPublicKey({
-
-**request:** `Management.CreatePublicKeyDeviceCredentialRequestContent`
+**request:** `Management.CreateCustomDomainRequestContent`
@@ -2521,7 +2485,7 @@ await client.deviceCredentials.createPublicKey({
-
-**requestOptions:** `DeviceCredentials.RequestOptions`
+**requestOptions:** `CustomDomainsClient.RequestOptions`
@@ -2532,7 +2496,7 @@ await client.deviceCredentials.createPublicKey({
-client.deviceCredentials.delete(id) -> void
+client.customDomains.get(id) -> Management.GetCustomDomainResponseContent
-
@@ -2544,7 +2508,7 @@ await client.deviceCredentials.createPublicKey({
-
-Permanently delete a device credential (such as a refresh token or public key) with the given ID.
+Retrieve a custom domain configuration and status.
@@ -2560,7 +2524,7 @@ Permanently delete a device credential (such as a refresh token or public key) w
-
```typescript
-await client.deviceCredentials.delete("id");
+await client.customDomains.get("id");
```
@@ -2576,7 +2540,7 @@ await client.deviceCredentials.delete("id");
-
-**id:** `string` — ID of the credential to delete.
+**id:** `string` — ID of the custom domain to retrieve.
@@ -2584,7 +2548,7 @@ await client.deviceCredentials.delete("id");
-
-**requestOptions:** `DeviceCredentials.RequestOptions`
+**requestOptions:** `CustomDomainsClient.RequestOptions`
@@ -2595,9 +2559,7 @@ await client.deviceCredentials.delete("id");
-## EmailTemplates
-
-client.emailTemplates.create({ ...params }) -> Management.CreateEmailTemplateResponseContent
+client.customDomains.delete(id) -> void
-
@@ -2609,7 +2571,7 @@ await client.deviceCredentials.delete("id");
-
-Create an email template.
+Delete a custom domain and stop serving requests for it.
@@ -2625,9 +2587,7 @@ Create an email template.
-
```typescript
-await client.emailTemplates.create({
- template: "verify_email",
-});
+await client.customDomains.delete("id");
```
@@ -2643,7 +2603,7 @@ await client.emailTemplates.create({
-
-**request:** `Management.CreateEmailTemplateRequestContent`
+**id:** `string` — ID of the custom domain to delete.
@@ -2651,7 +2611,7 @@ await client.emailTemplates.create({
-
-**requestOptions:** `EmailTemplates.RequestOptions`
+**requestOptions:** `CustomDomainsClient.RequestOptions`
@@ -2662,7 +2622,7 @@ await client.emailTemplates.create({
-client.emailTemplates.get(templateName) -> Management.GetEmailTemplateResponseContent
+client.customDomains.update(id, { ...params }) -> Management.UpdateCustomDomainResponseContent
-
@@ -2674,12 +2634,32 @@ await client.emailTemplates.create({
-
-Retrieve an email template by pre-defined name. These names are `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, and `async_approval`. The names `change_password`, and `password_reset` are also supported for legacy scenarios.
+Update a custom domain.
-
-
-
-
+These are the attributes that can be updated:
+
+- custom_client_ip_header
+- tls_policy
+
+Updating CUSTOM_CLIENT_IP_HEADER for a custom domain
To update the custom_client_ip_header for a domain, the body to
+send should be:
+{ "custom_client_ip_header": "cf-connecting-ip" }
+
+Updating TLS_POLICY for a custom domain
To update the tls_policy for a domain, the body to send should be:
+{ "tls_policy": "recommended" }
+
+TLS Policies:
+
+- recommended - for modern usage this includes TLS 1.2 only
+
+Some considerations:
+
+- The TLS ciphers and protocols available in each TLS policy follow industry recommendations, and may be updated occasionally.
+- The compatible TLS policy is no longer supported.
+
+
+
+
#### 🔌 Usage
@@ -2690,7 +2670,7 @@ Retrieve an email template by pre-defined name. These names are `verify_email`,
```typescript
-await client.emailTemplates.get("verify_email");
+await client.customDomains.update("id");
```
@@ -2706,7 +2686,15 @@ await client.emailTemplates.get("verify_email");
-
-**templateName:** `Management.EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy).
+**id:** `string` — The id of the custom domain to update
+
+
+
+
+
+-
+
+**request:** `Management.UpdateCustomDomainRequestContent`
@@ -2714,7 +2702,7 @@ await client.emailTemplates.get("verify_email");
-
-**requestOptions:** `EmailTemplates.RequestOptions`
+**requestOptions:** `CustomDomainsClient.RequestOptions`
@@ -2725,7 +2713,7 @@ await client.emailTemplates.get("verify_email");
-client.emailTemplates.set(templateName, { ...params }) -> Management.SetEmailTemplateResponseContent
+client.customDomains.test(id) -> Management.TestCustomDomainResponseContent
-
@@ -2737,7 +2725,7 @@ await client.emailTemplates.get("verify_email");
-
-Update an email template.
+Run the test process on a custom domain.
@@ -2753,9 +2741,7 @@ Update an email template.
-
```typescript
-await client.emailTemplates.set("verify_email", {
- template: "verify_email",
-});
+await client.customDomains.test("id");
```
@@ -2771,15 +2757,7 @@ await client.emailTemplates.set("verify_email", {
-
-**templateName:** `Management.EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy).
-
-
-
-
-
--
-
-**request:** `Management.SetEmailTemplateRequestContent`
+**id:** `string` — ID of the custom domain to test.
@@ -2787,7 +2765,7 @@ await client.emailTemplates.set("verify_email", {
-
-**requestOptions:** `EmailTemplates.RequestOptions`
+**requestOptions:** `CustomDomainsClient.RequestOptions`
@@ -2798,7 +2776,7 @@ await client.emailTemplates.set("verify_email", {
-client.emailTemplates.update(templateName, { ...params }) -> Management.UpdateEmailTemplateResponseContent
+client.customDomains.verify(id) -> Management.VerifyCustomDomainResponseContent
-
@@ -2810,7 +2788,14 @@ await client.emailTemplates.set("verify_email", {
-
-Modify an email template.
+Run the verification process on a custom domain.
+
+Note: Check the
status field to see its verification status. Once verification is complete, it may take up to 10 minutes before the custom domain can start accepting requests.
+
+For self_managed_certs, when the custom domain is verified for the first time, the response will also include the cname_api_key which you will need to configure your proxy. This key must be kept secret, and is used to validate the proxy requests.
+
+Learn more about verifying custom domains that use Auth0 Managed certificates.
+Learn more about verifying custom domains that use Self Managed certificates.
@@ -2826,7 +2811,7 @@ Modify an email template.
-
```typescript
-await client.emailTemplates.update("verify_email");
+await client.customDomains.verify("id");
```
@@ -2842,15 +2827,7 @@ await client.emailTemplates.update("verify_email");
-
-**templateName:** `Management.EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy).
-
-
-
-
-
--
-
-**request:** `Management.UpdateEmailTemplateRequestContent`
+**id:** `string` — ID of the custom domain to verify.
@@ -2858,7 +2835,7 @@ await client.emailTemplates.update("verify_email");
-
-**requestOptions:** `EmailTemplates.RequestOptions`
+**requestOptions:** `CustomDomainsClient.RequestOptions`
@@ -2869,12 +2846,27 @@ await client.emailTemplates.update("verify_email");
-## EventStreams
+## DeviceCredentials
+
+client.deviceCredentials.list({ ...params }) -> core.Page
+
+-
+
+#### 📝 Description
+
+
+-
-
client.eventStreams.list({ ...params }) -> Management.EventStreamResponseContent[]
-
+Retrieve device credential information (
public_key, refresh_token, or rotating_refresh_token) associated with a specific user.
+
+
+
+
+
+
#### 🔌 Usage
@@ -2884,10 +2876,37 @@ await client.emailTemplates.update("verify_email");
-
```typescript
-await client.eventStreams.list({
- from: "from",
- take: 1,
+const pageableResponse = await client.deviceCredentials.list({
+ page: 1,
+ per_page: 1,
+ include_totals: true,
+ fields: "fields",
+ include_fields: true,
+ user_id: "user_id",
+ client_id: "client_id",
+ type: "public_key",
+});
+for await (const item of pageableResponse) {
+ console.log(item);
+}
+
+// Or you can manually iterate page-by-page
+let page = await client.deviceCredentials.list({
+ page: 1,
+ per_page: 1,
+ include_totals: true,
+ fields: "fields",
+ include_fields: true,
+ user_id: "user_id",
+ client_id: "client_id",
+ type: "public_key",
});
+while (page.hasNextPage()) {
+ page = page.getNextPage();
+}
+
+// You can also access the underlying response
+const response = page.response;
```
@@ -2903,7 +2922,7 @@ await client.eventStreams.list({
-
-**request:** `Management.ListEventStreamsRequestParameters`
+**request:** `Management.ListDeviceCredentialsRequestParameters`
@@ -2911,7 +2930,7 @@ await client.eventStreams.list({
-
-**requestOptions:** `EventStreams.RequestOptions`
+**requestOptions:** `DeviceCredentialsClient.RequestOptions`
@@ -2922,11 +2941,11 @@ await client.eventStreams.list({
-client.eventStreams.create({ ...params }) -> Management.CreateEventStreamResponseContent
+client.deviceCredentials.createPublicKey({ ...params }) -> Management.CreatePublicKeyDeviceCredentialResponseContent
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -2934,18 +2953,28 @@ await client.eventStreams.list({
-
-```typescript
-await client.eventStreams.create({
- destination: {
- type: "webhook",
- configuration: {
- webhook_endpoint: "webhook_endpoint",
- webhook_authorization: {
- method: "basic",
- username: "username",
- },
- },
- },
+Create a device credential public key to manage refresh token rotation for a given
user_id. Device Credentials APIs are designed for ad-hoc administrative use only and paging is by default enabled for GET requests.
+
+When refresh token rotation is enabled, the endpoint becomes consistent. For more information, read Signing Keys.
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.deviceCredentials.createPublicKey({
+ device_name: "device_name",
+ value: "value",
+ device_id: "device_id",
});
```
@@ -2962,7 +2991,7 @@ await client.eventStreams.create({
-
-**request:** `Management.EventStreamsCreateRequest`
+**request:** `Management.CreatePublicKeyDeviceCredentialRequestContent`
@@ -2970,7 +2999,7 @@ await client.eventStreams.create({
-
-**requestOptions:** `EventStreams.RequestOptions`
+**requestOptions:** `DeviceCredentialsClient.RequestOptions`
@@ -2981,10 +3010,25 @@ await client.eventStreams.create({
-client.eventStreams.get(id) -> Management.GetEventStreamResponseContent
+client.deviceCredentials.delete(id) -> void
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Permanently delete a device credential (such as a refresh token or public key) with the given ID.
+
+
+
+
+
+
#### 🔌 Usage
@@ -2994,7 +3038,7 @@ await client.eventStreams.create({
-
```typescript
-await client.eventStreams.get("id");
+await client.deviceCredentials.delete("id");
```
@@ -3010,7 +3054,7 @@ await client.eventStreams.get("id");
-
-**id:** `string` — Unique identifier for the event stream.
+**id:** `string` — ID of the credential to delete.
@@ -3018,7 +3062,7 @@ await client.eventStreams.get("id");
-
-**requestOptions:** `EventStreams.RequestOptions`
+**requestOptions:** `DeviceCredentialsClient.RequestOptions`
@@ -3029,10 +3073,27 @@ await client.eventStreams.get("id");
-client.eventStreams.delete(id) -> void
+## EmailTemplates
+
+client.emailTemplates.create({ ...params }) -> Management.CreateEmailTemplateResponseContent
+
+-
+
+#### 📝 Description
+
+
+-
+
-
+Create an email template.
+
+
+
+
+
+
#### 🔌 Usage
@@ -3042,7 +3103,9 @@ await client.eventStreams.get("id");
-
```typescript
-await client.eventStreams.delete("id");
+await client.emailTemplates.create({
+ template: "verify_email",
+});
```
@@ -3058,7 +3121,7 @@ await client.eventStreams.delete("id");
-
-**id:** `string` — Unique identifier for the event stream.
+**request:** `Management.CreateEmailTemplateRequestContent`
@@ -3066,7 +3129,7 @@ await client.eventStreams.delete("id");
-
-**requestOptions:** `EventStreams.RequestOptions`
+**requestOptions:** `EmailTemplatesClient.RequestOptions`
@@ -3077,11 +3140,11 @@ await client.eventStreams.delete("id");
-client.eventStreams.update(id, { ...params }) -> Management.UpdateEventStreamResponseContent
+client.emailTemplates.get(templateName) -> Management.GetEmailTemplateResponseContent
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -3089,16 +3152,14 @@ await client.eventStreams.delete("id");
-
-```typescript
-await client.eventStreams.update("id");
-```
+Retrieve an email template by pre-defined name. These names are `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, and `async_approval`. The names `change_password`, and `password_reset` are also supported for legacy scenarios.
-#### ⚙️ Parameters
+#### 🔌 Usage
-
@@ -3106,15 +3167,24 @@ await client.eventStreams.update("id");
-
-**id:** `string` — Unique identifier for the event stream.
+```typescript
+await client.emailTemplates.get("verify_email");
+```
+
+
+
+#### ⚙️ Parameters
-
-**request:** `Management.UpdateEventStreamRequestContent`
+
+-
+
+**templateName:** `Management.EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy).
@@ -3122,7 +3192,7 @@ await client.eventStreams.update("id");
-
-**requestOptions:** `EventStreams.RequestOptions`
+**requestOptions:** `EmailTemplatesClient.RequestOptions`
@@ -3133,10 +3203,25 @@ await client.eventStreams.update("id");
-client.eventStreams.test(id, { ...params }) -> Management.CreateEventStreamTestEventResponseContent
+client.emailTemplates.set(templateName, { ...params }) -> Management.SetEmailTemplateResponseContent
+
+-
+
+#### 📝 Description
+
-
+
+-
+
+Update an email template.
+
+
+
+
+
+
#### 🔌 Usage
@@ -3146,8 +3231,8 @@ await client.eventStreams.update("id");
-
```typescript
-await client.eventStreams.test("id", {
- event_type: "user.created",
+await client.emailTemplates.set("verify_email", {
+ template: "verify_email",
});
```
@@ -3164,7 +3249,7 @@ await client.eventStreams.test("id", {
-
-**id:** `string` — Unique identifier for the event stream.
+**templateName:** `Management.EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy).
@@ -3172,7 +3257,7 @@ await client.eventStreams.test("id", {
-
-**request:** `Management.CreateEventStreamTestEventRequestContent`
+**request:** `Management.SetEmailTemplateRequestContent`
@@ -3180,7 +3265,7 @@ await client.eventStreams.test("id", {
-
-**requestOptions:** `EventStreams.RequestOptions`
+**requestOptions:** `EmailTemplatesClient.RequestOptions`
@@ -3191,12 +3276,25 @@ await client.eventStreams.test("id", {
-## Flows
+client.emailTemplates.update(templateName, { ...params }) -> Management.UpdateEmailTemplateResponseContent
+
+-
+
+#### 📝 Description
+
+
+-
-
client.flows.list({ ...params }) -> core.Page
-
+Modify an email template.
+
+
+
+
+
+
#### 🔌 Usage
@@ -3206,29 +3304,7 @@ await client.eventStreams.test("id", {
-
```typescript
-const pageableResponse = await client.flows.list({
- page: 1,
- per_page: 1,
- include_totals: true,
- synchronous: true,
-});
-for await (const item of pageableResponse) {
- console.log(item);
-}
-
-// Or you can manually iterate page-by-page
-let page = await client.flows.list({
- page: 1,
- per_page: 1,
- include_totals: true,
- synchronous: true,
-});
-while (page.hasNextPage()) {
- page = page.getNextPage();
-}
-
-// You can also access the underlying response
-const response = page.response;
+await client.emailTemplates.update("verify_email");
```
@@ -3244,7 +3320,15 @@ const response = page.response;
-
-**request:** `Management.FlowsListRequest`
+**templateName:** `Management.EmailTemplateNameEnum` — Template name. Can be `verify_email`, `verify_email_by_code`, `reset_email`, `reset_email_by_code`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `user_invitation`, `async_approval`, `change_password` (legacy), or `password_reset` (legacy).
+
+
+
+
+
+-
+
+**request:** `Management.UpdateEmailTemplateRequestContent`
@@ -3252,7 +3336,7 @@ const response = page.response;
-
-**requestOptions:** `Flows.RequestOptions`
+**requestOptions:** `EmailTemplatesClient.RequestOptions`
@@ -3263,7 +3347,9 @@ const response = page.response;
-client.flows.create({ ...params }) -> Management.CreateFlowResponseContent
+## EventStreams
+
+client.eventStreams.list({ ...params }) -> Management.EventStreamResponseContent[]
-
@@ -3276,8 +3362,9 @@ const response = page.response;
-
```typescript
-await client.flows.create({
- name: "name",
+await client.eventStreams.list({
+ from: "from",
+ take: 1,
});
```
@@ -3294,7 +3381,7 @@ await client.flows.create({
-
-**request:** `Management.CreateFlowRequestContent`
+**request:** `Management.ListEventStreamsRequestParameters`
@@ -3302,7 +3389,7 @@ await client.flows.create({
-
-**requestOptions:** `Flows.RequestOptions`
+**requestOptions:** `EventStreamsClient.RequestOptions`
@@ -3313,7 +3400,7 @@ await client.flows.create({
-client.flows.get(id, { ...params }) -> Management.GetFlowResponseContent
+client.eventStreams.create({ ...params }) -> Management.CreateEventStreamResponseContent
-
@@ -3326,7 +3413,18 @@ await client.flows.create({
-
```typescript
-await client.flows.get("id");
+await client.eventStreams.create({
+ destination: {
+ type: "webhook",
+ configuration: {
+ webhook_endpoint: "webhook_endpoint",
+ webhook_authorization: {
+ method: "basic",
+ username: "username",
+ },
+ },
+ },
+});
```
@@ -3342,15 +3440,7 @@ await client.flows.get("id");
-
-**id:** `string` — Flow identifier
-
-
-
-
-
--
-
-**request:** `Management.GetFlowRequestParameters`
+**request:** `Management.EventStreamsCreateRequest`
@@ -3358,7 +3448,7 @@ await client.flows.get("id");
-
-**requestOptions:** `Flows.RequestOptions`
+**requestOptions:** `EventStreamsClient.RequestOptions`
@@ -3369,7 +3459,7 @@ await client.flows.get("id");
-client.flows.delete(id) -> void
+client.eventStreams.get(id) -> Management.GetEventStreamResponseContent
-
@@ -3382,7 +3472,7 @@ await client.flows.get("id");
-
```typescript
-await client.flows.delete("id");
+await client.eventStreams.get("id");
```
@@ -3398,7 +3488,7 @@ await client.flows.delete("id");
-
-**id:** `string` — Flow id
+**id:** `string` — Unique identifier for the event stream.
@@ -3406,7 +3496,7 @@ await client.flows.delete("id");
-
-**requestOptions:** `Flows.RequestOptions`
+**requestOptions:** `EventStreamsClient.RequestOptions`
@@ -3417,7 +3507,7 @@ await client.flows.delete("id");
-client.flows.update(id, { ...params }) -> Management.UpdateFlowResponseContent
+client.eventStreams.delete(id) -> void
-
@@ -3430,7 +3520,7 @@ await client.flows.delete("id");
-
```typescript
-await client.flows.update("id");
+await client.eventStreams.delete("id");
```
@@ -3446,15 +3536,7 @@ await client.flows.update("id");
-
-**id:** `string` — Flow identifier
-
-
-
-
-
--
-
-**request:** `Management.UpdateFlowRequestContent`
+**id:** `string` — Unique identifier for the event stream.
@@ -3462,7 +3544,7 @@ await client.flows.update("id");
-
-**requestOptions:** `Flows.RequestOptions`
+**requestOptions:** `EventStreamsClient.RequestOptions`
@@ -3473,9 +3555,7 @@ await client.flows.update("id");
-## Forms
-
-client.forms.list({ ...params }) -> core.Page
+client.eventStreams.update(id, { ...params }) -> Management.UpdateEventStreamResponseContent
-
@@ -3488,27 +3568,7 @@ await client.flows.update("id");
-
```typescript
-const pageableResponse = await client.forms.list({
- page: 1,
- per_page: 1,
- include_totals: true,
-});
-for await (const item of pageableResponse) {
- console.log(item);
-}
-
-// Or you can manually iterate page-by-page
-let page = await client.forms.list({
- page: 1,
- per_page: 1,
- include_totals: true,
-});
-while (page.hasNextPage()) {
- page = page.getNextPage();
-}
-
-// You can also access the underlying response
-const response = page.response;
+await client.eventStreams.update("id");
```
@@ -3524,57 +3584,15 @@ const response = page.response;
-
-**request:** `Management.ListFormsRequestParameters`
-
-
-
-
-
--
-
-**requestOptions:** `Forms.RequestOptions`
-
-
-
-
-
-
-
-
-
-
-client.forms.create({ ...params }) -> Management.CreateFormResponseContent
-
--
-
-#### 🔌 Usage
-
-
--
-
-
--
-
-```typescript
-await client.forms.create({
- name: "name",
-});
-```
+**id:** `string` — Unique identifier for the event stream.
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-**request:** `Management.CreateFormRequestContent`
+**request:** `Management.UpdateEventStreamRequestContent`
@@ -3582,7 +3600,7 @@ await client.forms.create({
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `EventStreamsClient.RequestOptions`
@@ -3593,7 +3611,7 @@ await client.forms.create({
-client.forms.get(id, { ...params }) -> Management.GetFormResponseContent
+client.eventStreams.test(id, { ...params }) -> Management.CreateEventStreamTestEventResponseContent
-
@@ -3606,7 +3624,9 @@ await client.forms.create({
-
```typescript
-await client.forms.get("id");
+await client.eventStreams.test("id", {
+ event_type: "user.created",
+});
```
@@ -3622,7 +3642,7 @@ await client.forms.get("id");
-
-**id:** `string` — The ID of the form to retrieve.
+**id:** `string` — Unique identifier for the event stream.
@@ -3630,7 +3650,7 @@ await client.forms.get("id");
-
-**request:** `Management.GetFormRequestParameters`
+**request:** `Management.CreateEventStreamTestEventRequestContent`
@@ -3638,7 +3658,7 @@ await client.forms.get("id");
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `EventStreamsClient.RequestOptions`
@@ -3649,7 +3669,9 @@ await client.forms.get("id");
-client.forms.delete(id) -> void
+## Flows
+
+client.flows.list({ ...params }) -> core.Page
-
@@ -3662,7 +3684,29 @@ await client.forms.get("id");
-
```typescript
-await client.forms.delete("id");
+const pageableResponse = await client.flows.list({
+ page: 1,
+ per_page: 1,
+ include_totals: true,
+ synchronous: true,
+});
+for await (const item of pageableResponse) {
+ console.log(item);
+}
+
+// Or you can manually iterate page-by-page
+let page = await client.flows.list({
+ page: 1,
+ per_page: 1,
+ include_totals: true,
+ synchronous: true,
+});
+while (page.hasNextPage()) {
+ page = page.getNextPage();
+}
+
+// You can also access the underlying response
+const response = page.response;
```
@@ -3678,7 +3722,7 @@ await client.forms.delete("id");
-
-**id:** `string` — The ID of the form to delete.
+**request:** `Management.FlowsListRequest`
@@ -3686,7 +3730,7 @@ await client.forms.delete("id");
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FlowsClient.RequestOptions`
@@ -3697,7 +3741,7 @@ await client.forms.delete("id");
-client.forms.update(id, { ...params }) -> Management.UpdateFormResponseContent
+client.flows.create({ ...params }) -> Management.CreateFlowResponseContent
-
@@ -3710,7 +3754,9 @@ await client.forms.delete("id");
-
```typescript
-await client.forms.update("id");
+await client.flows.create({
+ name: "name",
+});
```
@@ -3726,15 +3772,7 @@ await client.forms.update("id");
-
-**id:** `string` — The ID of the form to update.
-
-
-
-
-
--
-
-**request:** `Management.UpdateFormRequestContent`
+**request:** `Management.CreateFlowRequestContent`
@@ -3742,7 +3780,7 @@ await client.forms.update("id");
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FlowsClient.RequestOptions`
@@ -3753,13 +3791,11 @@ await client.forms.update("id");
-## UserGrants
-
-client.userGrants.list({ ...params }) -> core.Page
+client.flows.get(id, { ...params }) -> Management.GetFlowResponseContent
-
-#### 📝 Description
+#### 🔌 Usage
-
@@ -3767,14 +3803,16 @@ await client.forms.update("id");
-
-Retrieve the grants associated with your account.
+```typescript
+await client.flows.get("id");
+```
-#### 🔌 Usage
+#### ⚙️ Parameters
-
@@ -3782,50 +3820,15 @@ Retrieve the g
-
-```typescript
-const pageableResponse = await client.userGrants.list({
- per_page: 1,
- page: 1,
- include_totals: true,
- user_id: "user_id",
- client_id: "client_id",
- audience: "audience",
-});
-for await (const item of pageableResponse) {
- console.log(item);
-}
-
-// Or you can manually iterate page-by-page
-let page = await client.userGrants.list({
- per_page: 1,
- page: 1,
- include_totals: true,
- user_id: "user_id",
- client_id: "client_id",
- audience: "audience",
-});
-while (page.hasNextPage()) {
- page = page.getNextPage();
-}
-
-// You can also access the underlying response
-const response = page.response;
-```
+**id:** `string` — Flow identifier
-
-
-#### ⚙️ Parameters
-
-
--
-
-
-**request:** `Management.ListUserGrantsRequestParameters`
+**request:** `Management.GetFlowRequestParameters`
@@ -3833,7 +3836,7 @@ const response = page.response;
-
-**requestOptions:** `UserGrants.RequestOptions`
+**requestOptions:** `FlowsClient.RequestOptions`
@@ -3844,25 +3847,10 @@ const response = page.response;
-client.userGrants.deleteByUserId({ ...params }) -> void
-
--
-
-#### 📝 Description
-
-
--
-
+
client.flows.delete(id) -> void
-
-Delete a grant associated with your account.
-
-
-
-
-
-
#### 🔌 Usage
@@ -3872,9 +3860,7 @@ Delete a grant associated with your account.
-
```typescript
-await client.userGrants.deleteByUserId({
- user_id: "user_id",
-});
+await client.flows.delete("id");
```
@@ -3890,7 +3876,7 @@ await client.userGrants.deleteByUserId({
-
-**request:** `Management.DeleteUserGrantByUserIdRequestParameters`
+**id:** `string` — Flow id
@@ -3898,7 +3884,7 @@ await client.userGrants.deleteByUserId({
-
-**requestOptions:** `UserGrants.RequestOptions`
+**requestOptions:** `FlowsClient.RequestOptions`
@@ -3909,11 +3895,11 @@ await client.userGrants.deleteByUserId({
-client.userGrants.delete(id) -> void
+client.flows.update(id, { ...params }) -> Management.UpdateFlowResponseContent
-
-#### 📝 Description
+#### 🔌 Usage
-
@@ -3921,14 +3907,16 @@ await client.userGrants.deleteByUserId({
-
-Delete a grant associated with your account.
+```typescript
+await client.flows.update("id");
+```
-#### 🔌 Usage
+#### ⚙️ Parameters
-
@@ -3936,24 +3924,15 @@ Delete a grant associated with your account.
-
-```typescript
-await client.userGrants.delete("id");
-```
+**id:** `string` — Flow identifier
-
-
-
-#### ⚙️ Parameters
-
-
--
-
-**id:** `string` — ID of the grant to delete.
+**request:** `Management.UpdateFlowRequestContent`
@@ -3961,7 +3940,7 @@ await client.userGrants.delete("id");
-
-**requestOptions:** `UserGrants.RequestOptions`
+**requestOptions:** `FlowsClient.RequestOptions`
@@ -3972,27 +3951,12 @@ await client.userGrants.delete("id");
-## Hooks
-
-client.hooks.list({ ...params }) -> core.Page
-
--
-
-#### 📝 Description
-
-
--
+## Forms
+
client.forms.list({ ...params }) -> core.Page
-
-Retrieve all hooks. Accepts a list of fields to include or exclude in the result.
-
-
-
-
-
-
#### 🔌 Usage
@@ -4002,26 +3966,20 @@ Retrieve all hooks. Accepts a list of
-
```typescript
-const pageableResponse = await client.hooks.list({
+const pageableResponse = await client.forms.list({
page: 1,
per_page: 1,
include_totals: true,
- enabled: true,
- fields: "fields",
- triggerId: "credentials-exchange",
});
for await (const item of pageableResponse) {
console.log(item);
}
// Or you can manually iterate page-by-page
-let page = await client.hooks.list({
+let page = await client.forms.list({
page: 1,
per_page: 1,
include_totals: true,
- enabled: true,
- fields: "fields",
- triggerId: "credentials-exchange",
});
while (page.hasNextPage()) {
page = page.getNextPage();
@@ -4044,7 +4002,7 @@ const response = page.response;
-
-**request:** `Management.ListHooksRequestParameters`
+**request:** `Management.ListFormsRequestParameters`
@@ -4052,7 +4010,7 @@ const response = page.response;
-
-**requestOptions:** `Hooks.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -4063,25 +4021,10 @@ const response = page.response;
-client.hooks.create({ ...params }) -> Management.CreateHookResponseContent
-
--
-
-#### 📝 Description
-
-
--
-
+
client.forms.create({ ...params }) -> Management.CreateFormResponseContent
-
-Create a new hook.
-
-
-
-
-
-
#### 🔌 Usage
@@ -4091,10 +4034,8 @@ Create a new hook.
-
```typescript
-await client.hooks.create({
+await client.forms.create({
name: "name",
- script: "script",
- triggerId: "credentials-exchange",
});
```
@@ -4111,7 +4052,7 @@ await client.hooks.create({
-
-**request:** `Management.CreateHookRequestContent`
+**request:** `Management.CreateFormRequestContent`
@@ -4119,7 +4060,7 @@ await client.hooks.create({
-
-**requestOptions:** `Hooks.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -4130,11 +4071,11 @@ await client.hooks.create({
-client.hooks.get(id, { ...params }) -> Management.GetHookResponseContent
+client.forms.get(id, { ...params }) -> Management.GetFormResponseContent
-
-#### 📝 Description
+#### 🔌 Usage
-
@@ -4142,7 +4083,544 @@ await client.hooks.create({
-
-Retrieve a hook by its ID. Accepts a list of fields to include in the result.
+```typescript
+await client.forms.get("id");
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `string` — The ID of the form to retrieve.
+
+
+
+
+
+-
+
+**request:** `Management.GetFormRequestParameters`
+
+
+
+
+
+-
+
+**requestOptions:** `FormsClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+client.forms.delete(id) -> void
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.forms.delete("id");
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `string` — The ID of the form to delete.
+
+
+
+
+
+-
+
+**requestOptions:** `FormsClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+client.forms.update(id, { ...params }) -> Management.UpdateFormResponseContent
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.forms.update("id");
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `string` — The ID of the form to update.
+
+
+
+
+
+-
+
+**request:** `Management.UpdateFormRequestContent`
+
+
+
+
+
+-
+
+**requestOptions:** `FormsClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+## UserGrants
+
+client.userGrants.list({ ...params }) -> core.Page
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve the grants associated with your account.
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+const pageableResponse = await client.userGrants.list({
+ per_page: 1,
+ page: 1,
+ include_totals: true,
+ user_id: "user_id",
+ client_id: "client_id",
+ audience: "audience",
+});
+for await (const item of pageableResponse) {
+ console.log(item);
+}
+
+// Or you can manually iterate page-by-page
+let page = await client.userGrants.list({
+ per_page: 1,
+ page: 1,
+ include_totals: true,
+ user_id: "user_id",
+ client_id: "client_id",
+ audience: "audience",
+});
+while (page.hasNextPage()) {
+ page = page.getNextPage();
+}
+
+// You can also access the underlying response
+const response = page.response;
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `Management.ListUserGrantsRequestParameters`
+
+
+
+
+
+-
+
+**requestOptions:** `UserGrantsClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+client.userGrants.deleteByUserId({ ...params }) -> void
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete a grant associated with your account.
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.userGrants.deleteByUserId({
+ user_id: "user_id",
+});
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `Management.DeleteUserGrantByUserIdRequestParameters`
+
+
+
+
+
+-
+
+**requestOptions:** `UserGrantsClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+client.userGrants.delete(id) -> void
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete a grant associated with your account.
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.userGrants.delete("id");
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `string` — ID of the grant to delete.
+
+
+
+
+
+-
+
+**requestOptions:** `UserGrantsClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+## Hooks
+
+client.hooks.list({ ...params }) -> core.Page
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve all hooks. Accepts a list of fields to include or exclude in the result.
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+const pageableResponse = await client.hooks.list({
+ page: 1,
+ per_page: 1,
+ include_totals: true,
+ enabled: true,
+ fields: "fields",
+ triggerId: "credentials-exchange",
+});
+for await (const item of pageableResponse) {
+ console.log(item);
+}
+
+// Or you can manually iterate page-by-page
+let page = await client.hooks.list({
+ page: 1,
+ per_page: 1,
+ include_totals: true,
+ enabled: true,
+ fields: "fields",
+ triggerId: "credentials-exchange",
+});
+while (page.hasNextPage()) {
+ page = page.getNextPage();
+}
+
+// You can also access the underlying response
+const response = page.response;
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `Management.ListHooksRequestParameters`
+
+
+
+
+
+-
+
+**requestOptions:** `HooksClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+client.hooks.create({ ...params }) -> Management.CreateHookResponseContent
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a new hook.
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.hooks.create({
+ name: "name",
+ script: "script",
+ triggerId: "credentials-exchange",
+});
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `Management.CreateHookRequestContent`
+
+
+
+
+
+-
+
+**requestOptions:** `HooksClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+client.hooks.get(id, { ...params }) -> Management.GetHookResponseContent
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a hook by its ID. Accepts a list of fields to include in the result.
@@ -4192,7 +4670,7 @@ await client.hooks.get("id", {
-
-**requestOptions:** `Hooks.RequestOptions`
+**requestOptions:** `HooksClient.RequestOptions`
@@ -4255,7 +4733,7 @@ await client.hooks.delete("id");
-
-**requestOptions:** `Hooks.RequestOptions`
+**requestOptions:** `HooksClient.RequestOptions`
@@ -4326,7 +4804,7 @@ await client.hooks.update("id");
-
-**requestOptions:** `Hooks.RequestOptions`
+**requestOptions:** `HooksClient.RequestOptions`
@@ -4391,7 +4869,7 @@ await client.jobs.get("id");
-
-**requestOptions:** `Jobs.RequestOptions`
+**requestOptions:** `JobsClient.RequestOptions`
@@ -4513,7 +4991,7 @@ await client.logStreams.list();
-
-**requestOptions:** `LogStreams.RequestOptions`
+**requestOptions:** `LogStreamsClient.RequestOptions`
@@ -4706,7 +5184,7 @@ await client.logStreams.create({
-
-**requestOptions:** `LogStreams.RequestOptions`
+**requestOptions:** `LogStreamsClient.RequestOptions`
@@ -4867,7 +5345,7 @@ await client.logStreams.get("id");
-
-**requestOptions:** `LogStreams.RequestOptions`
+**requestOptions:** `LogStreamsClient.RequestOptions`
@@ -4930,7 +5408,7 @@ await client.logStreams.delete("id");
-
-**requestOptions:** `LogStreams.RequestOptions`
+**requestOptions:** `LogStreamsClient.RequestOptions`
@@ -5035,7 +5513,7 @@ await client.logStreams.update("id");
-
-**requestOptions:** `LogStreams.RequestOptions`
+**requestOptions:** `LogStreamsClient.RequestOptions`
@@ -5156,7 +5634,7 @@ const response = page.response;
-
-**requestOptions:** `Logs.RequestOptions`
+**requestOptions:** `LogsClient.RequestOptions`
@@ -5219,7 +5697,7 @@ await client.logs.get("id");
-
-**requestOptions:** `Logs.RequestOptions`
+**requestOptions:** `LogsClient.RequestOptions`
@@ -5304,7 +5782,7 @@ const response = page.response;
-
-**requestOptions:** `NetworkAcls.RequestOptions`
+**requestOptions:** `NetworkAclsClient.RequestOptions`
@@ -5375,7 +5853,7 @@ await client.networkAcls.create({
-
-**requestOptions:** `NetworkAcls.RequestOptions`
+**requestOptions:** `NetworkAclsClient.RequestOptions`
@@ -5438,7 +5916,7 @@ await client.networkAcls.get("id");
-
-**requestOptions:** `NetworkAcls.RequestOptions`
+**requestOptions:** `NetworkAclsClient.RequestOptions`
@@ -5517,7 +5995,7 @@ await client.networkAcls.set("id", {
-
-**requestOptions:** `NetworkAcls.RequestOptions`
+**requestOptions:** `NetworkAclsClient.RequestOptions`
@@ -5580,7 +6058,7 @@ await client.networkAcls.delete("id");
-
-**requestOptions:** `NetworkAcls.RequestOptions`
+**requestOptions:** `NetworkAclsClient.RequestOptions`
@@ -5651,7 +6129,7 @@ await client.networkAcls.update("id");
-
-**requestOptions:** `NetworkAcls.RequestOptions`
+**requestOptions:** `NetworkAclsClient.RequestOptions`
@@ -5756,7 +6234,7 @@ const response = page.response;
-
-**requestOptions:** `Organizations.RequestOptions`
+**requestOptions:** `OrganizationsClient.RequestOptions`
@@ -5821,7 +6299,7 @@ await client.organizations.create({
-
-**requestOptions:** `Organizations.RequestOptions`
+**requestOptions:** `OrganizationsClient.RequestOptions`
@@ -5884,7 +6362,7 @@ await client.organizations.getByName("name");
-
-**requestOptions:** `Organizations.RequestOptions`
+**requestOptions:** `OrganizationsClient.RequestOptions`
@@ -5947,7 +6425,7 @@ await client.organizations.get("id");
-
-**requestOptions:** `Organizations.RequestOptions`
+**requestOptions:** `OrganizationsClient.RequestOptions`
@@ -6012,7 +6490,7 @@ await client.organizations.delete("id");
-
-**requestOptions:** `Organizations.RequestOptions`
+**requestOptions:** `OrganizationsClient.RequestOptions`
@@ -6083,7 +6561,7 @@ await client.organizations.update("id");
-
-**requestOptions:** `Organizations.RequestOptions`
+**requestOptions:** `OrganizationsClient.RequestOptions`
@@ -6140,7 +6618,7 @@ await client.prompts.getSettings();
-
-**requestOptions:** `Prompts.RequestOptions`
+**requestOptions:** `PromptsClient.RequestOptions`
@@ -6203,7 +6681,7 @@ await client.prompts.updateSettings();
-
-**requestOptions:** `Prompts.RequestOptions`
+**requestOptions:** `PromptsClient.RequestOptions`
@@ -6268,7 +6746,7 @@ await client.refreshTokens.get("id");
-
-**requestOptions:** `RefreshTokens.RequestOptions`
+**requestOptions:** `RefreshTokensClient.RequestOptions`
@@ -6331,7 +6809,7 @@ await client.refreshTokens.delete("id");
-
-**requestOptions:** `RefreshTokens.RequestOptions`
+**requestOptions:** `RefreshTokensClient.RequestOptions`
@@ -6418,7 +6896,7 @@ const response = page.response;
-
-**requestOptions:** `ResourceServers.RequestOptions`
+**requestOptions:** `ResourceServersClient.RequestOptions`
@@ -6483,7 +6961,7 @@ await client.resourceServers.create({
-
-**requestOptions:** `ResourceServers.RequestOptions`
+**requestOptions:** `ResourceServersClient.RequestOptions`
@@ -6556,7 +7034,7 @@ await client.resourceServers.get("id", {
-
-**requestOptions:** `ResourceServers.RequestOptions`
+**requestOptions:** `ResourceServersClient.RequestOptions`
@@ -6619,7 +7097,7 @@ await client.resourceServers.delete("id");
-
-**requestOptions:** `ResourceServers.RequestOptions`
+**requestOptions:** `ResourceServersClient.RequestOptions`
@@ -6690,7 +7168,7 @@ await client.resourceServers.update("id");
-
-**requestOptions:** `ResourceServers.RequestOptions`
+**requestOptions:** `ResourceServersClient.RequestOptions`
@@ -6779,7 +7257,7 @@ const response = page.response;
-
-**requestOptions:** `Roles.RequestOptions`
+**requestOptions:** `RolesClient.RequestOptions`
@@ -6846,7 +7324,7 @@ await client.roles.create({
-
-**requestOptions:** `Roles.RequestOptions`
+**requestOptions:** `RolesClient.RequestOptions`
@@ -6909,7 +7387,7 @@ await client.roles.get("id");
-
-**requestOptions:** `Roles.RequestOptions`
+**requestOptions:** `RolesClient.RequestOptions`
@@ -6972,7 +7450,7 @@ await client.roles.delete("id");
-
-**requestOptions:** `Roles.RequestOptions`
+**requestOptions:** `RolesClient.RequestOptions`
@@ -7043,7 +7521,7 @@ await client.roles.update("id");
-
-**requestOptions:** `Roles.RequestOptions`
+**requestOptions:** `RolesClient.RequestOptions`
@@ -7134,7 +7612,7 @@ const response = page.response;
-
-**requestOptions:** `Rules.RequestOptions`
+**requestOptions:** `RulesClient.RequestOptions`
@@ -7202,7 +7680,7 @@ await client.rules.create({
-
-**requestOptions:** `Rules.RequestOptions`
+**requestOptions:** `RulesClient.RequestOptions`
@@ -7276,7 +7754,7 @@ await client.rules.get("id", {
-
-**requestOptions:** `Rules.RequestOptions`
+**requestOptions:** `RulesClient.RequestOptions`
@@ -7339,7 +7817,7 @@ await client.rules.delete("id");
-
-**requestOptions:** `Rules.RequestOptions`
+**requestOptions:** `RulesClient.RequestOptions`
@@ -7410,7 +7888,7 @@ await client.rules.update("id");
-
-**requestOptions:** `Rules.RequestOptions`
+**requestOptions:** `RulesClient.RequestOptions`
@@ -7469,7 +7947,7 @@ await client.rulesConfigs.list();
-
-**requestOptions:** `RulesConfigs.RequestOptions`
+**requestOptions:** `RulesConfigsClient.RequestOptions`
@@ -7542,7 +8020,7 @@ await client.rulesConfigs.set("key", {
-
-**requestOptions:** `RulesConfigs.RequestOptions`
+**requestOptions:** `RulesConfigsClient.RequestOptions`
@@ -7605,7 +8083,7 @@ await client.rulesConfigs.delete("key");
-
-**requestOptions:** `RulesConfigs.RequestOptions`
+**requestOptions:** `RulesConfigsClient.RequestOptions`
@@ -7690,7 +8168,7 @@ const response = page.response;
-
-**requestOptions:** `SelfServiceProfiles.RequestOptions`
+**requestOptions:** `SelfServiceProfilesClient.RequestOptions`
@@ -7755,7 +8233,7 @@ await client.selfServiceProfiles.create({
-
-**requestOptions:** `SelfServiceProfiles.RequestOptions`
+**requestOptions:** `SelfServiceProfilesClient.RequestOptions`
@@ -7818,7 +8296,7 @@ await client.selfServiceProfiles.get("id");
-
-**requestOptions:** `SelfServiceProfiles.RequestOptions`
+**requestOptions:** `SelfServiceProfilesClient.RequestOptions`
@@ -7881,7 +8359,7 @@ await client.selfServiceProfiles.delete("id");
-
-**requestOptions:** `SelfServiceProfiles.RequestOptions`
+**requestOptions:** `SelfServiceProfilesClient.RequestOptions`
@@ -7952,7 +8430,7 @@ await client.selfServiceProfiles.update("id");
-
-**requestOptions:** `SelfServiceProfiles.RequestOptions`
+**requestOptions:** `SelfServiceProfilesClient.RequestOptions`
@@ -8017,7 +8495,7 @@ await client.sessions.get("id");
-
-**requestOptions:** `Sessions.RequestOptions`
+**requestOptions:** `SessionsClient.RequestOptions`
@@ -8080,7 +8558,7 @@ await client.sessions.delete("id");
-
-**requestOptions:** `Sessions.RequestOptions`
+**requestOptions:** `SessionsClient.RequestOptions`
@@ -8151,7 +8629,7 @@ await client.sessions.update("id");
-
-**requestOptions:** `Sessions.RequestOptions`
+**requestOptions:** `SessionsClient.RequestOptions`
@@ -8214,7 +8692,7 @@ await client.sessions.revoke("id");
-
-**requestOptions:** `Sessions.RequestOptions`
+**requestOptions:** `SessionsClient.RequestOptions`
@@ -8271,7 +8749,7 @@ await client.stats.getActiveUsersCount();
-
-**requestOptions:** `Stats.RequestOptions`
+**requestOptions:** `StatsClient.RequestOptions`
@@ -8337,7 +8815,7 @@ await client.stats.getDaily({
-
-**requestOptions:** `Stats.RequestOptions`
+**requestOptions:** `StatsClient.RequestOptions`
@@ -8394,7 +8872,7 @@ await client.supplementalSignals.get();
-
-**requestOptions:** `SupplementalSignals.RequestOptions`
+**requestOptions:** `SupplementalSignalsClient.RequestOptions`
@@ -8459,7 +8937,7 @@ await client.supplementalSignals.patch({
-
-**requestOptions:** `SupplementalSignals.RequestOptions`
+**requestOptions:** `SupplementalSignalsClient.RequestOptions`
@@ -8526,7 +9004,7 @@ await client.tickets.verifyEmail({
-
-**requestOptions:** `Tickets.RequestOptions`
+**requestOptions:** `TicketsClient.RequestOptions`
@@ -8591,7 +9069,7 @@ await client.tickets.changePassword();
-
-**requestOptions:** `Tickets.RequestOptions`
+**requestOptions:** `TicketsClient.RequestOptions`
@@ -8618,6 +9096,8 @@ await client.tickets.changePassword();
Retrieve a list of all Token Exchange Profiles available in your tenant.
+By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details.
+
This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters:
@@ -8683,7 +9163,7 @@ const response = page.response;
-
-**requestOptions:** `TokenExchangeProfiles.RequestOptions`
+**requestOptions:** `TokenExchangeProfilesClient.RequestOptions`
@@ -8708,6 +9188,8 @@ const response = page.response;
Create a new Token Exchange Profile within your tenant.
+By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details.
+
@@ -8750,7 +9232,7 @@ await client.tokenExchangeProfiles.create({
-
-**requestOptions:** `TokenExchangeProfiles.RequestOptions`
+**requestOptions:** `TokenExchangeProfilesClient.RequestOptions`
@@ -8775,6 +9257,8 @@ await client.tokenExchangeProfiles.create({
Retrieve details about a single Token Exchange Profile specified by ID.
+By using this feature, you agree to the applicable Free Trial terms in Okta’s Master Subscription Agreement. It is your responsibility to securely validate the user’s subject_token. See User Guide for more details.
+
@@ -8813,7 +9297,7 @@ await client.tokenExchangeProfiles.get("id");
-
-**requestOptions:** `TokenExchangeProfiles.RequestOptions`
+**requestOptions:** `TokenExchangeProfilesClient.RequestOptions`
@@ -8838,6 +9322,8 @@ await client.tokenExchangeProfiles.get("id");
Delete a Token Exchange Profile within your tenant.
+By using this feature, you agree to the applicable Free Trial terms in Okta's Master Subscription Agreement. It is your responsibility to securely validate the user's subject_token. See User Guide for more details.
+
@@ -8876,7 +9362,7 @@ await client.tokenExchangeProfiles.delete("id");
-
-**requestOptions:** `TokenExchangeProfiles.RequestOptions`
+**requestOptions:** `TokenExchangeProfilesClient.RequestOptions`
@@ -8901,6 +9387,8 @@ await client.tokenExchangeProfiles.delete("id");
Update a Token Exchange Profile within your tenant.
+By using this feature, you agree to the applicable Free Trial terms in Okta's Master Subscription Agreement. It is your responsibility to securely validate the user's subject_token. See User Guide for more details.
+
@@ -8947,7 +9435,7 @@ await client.tokenExchangeProfiles.update("id");
-
-**requestOptions:** `TokenExchangeProfiles.RequestOptions`
+**requestOptions:** `TokenExchangeProfilesClient.RequestOptions`
@@ -9030,7 +9518,7 @@ const response = page.response;
-
-**requestOptions:** `UserAttributeProfiles.RequestOptions`
+**requestOptions:** `UserAttributeProfilesClient.RequestOptions`
@@ -9103,7 +9591,7 @@ await client.userAttributeProfiles.create({
-
-**requestOptions:** `UserAttributeProfiles.RequestOptions`
+**requestOptions:** `UserAttributeProfilesClient.RequestOptions`
@@ -9158,7 +9646,7 @@ await client.userAttributeProfiles.listTemplates();
-
-**requestOptions:** `UserAttributeProfiles.RequestOptions`
+**requestOptions:** `UserAttributeProfilesClient.RequestOptions`
@@ -9221,7 +9709,7 @@ await client.userAttributeProfiles.getTemplate("id");
-
-**requestOptions:** `UserAttributeProfiles.RequestOptions`
+**requestOptions:** `UserAttributeProfilesClient.RequestOptions`
@@ -9284,7 +9772,7 @@ await client.userAttributeProfiles.get("id");
-
-**requestOptions:** `UserAttributeProfiles.RequestOptions`
+**requestOptions:** `UserAttributeProfilesClient.RequestOptions`
@@ -9347,7 +9835,7 @@ await client.userAttributeProfiles.delete("id");
-
-**requestOptions:** `UserAttributeProfiles.RequestOptions`
+**requestOptions:** `UserAttributeProfilesClient.RequestOptions`
@@ -9418,7 +9906,7 @@ await client.userAttributeProfiles.update("id");
-
-**requestOptions:** `UserAttributeProfiles.RequestOptions`
+**requestOptions:** `UserAttributeProfilesClient.RequestOptions`
@@ -9486,7 +9974,7 @@ await client.userBlocks.listByIdentifier({
-
-**requestOptions:** `UserBlocks.RequestOptions`
+**requestOptions:** `UserBlocksClient.RequestOptions`
@@ -9553,7 +10041,7 @@ await client.userBlocks.deleteByIdentifier({
-
-**requestOptions:** `UserBlocks.RequestOptions`
+**requestOptions:** `UserBlocksClient.RequestOptions`
@@ -9626,7 +10114,7 @@ await client.userBlocks.list("id", {
-
-**requestOptions:** `UserBlocks.RequestOptions`
+**requestOptions:** `UserBlocksClient.RequestOptions`
@@ -9691,7 +10179,7 @@ await client.userBlocks.delete("id");
-
-**requestOptions:** `UserBlocks.RequestOptions`
+**requestOptions:** `UserBlocksClient.RequestOptions`
@@ -9803,7 +10291,7 @@ const response = page.response;
-
-**requestOptions:** `Users.RequestOptions`
+**requestOptions:** `UsersClient.RequestOptions`
@@ -9870,7 +10358,7 @@ await client.users.create({
-
-**requestOptions:** `Users.RequestOptions`
+**requestOptions:** `UsersClient.RequestOptions`
@@ -9941,7 +10429,7 @@ await client.users.listUsersByEmail({
-
-**requestOptions:** `Users.RequestOptions`
+**requestOptions:** `UsersClient.RequestOptions`
@@ -10015,7 +10503,7 @@ await client.users.get("id", {
-
-**requestOptions:** `Users.RequestOptions`
+**requestOptions:** `UsersClient.RequestOptions`
@@ -10078,7 +10566,7 @@ await client.users.delete("id");
-
-**requestOptions:** `Users.RequestOptions`
+**requestOptions:** `UsersClient.RequestOptions`
@@ -10220,7 +10708,7 @@ await client.users.update("id");
-
-**requestOptions:** `Users.RequestOptions`
+**requestOptions:** `UsersClient.RequestOptions`
@@ -10283,7 +10771,7 @@ await client.users.regenerateRecoveryCode("id");
-
-**requestOptions:** `Users.RequestOptions`
+**requestOptions:** `UsersClient.RequestOptions`
@@ -10354,7 +10842,7 @@ await client.users.revokeAccess("id");
-
-**requestOptions:** `Users.RequestOptions`
+**requestOptions:** `UsersClient.RequestOptions`
@@ -10445,7 +10933,7 @@ const response = page.response;
-
-**requestOptions:** `Versions.RequestOptions`
+**requestOptions:** `VersionsClient.RequestOptions`
@@ -10516,7 +11004,7 @@ await client.actions.versions.get("actionId", "id");
-
-**requestOptions:** `Versions.RequestOptions`
+**requestOptions:** `VersionsClient.RequestOptions`
@@ -10595,7 +11083,7 @@ await client.actions.versions.deploy("actionId", "id");
-
-**requestOptions:** `Versions.RequestOptions`
+**requestOptions:** `VersionsClient.RequestOptions`
@@ -10660,7 +11148,7 @@ await client.actions.executions.get("id");
-
-**requestOptions:** `Executions.RequestOptions`
+**requestOptions:** `ExecutionsClient.RequestOptions`
@@ -10717,7 +11205,7 @@ await client.actions.triggers.list();
-
-**requestOptions:** `Triggers.RequestOptions`
+**requestOptions:** `TriggersClient.RequestOptions`
@@ -10808,7 +11296,7 @@ const response = page.response;
-
-**requestOptions:** `Bindings.RequestOptions`
+**requestOptions:** `BindingsClient.RequestOptions`
@@ -10879,7 +11367,7 @@ await client.actions.triggers.bindings.updateMany("triggerId");
-
-**requestOptions:** `Bindings.RequestOptions`
+**requestOptions:** `BindingsClient.RequestOptions`
@@ -10944,7 +11432,7 @@ await client.anomaly.blocks.checkIp("id");
-
-**requestOptions:** `Blocks.RequestOptions`
+**requestOptions:** `BlocksClient.RequestOptions`
@@ -11007,7 +11495,7 @@ await client.anomaly.blocks.unblockIp("id");
-
-**requestOptions:** `Blocks.RequestOptions`
+**requestOptions:** `BlocksClient.RequestOptions`
@@ -11064,7 +11552,7 @@ await client.attackProtection.botDetection.get();
-
-**requestOptions:** `BotDetection.RequestOptions`
+**requestOptions:** `BotDetectionClient.RequestOptions`
@@ -11127,7 +11615,7 @@ await client.attackProtection.botDetection.update();
-
-**requestOptions:** `BotDetection.RequestOptions`
+**requestOptions:** `BotDetectionClient.RequestOptions`
@@ -11184,7 +11672,7 @@ await client.attackProtection.breachedPasswordDetection.get();
-
-**requestOptions:** `BreachedPasswordDetection.RequestOptions`
+**requestOptions:** `BreachedPasswordDetectionClient.RequestOptions`
@@ -11247,7 +11735,7 @@ await client.attackProtection.breachedPasswordDetection.update();
-
-**requestOptions:** `BreachedPasswordDetection.RequestOptions`
+**requestOptions:** `BreachedPasswordDetectionClient.RequestOptions`
@@ -11304,7 +11792,7 @@ await client.attackProtection.bruteForceProtection.get();
-
-**requestOptions:** `BruteForceProtection.RequestOptions`
+**requestOptions:** `BruteForceProtectionClient.RequestOptions`
@@ -11367,7 +11855,7 @@ await client.attackProtection.bruteForceProtection.update();
-
-**requestOptions:** `BruteForceProtection.RequestOptions`
+**requestOptions:** `BruteForceProtectionClient.RequestOptions`
@@ -11424,7 +11912,7 @@ await client.attackProtection.captcha.get();
-
-**requestOptions:** `Captcha.RequestOptions`
+**requestOptions:** `CaptchaClient.RequestOptions`
@@ -11487,7 +11975,7 @@ await client.attackProtection.captcha.update();
-
-**requestOptions:** `Captcha.RequestOptions`
+**requestOptions:** `CaptchaClient.RequestOptions`
@@ -11544,7 +12032,7 @@ await client.attackProtection.suspiciousIpThrottling.get();
-
-**requestOptions:** `SuspiciousIpThrottling.RequestOptions`
+**requestOptions:** `SuspiciousIpThrottlingClient.RequestOptions`
@@ -11607,7 +12095,7 @@ await client.attackProtection.suspiciousIpThrottling.update();
-
-**requestOptions:** `SuspiciousIpThrottling.RequestOptions`
+**requestOptions:** `SuspiciousIpThrottlingClient.RequestOptions`
@@ -11649,7 +12137,7 @@ await client.branding.templates.getUniversalLogin();
-
-**requestOptions:** `Templates.RequestOptions`
+**requestOptions:** `TemplatesClient.RequestOptions`
@@ -11734,7 +12222,7 @@ await client.branding.templates.updateUniversalLogin("string");
-
-**requestOptions:** `Templates.RequestOptions`
+**requestOptions:** `TemplatesClient.RequestOptions`
@@ -11774,7 +12262,7 @@ await client.branding.templates.deleteUniversalLogin();
-
-**requestOptions:** `Templates.RequestOptions`
+**requestOptions:** `TemplatesClient.RequestOptions`
@@ -11910,7 +12398,7 @@ await client.branding.themes.create({
-
-**requestOptions:** `Themes.RequestOptions`
+**requestOptions:** `ThemesClient.RequestOptions`
@@ -11965,7 +12453,7 @@ await client.branding.themes.getDefault();
-
-**requestOptions:** `Themes.RequestOptions`
+**requestOptions:** `ThemesClient.RequestOptions`
@@ -12028,7 +12516,7 @@ await client.branding.themes.get("themeId");
-
-**requestOptions:** `Themes.RequestOptions`
+**requestOptions:** `ThemesClient.RequestOptions`
@@ -12091,7 +12579,7 @@ await client.branding.themes.delete("themeId");
-
-**requestOptions:** `Themes.RequestOptions`
+**requestOptions:** `ThemesClient.RequestOptions`
@@ -12225,7 +12713,206 @@ await client.branding.themes.update("themeId", {
-
-**request:** `Management.UpdateBrandingThemeRequestContent`
+**request:** `Management.UpdateBrandingThemeRequestContent`
+
+
+
+
+
+-
+
+**requestOptions:** `ThemesClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+## Branding Phone Providers
+
+client.branding.phone.providers.list({ ...params }) -> Management.ListBrandingPhoneProvidersResponseContent
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a list of phone providers details set for a Tenant. A list of fields to include or exclude may also be specified.
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.branding.phone.providers.list({
+ disabled: true,
+});
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `Management.ListBrandingPhoneProvidersRequestParameters`
+
+
+
+
+
+-
+
+**requestOptions:** `ProvidersClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+client.branding.phone.providers.create({ ...params }) -> Management.CreateBrandingPhoneProviderResponseContent
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a phone provider.
+The
credentials object requires different properties depending on the phone provider (which is specified using the name property).
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.branding.phone.providers.create({
+ name: "twilio",
+ credentials: {
+ auth_token: "auth_token",
+ },
+});
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `Management.CreateBrandingPhoneProviderRequestContent`
+
+
+
+
+
+-
+
+**requestOptions:** `ProvidersClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+client.branding.phone.providers.get(id) -> Management.GetBrandingPhoneProviderResponseContent
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve phone provider details. A list of fields to include or exclude may also be specified.
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.branding.phone.providers.get("id");
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `string`
@@ -12233,7 +12920,7 @@ await client.branding.themes.update("themeId", {
-
-**requestOptions:** `Themes.RequestOptions`
+**requestOptions:** `ProvidersClient.RequestOptions`
@@ -12244,9 +12931,7 @@ await client.branding.themes.update("themeId", {
-## Branding Phone Providers
-
-client.branding.phone.providers.list({ ...params }) -> Management.ListBrandingPhoneProvidersResponseContent
+client.branding.phone.providers.delete(id) -> void
-
@@ -12258,7 +12943,7 @@ await client.branding.themes.update("themeId", {
-
-Retrieve a list of phone providers details set for a Tenant. A list of fields to include or exclude may also be specified.
+Delete the configured phone provider.
@@ -12274,9 +12959,7 @@ Retrieve a list of
@@ -12292,7 +12975,7 @@ await client.branding.phone.providers.list({
-
-**request:** `Management.ListBrandingPhoneProvidersRequestParameters`
+**id:** `string`
@@ -12300,7 +12983,7 @@ await client.branding.phone.providers.list({
-
-**requestOptions:** `Providers.RequestOptions`
+**requestOptions:** `ProvidersClient.RequestOptions`
@@ -12311,7 +12994,7 @@ await client.branding.phone.providers.list({
-client.branding.phone.providers.create({ ...params }) -> Management.CreateBrandingPhoneProviderResponseContent
+client.branding.phone.providers.update(id, { ...params }) -> Management.UpdateBrandingPhoneProviderResponseContent
-
@@ -12323,7 +13006,7 @@ await client.branding.phone.providers.list({
-
-Create a phone provider.
+Update a phone provider.
The
credentials object requires different properties depending on the phone provider (which is specified using the name property).
@@ -12340,12 +13023,7 @@ The credentials object requires different properties depending on t
-
```typescript
-await client.branding.phone.providers.create({
- name: "twilio",
- credentials: {
- auth_token: "auth_token",
- },
-});
+await client.branding.phone.providers.update("id");
```
@@ -12361,7 +13039,15 @@ await client.branding.phone.providers.create({
-
-**request:** `Management.CreateBrandingPhoneProviderRequestContent`
+**id:** `string`
+
+
+
+
+
+-
+
+**request:** `Management.UpdateBrandingPhoneProviderRequestContent`
@@ -12369,7 +13055,7 @@ await client.branding.phone.providers.create({
-
-**requestOptions:** `Providers.RequestOptions`
+**requestOptions:** `ProvidersClient.RequestOptions`
@@ -12380,11 +13066,11 @@ await client.branding.phone.providers.create({
-client.branding.phone.providers.get(id) -> Management.GetBrandingPhoneProviderResponseContent
+client.branding.phone.providers.test(id, { ...params }) -> Management.CreatePhoneProviderSendTestResponseContent
-
-#### 📝 Description
+#### 🔌 Usage
-
@@ -12392,12 +13078,57 @@ await client.branding.phone.providers.create({
-
-Retrieve phone provider details. A list of fields to include or exclude may also be specified.
+```typescript
+await client.branding.phone.providers.test("id", {
+ to: "to",
+});
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `string`
+
+
+
+
+
+-
+
+**request:** `Management.CreatePhoneProviderSendTestRequestContent`
+
+
+
+
+
+-
+**requestOptions:** `ProvidersClient.RequestOptions`
+
+
+
+
+
+
+## Branding Phone Templates
+
+client.branding.phone.templates.list({ ...params }) -> Management.ListPhoneTemplatesResponseContent
+
+-
#### 🔌 Usage
@@ -12408,7 +13139,9 @@ Retrieve
@@ -12424,7 +13157,7 @@ await client.branding.phone.providers.get("id");
-
-**id:** `string`
+**request:** `Management.ListPhoneTemplatesRequestParameters`
@@ -12432,7 +13165,7 @@ await client.branding.phone.providers.get("id");
-
-**requestOptions:** `Providers.RequestOptions`
+**requestOptions:** `TemplatesClient.RequestOptions`
@@ -12443,11 +13176,11 @@ await client.branding.phone.providers.get("id");
-client.branding.phone.providers.delete(id) -> void
+client.branding.phone.templates.create({ ...params }) -> Management.CreatePhoneTemplateResponseContent
-
-#### 📝 Description
+#### 🔌 Usage
-
@@ -12455,12 +13188,45 @@ await client.branding.phone.providers.get("id");
-
-Delete the configured phone provider.
+```typescript
+await client.branding.phone.templates.create();
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+**request:** `Management.CreatePhoneTemplateRequestContent`
+
+
+
+
+
+-
+
+**requestOptions:** `TemplatesClient.RequestOptions`
+
+
+
+
+
+
+client.branding.phone.templates.get(id) -> Management.GetPhoneTemplateResponseContent
+
+-
#### 🔌 Usage
@@ -12471,7 +13237,7 @@ Delete the configured phone provider.
-
```typescript
-await client.branding.phone.providers.delete("id");
+await client.branding.phone.templates.get("id");
```
@@ -12495,7 +13261,7 @@ await client.branding.phone.providers.delete("id");
-
-**requestOptions:** `Providers.RequestOptions`
+**requestOptions:** `TemplatesClient.RequestOptions`
@@ -12506,11 +13272,11 @@ await client.branding.phone.providers.delete("id");
-client.branding.phone.providers.update(id, { ...params }) -> Management.UpdateBrandingPhoneProviderResponseContent
+client.branding.phone.templates.delete(id) -> void
-
-#### 📝 Description
+#### 🔌 Usage
-
@@ -12518,14 +13284,46 @@ await client.branding.phone.providers.delete("id");
-
-Update a phone provider.
-The
credentials object requires different properties depending on the phone provider (which is specified using the name property).
+```typescript
+await client.branding.phone.templates.delete("id");
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `string`
+
+
+
+
+
+-
+
+**requestOptions:** `TemplatesClient.RequestOptions`
+
+
+
+
+client.branding.phone.templates.update(id, { ...params }) -> Management.UpdatePhoneTemplateResponseContent
+
+-
+
#### 🔌 Usage
@@ -12535,7 +13333,7 @@ The credentials object requires different properties depending on t
-
```typescript
-await client.branding.phone.providers.update("id");
+await client.branding.phone.templates.update("id");
```
@@ -12559,7 +13357,7 @@ await client.branding.phone.providers.update("id");
-
-**request:** `Management.UpdateBrandingPhoneProviderRequestContent`
+**request:** `Management.UpdatePhoneTemplateRequestContent`
@@ -12567,7 +13365,7 @@ await client.branding.phone.providers.update("id");
-
-**requestOptions:** `Providers.RequestOptions`
+**requestOptions:** `TemplatesClient.RequestOptions`
@@ -12578,7 +13376,7 @@ await client.branding.phone.providers.update("id");
-client.branding.phone.providers.test(id, { ...params }) -> Management.CreatePhoneProviderSendTestResponseContent
+client.branding.phone.templates.reset(id, { ...params }) -> Management.ResetPhoneTemplateResponseContent
-
@@ -12591,8 +13389,8 @@ await client.branding.phone.providers.update("id");
-
```typescript
-await client.branding.phone.providers.test("id", {
- to: "to",
+await client.branding.phone.templates.reset("id", {
+ key: "value",
});
```
@@ -12617,7 +13415,7 @@ await client.branding.phone.providers.test("id", {
-
-**request:** `Management.CreatePhoneProviderSendTestRequestContent`
+**request:** `Management.ResetPhoneTemplateRequestContent`
@@ -12625,7 +13423,7 @@ await client.branding.phone.providers.test("id", {
-
-**requestOptions:** `Providers.RequestOptions`
+**requestOptions:** `TemplatesClient.RequestOptions`
@@ -12636,9 +13434,7 @@ await client.branding.phone.providers.test("id", {
-## Branding Phone Templates
-
-client.branding.phone.templates.list({ ...params }) -> Management.ListPhoneTemplatesResponseContent
+client.branding.phone.templates.test(id, { ...params }) -> Management.CreatePhoneTemplateTestNotificationResponseContent
-
@@ -12651,8 +13447,8 @@ await client.branding.phone.providers.test("id", {
-
```typescript
-await client.branding.phone.templates.list({
- disabled: true,
+await client.branding.phone.templates.test("id", {
+ to: "to",
});
```
@@ -12669,7 +13465,7 @@ await client.branding.phone.templates.list({
-
-**request:** `Management.ListPhoneTemplatesRequestParameters`
+**id:** `string`
@@ -12677,7 +13473,15 @@ await client.branding.phone.templates.list({
-
-**requestOptions:** `Templates.RequestOptions`
+**request:** `Management.CreatePhoneTemplateTestNotificationRequestContent`
+
+
+
+
+
+-
+
+**requestOptions:** `TemplatesClient.RequestOptions`
@@ -12688,7 +13492,9 @@ await client.branding.phone.templates.list({
-client.branding.phone.templates.create({ ...params }) -> Management.CreatePhoneTemplateResponseContent
+## ClientGrants Organizations
+
+client.clientGrants.organizations.list(id, { ...params }) -> core.Page
-
@@ -12701,7 +13507,25 @@ await client.branding.phone.templates.list({
-
```typescript
-await client.branding.phone.templates.create();
+const pageableResponse = await client.clientGrants.organizations.list("id", {
+ from: "from",
+ take: 1,
+});
+for await (const item of pageableResponse) {
+ console.log(item);
+}
+
+// Or you can manually iterate page-by-page
+let page = await client.clientGrants.organizations.list("id", {
+ from: "from",
+ take: 1,
+});
+while (page.hasNextPage()) {
+ page = page.getNextPage();
+}
+
+// You can also access the underlying response
+const response = page.response;
```
@@ -12717,29 +13541,56 @@ await client.branding.phone.templates.create();
-
-**request:** `Management.CreatePhoneTemplateRequestContent`
+**id:** `string` — ID of the client grant
+
+
+
+
+
+-
+
+**request:** `Management.ListClientGrantOrganizationsRequestParameters`
+
+
+
+
+
+-
+
+**requestOptions:** `OrganizationsClient.RequestOptions`
+
+
+
+
+
+
+
+## Clients Credentials
+
+client.clients.credentials.list(client_id) -> Management.ClientCredential[]
+
+-
+
+#### 📝 Description
+
+
+-
-
-**requestOptions:** `Templates.RequestOptions`
+Get the details of a client credential.
+
+Important: To enable credentials to be used for a client authentication method, set the
client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.
-
-
-
-
-client.branding.phone.templates.get(id) -> Management.GetPhoneTemplateResponseContent
-
--
-
#### 🔌 Usage
@@ -12749,7 +13600,7 @@ await client.branding.phone.templates.create();
-
```typescript
-await client.branding.phone.templates.get("id");
+await client.clients.credentials.list("client_id");
```
@@ -12765,7 +13616,7 @@ await client.branding.phone.templates.get("id");
-
-**id:** `string`
+**client_id:** `string` — ID of the client.
@@ -12773,7 +13624,7 @@ await client.branding.phone.templates.get("id");
-
-**requestOptions:** `Templates.RequestOptions`
+**requestOptions:** `CredentialsClient.RequestOptions`
@@ -12784,11 +13635,11 @@ await client.branding.phone.templates.get("id");
-client.branding.phone.templates.delete(id) -> void
+client.clients.credentials.create(client_id, { ...params }) -> Management.PostClientCredentialResponseContent
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -12796,46 +13647,46 @@ await client.branding.phone.templates.get("id");
-
-```typescript
-await client.branding.phone.templates.delete("id");
-```
-
-
-
-
-
-
-#### ⚙️ Parameters
-
-
--
+Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests.
-
--
+
Public Key
Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.
-**id:** `string`
+Sample: {
+"credential_type": "public_key",
+"name": "string",
+"pem": "string",
+"alg": "RS256",
+"parse_expiry_from_cert": false,
+"expires_at": "2022-12-31T23:59:59Z"
+}
-
-
+Certificate (CA-signed & self-signed)
Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.
-
--
+CA-signed Certificate Sample (pem):
{
+"credential_type": "x509_cert",
+"name": "string",
+"pem": "string"
+}
CA-signed Certificate Sample (subject_dn): {
+"credential_type": "cert_subject_dn",
+"name": "string",
+"subject_dn": "string"
+}
Self-signed Certificate Sample: {
+"credential_type": "cert_subject_dn",
+"name": "string",
+"pem": "string"
+}
-**requestOptions:** `Templates.RequestOptions`
+The credential will be created but not yet enabled for use until you set the corresponding properties in the client:
+
-
-
-
-
-client.branding.phone.templates.update(id, { ...params }) -> Management.UpdatePhoneTemplateResponseContent
-
--
-
#### 🔌 Usage
@@ -12845,7 +13696,9 @@ await client.branding.phone.templates.delete("id");
-
```typescript
-await client.branding.phone.templates.update("id");
+await client.clients.credentials.create("client_id", {
+ credential_type: "public_key",
+});
```
@@ -12861,7 +13714,7 @@ await client.branding.phone.templates.update("id");
-
-**id:** `string`
+**client_id:** `string` — ID of the client.
@@ -12869,7 +13722,7 @@ await client.branding.phone.templates.update("id");
-
-**request:** `Management.UpdatePhoneTemplateRequestContent`
+**request:** `Management.PostClientCredentialRequestContent`
@@ -12877,7 +13730,7 @@ await client.branding.phone.templates.update("id");
-
-**requestOptions:** `Templates.RequestOptions`
+**requestOptions:** `CredentialsClient.RequestOptions`
@@ -12888,10 +13741,27 @@ await client.branding.phone.templates.update("id");
-client.branding.phone.templates.reset(id, { ...params }) -> Management.ResetPhoneTemplateResponseContent
+client.clients.credentials.get(client_id, credential_id) -> Management.GetClientCredentialResponseContent
+
+-
+
+#### 📝 Description
+
-
+
+-
+
+Get the details of a client credential.
+
+Important: To enable credentials to be used for a client authentication method, set the
client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.
+
+
+
+
+
+
#### 🔌 Usage
@@ -12901,9 +13771,7 @@ await client.branding.phone.templates.update("id");
-
```typescript
-await client.branding.phone.templates.reset("id", {
- key: "value",
-});
+await client.clients.credentials.get("client_id", "credential_id");
```
@@ -12919,7 +13787,7 @@ await client.branding.phone.templates.reset("id", {
-
-**id:** `string`
+**client_id:** `string` — ID of the client.
@@ -12927,7 +13795,7 @@ await client.branding.phone.templates.reset("id", {
-
-**request:** `Management.ResetPhoneTemplateRequestContent`
+**credential_id:** `string` — ID of the credential.
@@ -12935,7 +13803,7 @@ await client.branding.phone.templates.reset("id", {
-
-**requestOptions:** `Templates.RequestOptions`
+**requestOptions:** `CredentialsClient.RequestOptions`
@@ -12946,10 +13814,25 @@ await client.branding.phone.templates.reset("id", {
-client.branding.phone.templates.test(id, { ...params }) -> Management.CreatePhoneTemplateTestNotificationResponseContent
+client.clients.credentials.delete(client_id, credential_id) -> void
+
+-
+
+#### 📝 Description
+
-
+
+-
+
+Delete a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow.
+
+
+
+
+
+
#### 🔌 Usage
@@ -12959,9 +13842,7 @@ await client.branding.phone.templates.reset("id", {
-
```typescript
-await client.branding.phone.templates.test("id", {
- to: "to",
-});
+await client.clients.credentials.delete("client_id", "credential_id");
```
@@ -12977,7 +13858,7 @@ await client.branding.phone.templates.test("id", {
-
-**id:** `string`
+**client_id:** `string` — ID of the client.
@@ -12985,7 +13866,7 @@ await client.branding.phone.templates.test("id", {
-
-**request:** `Management.CreatePhoneTemplateTestNotificationRequestContent`
+**credential_id:** `string` — ID of the credential to delete.
@@ -12993,7 +13874,7 @@ await client.branding.phone.templates.test("id", {
-
-**requestOptions:** `Templates.RequestOptions`
+**requestOptions:** `CredentialsClient.RequestOptions`
@@ -13004,12 +13885,25 @@ await client.branding.phone.templates.test("id", {
-## ClientGrants Organizations
+client.clients.credentials.update(client_id, credential_id, { ...params }) -> Management.PatchClientCredentialResponseContent
+
+-
+
+#### 📝 Description
+
+
+-
-
client.clientGrants.organizations.list(id, { ...params }) -> core.Page
-
+Change a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow.
+
+
+
+
+
+
#### 🔌 Usage
@@ -13019,25 +13913,7 @@ await client.branding.phone.templates.test("id", {
-
```typescript
-const pageableResponse = await client.clientGrants.organizations.list("id", {
- from: "from",
- take: 1,
-});
-for await (const item of pageableResponse) {
- console.log(item);
-}
-
-// Or you can manually iterate page-by-page
-let page = await client.clientGrants.organizations.list("id", {
- from: "from",
- take: 1,
-});
-while (page.hasNextPage()) {
- page = page.getNextPage();
-}
-
-// You can also access the underlying response
-const response = page.response;
+await client.clients.credentials.update("client_id", "credential_id");
```
@@ -13053,7 +13929,7 @@ const response = page.response;
-
-**id:** `string` — ID of the client grant
+**client_id:** `string` — ID of the client.
@@ -13061,7 +13937,15 @@ const response = page.response;
-
-**request:** `Management.ListClientGrantOrganizationsRequestParameters`
+**credential_id:** `string` — ID of the credential.
+
+
+
+
+
+-
+
+**request:** `Management.PatchClientCredentialRequestContent`
@@ -13069,7 +13953,7 @@ const response = page.response;
-
-**requestOptions:** `Organizations.RequestOptions`
+**requestOptions:** `CredentialsClient.RequestOptions`
@@ -13080,9 +13964,9 @@ const response = page.response;
-## Clients Credentials
+## Clients Connections
-client.clients.credentials.list(clientId) -> Management.ClientCredential[]
+client.clients.connections.get(id, { ...params }) -> core.Page
-
@@ -13094,10 +13978,16 @@ const response = page.response;
-
-Get the details of a client credential.
-
-Important: To enable credentials to be used for a client authentication method, set the
client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.
+Retrieve all connections that are enabled for the specified Application, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified.
+
+ -
+ This endpoint requires the
read:connections scope and any one of read:clients or read:client_summary.
+
+ -
+ Note: The first time you call this endpoint, omit the
from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining.
+
+
@@ -13112,7 +14002,29 @@ Get the details of a client credential.
-
```typescript
-await client.clients.credentials.list("client_id");
+const pageableResponse = await client.clients.connections.get("id", {
+ from: "from",
+ take: 1,
+ fields: "fields",
+ include_fields: true,
+});
+for await (const item of pageableResponse) {
+ console.log(item);
+}
+
+// Or you can manually iterate page-by-page
+let page = await client.clients.connections.get("id", {
+ from: "from",
+ take: 1,
+ fields: "fields",
+ include_fields: true,
+});
+while (page.hasNextPage()) {
+ page = page.getNextPage();
+}
+
+// You can also access the underlying response
+const response = page.response;
```
@@ -13128,7 +14040,15 @@ await client.clients.credentials.list("client_id");
-
-**clientId:** `string` — ID of the client.
+**id:** `string` — ID of the client for which to retrieve enabled connections.
+
+
+
+
+
+-
+
+**request:** `Management.ConnectionsGetRequest`
@@ -13136,7 +14056,7 @@ await client.clients.credentials.list("client_id");
-
-**requestOptions:** `Credentials.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -13147,7 +14067,9 @@ await client.clients.credentials.list("client_id");
-client.clients.credentials.create(clientId, { ...params }) -> Management.PostClientCredentialResponseContent
+## Connections Clients
+
+client.connections.clients.get(id, { ...params }) -> core.Page
-
@@ -13156,44 +14078,13 @@ await client.clients.credentials.list("client_id");
-
-
--
-
-Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests.
-
-
Public Key
Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.
-
-Sample: {
-"credential_type": "public_key",
-"name": "string",
-"pem": "string",
-"alg": "RS256",
-"parse_expiry_from_cert": false,
-"expires_at": "2022-12-31T23:59:59Z"
-}
-
-Certificate (CA-signed & self-signed)
Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.
-
-CA-signed Certificate Sample (pem): {
-"credential_type": "x509_cert",
-"name": "string",
-"pem": "string"
-}
CA-signed Certificate Sample (subject_dn): {
-"credential_type": "cert_subject_dn",
-"name": "string",
-"subject_dn": "string"
-}
Self-signed Certificate Sample: {
-"credential_type": "cert_subject_dn",
-"name": "string",
-"pem": "string"
-}
+
+-
-The credential will be created but not yet enabled for use until you set the corresponding properties in the client:
+Retrieve all clients that have the specified connection enabled.
+
+Note: The first time you call this endpoint, omit the
from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining.
-
@@ -13208,9 +14099,25 @@ The credential will be created but not yet enabled for use until you set the cor
-
```typescript
-await client.clients.credentials.create("client_id", {
- credential_type: "public_key",
+const pageableResponse = await client.connections.clients.get("id", {
+ take: 1,
+ from: "from",
+});
+for await (const item of pageableResponse) {
+ console.log(item);
+}
+
+// Or you can manually iterate page-by-page
+let page = await client.connections.clients.get("id", {
+ take: 1,
+ from: "from",
});
+while (page.hasNextPage()) {
+ page = page.getNextPage();
+}
+
+// You can also access the underlying response
+const response = page.response;
```
@@ -13226,7 +14133,7 @@ await client.clients.credentials.create("client_id", {
-
-**clientId:** `string` — ID of the client.
+**id:** `string` — The id of the connection for which enabled clients are to be retrieved
@@ -13234,7 +14141,7 @@ await client.clients.credentials.create("client_id", {
-
-**request:** `Management.PostClientCredentialRequestContent`
+**request:** `Management.GetConnectionEnabledClientsRequestParameters`
@@ -13242,7 +14149,7 @@ await client.clients.credentials.create("client_id", {
-
-**requestOptions:** `Credentials.RequestOptions`
+**requestOptions:** `ClientsClient.RequestOptions`
@@ -13253,27 +14160,10 @@ await client.clients.credentials.create("client_id", {
-client.clients.credentials.get(clientId, credentialId) -> Management.GetClientCredentialResponseContent
-
--
-
-#### 📝 Description
-
-
--
-
+
client.connections.clients.update(id, { ...params }) -> void
-
-Get the details of a client credential.
-
-Important: To enable credentials to be used for a client authentication method, set the
client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.
-
-
-
-
-
-
#### 🔌 Usage
@@ -13283,7 +14173,12 @@ Get the details of a client credential.
-
```typescript
-await client.clients.credentials.get("client_id", "credential_id");
+await client.connections.clients.update("id", [
+ {
+ client_id: "client_id",
+ status: true,
+ },
+]);
```
@@ -13299,7 +14194,7 @@ await client.clients.credentials.get("client_id", "credential_id");
-
-**clientId:** `string` — ID of the client.
+**id:** `string` — The id of the connection to modify
@@ -13307,7 +14202,7 @@ await client.clients.credentials.get("client_id", "credential_id");
-
-**credentialId:** `string` — ID of the credential.
+**request:** `Management.UpdateEnabledClientConnectionsRequestContent`
@@ -13315,7 +14210,7 @@ await client.clients.credentials.get("client_id", "credential_id");
-
-**requestOptions:** `Credentials.RequestOptions`
+**requestOptions:** `ClientsClient.RequestOptions`
@@ -13326,7 +14221,9 @@ await client.clients.credentials.get("client_id", "credential_id");
-client.clients.credentials.delete(clientId, credentialId) -> void
+## Connections DirectoryProvisioning
+
+client.connections.directoryProvisioning.get(id) -> Management.GetDirectoryProvisioningResponseContent
-
@@ -13338,7 +14235,7 @@ await client.clients.credentials.get("client_id", "credential_id");
-
-Delete a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow.
+Retrieve the directory provisioning configuration of a connection.
@@ -13354,7 +14251,7 @@ Delete a client credential you previously created. May be enabled or disabled. F
-
```typescript
-await client.clients.credentials.delete("client_id", "credential_id");
+await client.connections.directoryProvisioning.get("id");
```
@@ -13370,15 +14267,7 @@ await client.clients.credentials.delete("client_id", "credential_id");
-
-**clientId:** `string` — ID of the client.
-
-
-
-
-
--
-
-**credentialId:** `string` — ID of the credential to delete.
+**id:** `string` — The id of the connection to retrieve its directory provisioning configuration
@@ -13386,7 +14275,7 @@ await client.clients.credentials.delete("client_id", "credential_id");
-
-**requestOptions:** `Credentials.RequestOptions`
+**requestOptions:** `DirectoryProvisioningClient.RequestOptions`
@@ -13397,7 +14286,7 @@ await client.clients.credentials.delete("client_id", "credential_id");
-client.clients.credentials.update(clientId, credentialId, { ...params }) -> Management.PatchClientCredentialResponseContent
+client.connections.directoryProvisioning.create(id, { ...params }) -> Management.CreateDirectoryProvisioningResponseContent
-
@@ -13409,7 +14298,7 @@ await client.clients.credentials.delete("client_id", "credential_id");
-
-Change a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow.
+Create a directory provisioning configuration for a connection.
@@ -13425,7 +14314,7 @@ Change a client credential you previously created. May be enabled or disabled. F
-
```typescript
-await client.clients.credentials.update("client_id", "credential_id");
+await client.connections.directoryProvisioning.create("id");
```
@@ -13441,7 +14330,7 @@ await client.clients.credentials.update("client_id", "credential_id");
-
-**clientId:** `string` — ID of the client.
+**id:** `string` — The id of the connection to create its directory provisioning configuration
@@ -13449,15 +14338,7 @@ await client.clients.credentials.update("client_id", "credential_id");
-
-**credentialId:** `string` — ID of the credential.
-
-
-
-
-
--
-
-**request:** `Management.PatchClientCredentialRequestContent`
+**request:** `Management.CreateDirectoryProvisioningRequestContent | null`
@@ -13465,7 +14346,7 @@ await client.clients.credentials.update("client_id", "credential_id");
-
-**requestOptions:** `Credentials.RequestOptions`
+**requestOptions:** `DirectoryProvisioningClient.RequestOptions`
@@ -13476,9 +14357,7 @@ await client.clients.credentials.update("client_id", "credential_id");
-## Clients Connections
-
-client.clients.connections.get(id, { ...params }) -> core.Page
+client.connections.directoryProvisioning.delete(id) -> void
-
@@ -13490,16 +14369,8 @@ await client.clients.credentials.update("client_id", "credential_id");
-
-Retrieve all connections that are enabled for the specified Application, using checkpoint pagination. A list of fields to include or exclude for each connection may also be specified.
+Delete the directory provisioning configuration of a connection.
-
- -
- This endpoint requires the
read:connections scope and any one of read:clients or read:client_summary.
-
- -
- Note: The first time you call this endpoint, omit the
from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining.
-
-
@@ -13514,29 +14385,7 @@ Retrieve all connections that are enabled for the specified
@@ -13552,15 +14401,7 @@ const response = page.response;
-
-**id:** `string` — ID of the client for which to retrieve enabled connections.
-
-
-
-
-
--
-
-**request:** `Management.ConnectionsGetRequest`
+**id:** `string` — The id of the connection to delete its directory provisioning configuration
@@ -13568,7 +14409,7 @@ const response = page.response;
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `DirectoryProvisioningClient.RequestOptions`
@@ -13579,9 +14420,7 @@ const response = page.response;
-## Connections Clients
-
-client.connections.clients.get(id, { ...params }) -> core.Page
+client.connections.directoryProvisioning.update(id, { ...params }) -> Management.UpdateDirectoryProvisioningResponseContent
-
@@ -13593,9 +14432,7 @@ const response = page.response;
-
-Retrieve all clients that have the specified connection enabled.
-
-Note: The first time you call this endpoint, omit the
from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no further results are remaining.
+Update the directory provisioning configuration of a connection.
@@ -13611,25 +14448,7 @@ Retrieve all clients that have the specified
@@ -13645,7 +14464,7 @@ const response = page.response;
-
-**id:** `string` — The id of the connection for which enabled clients are to be retrieved
+**id:** `string` — The id of the connection to create its directory provisioning configuration
@@ -13653,7 +14472,7 @@ const response = page.response;
-
-**request:** `Management.GetConnectionEnabledClientsRequestParameters`
+**request:** `Management.UpdateDirectoryProvisioningRequestContent | null`
@@ -13661,7 +14480,7 @@ const response = page.response;
-
-**requestOptions:** `Clients.RequestOptions`
+**requestOptions:** `DirectoryProvisioningClient.RequestOptions`
@@ -13672,11 +14491,11 @@ const response = page.response;
-client.connections.clients.update(id, { ...params }) -> void
+client.connections.directoryProvisioning.getDefaultMapping(id) -> Management.GetDirectoryProvisioningDefaultMappingResponseContent
-
-#### 🔌 Usage
+#### 📝 Description
-
@@ -13684,21 +14503,14 @@ const response = page.response;
-
-```typescript
-await client.connections.clients.update("id", [
- {
- client_id: "client_id",
- status: true,
- },
-]);
-```
+Retrieve the directory provisioning default attribute mapping of a connection.
-#### ⚙️ Parameters
+#### 🔌 Usage
-
@@ -13706,15 +14518,24 @@ await client.connections.clients.update("id", [
-
-**id:** `string` — The id of the connection to modify
+```typescript
+await client.connections.directoryProvisioning.getDefaultMapping("id");
+```
+
+
+
+#### ⚙️ Parameters
-
-**request:** `Management.UpdateEnabledClientConnectionsRequestContent`
+
+-
+
+**id:** `string` — The id of the connection to retrieve its directory provisioning configuration
@@ -13722,7 +14543,7 @@ await client.connections.clients.update("id", [
-
-**requestOptions:** `Clients.RequestOptions`
+**requestOptions:** `DirectoryProvisioningClient.RequestOptions`
@@ -13787,7 +14608,7 @@ await client.connections.keys.get("id");
-
-**requestOptions:** `Keys.RequestOptions`
+**requestOptions:** `KeysClient.RequestOptions`
@@ -13858,7 +14679,7 @@ await client.connections.keys.rotate("id");
-
-**requestOptions:** `Keys.RequestOptions`
+**requestOptions:** `KeysClient.RequestOptions`
@@ -13923,7 +14744,7 @@ await client.connections.scimConfiguration.get("id");
-
-**requestOptions:** `ScimConfiguration.RequestOptions`
+**requestOptions:** `ScimConfigurationClient.RequestOptions`
@@ -13994,7 +14815,7 @@ await client.connections.scimConfiguration.create("id");
-
-**requestOptions:** `ScimConfiguration.RequestOptions`
+**requestOptions:** `ScimConfigurationClient.RequestOptions`
@@ -14057,7 +14878,7 @@ await client.connections.scimConfiguration.delete("id");
-
-**requestOptions:** `ScimConfiguration.RequestOptions`
+**requestOptions:** `ScimConfigurationClient.RequestOptions`
@@ -14131,7 +14952,7 @@ await client.connections.scimConfiguration.update("id", {
-
-**requestOptions:** `ScimConfiguration.RequestOptions`
+**requestOptions:** `ScimConfigurationClient.RequestOptions`
@@ -14194,7 +15015,7 @@ await client.connections.scimConfiguration.getDefaultMapping("id");
-
-**requestOptions:** `ScimConfiguration.RequestOptions`
+**requestOptions:** `ScimConfigurationClient.RequestOptions`
@@ -14269,7 +15090,72 @@ await client.connections.users.deleteByEmail("id", {
-
-**requestOptions:** `Users.RequestOptions`
+**requestOptions:** `UsersClient.RequestOptions`
+
+
+
+
+
+
+
+
+
+
+## Connections DirectoryProvisioning Synchronizations
+
+client.connections.directoryProvisioning.synchronizations.create(id) -> Management.CreateDirectorySynchronizationResponseContent
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Request an on-demand synchronization of the directory.
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```typescript
+await client.connections.directoryProvisioning.synchronizations.create("id");
+```
+
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `string` — The id of the connection to trigger synchronization for
+
+
+
+
+
+-
+
+**requestOptions:** `SynchronizationsClient.RequestOptions`
@@ -14334,7 +15220,7 @@ await client.connections.scimConfiguration.tokens.get("id");
-
-**requestOptions:** `Tokens.RequestOptions`
+**requestOptions:** `TokensClient.RequestOptions`
@@ -14405,7 +15291,7 @@ await client.connections.scimConfiguration.tokens.create("id");
-
-**requestOptions:** `Tokens.RequestOptions`
+**requestOptions:** `TokensClient.RequestOptions`
@@ -14476,7 +15362,7 @@ await client.connections.scimConfiguration.tokens.delete("id", "tokenId");
-
-**requestOptions:** `Tokens.RequestOptions`
+**requestOptions:** `TokensClient.RequestOptions`
@@ -14544,7 +15430,7 @@ await client.emails.provider.get({
-
-**requestOptions:** `Provider.RequestOptions`
+**requestOptions:** `ProviderClient.RequestOptions`
@@ -14653,7 +15539,7 @@ await client.emails.provider.create({
-
-**requestOptions:** `Provider.RequestOptions`
+**requestOptions:** `ProviderClient.RequestOptions`
@@ -14708,7 +15594,7 @@ await client.emails.provider.delete();
-
-**requestOptions:** `Provider.RequestOptions`
+**requestOptions:** `ProviderClient.RequestOptions`
@@ -14810,7 +15696,7 @@ await client.emails.provider.update();
-
-**requestOptions:** `Provider.RequestOptions`
+**requestOptions:** `ProviderClient.RequestOptions`
@@ -14875,7 +15761,7 @@ await client.eventStreams.deliveries.list("id", {
-
-**requestOptions:** `Deliveries.RequestOptions`
+**requestOptions:** `DeliveriesClient.RequestOptions`
@@ -14886,7 +15772,7 @@ await client.eventStreams.deliveries.list("id", {
-client.eventStreams.deliveries.getHistory(id, eventId) -> Management.GetEventStreamDeliveryHistoryResponseContent
+client.eventStreams.deliveries.getHistory(id, event_id) -> Management.GetEventStreamDeliveryHistoryResponseContent
-
@@ -14923,7 +15809,7 @@ await client.eventStreams.deliveries.getHistory("id", "event_id");
-
-**eventId:** `string` — Unique identifier for the event
+**event_id:** `string` — Unique identifier for the event
@@ -14931,7 +15817,7 @@ await client.eventStreams.deliveries.getHistory("id", "event_id");
-
-**requestOptions:** `Deliveries.RequestOptions`
+**requestOptions:** `DeliveriesClient.RequestOptions`
@@ -14989,7 +15875,7 @@ await client.eventStreams.redeliveries.create("id");
-
-**requestOptions:** `Redeliveries.RequestOptions`
+**requestOptions:** `RedeliveriesClient.RequestOptions`
@@ -15000,7 +15886,7 @@ await client.eventStreams.redeliveries.create("id");
-client.eventStreams.redeliveries.createById(id, eventId) -> void
+client.eventStreams.redeliveries.createById(id, event_id) -> void
-
@@ -15037,7 +15923,7 @@ await client.eventStreams.redeliveries.createById("id", "event_id");
-
-**eventId:** `string` — Unique identifier for the event
+**event_id:** `string` — Unique identifier for the event
@@ -15045,7 +15931,7 @@ await client.eventStreams.redeliveries.createById("id", "event_id");
-
-**requestOptions:** `Redeliveries.RequestOptions`
+**requestOptions:** `RedeliveriesClient.RequestOptions`
@@ -15058,7 +15944,7 @@ await client.eventStreams.redeliveries.createById("id", "event_id");
## Flows Executions
-client.flows.executions.list(flowId, { ...params }) -> core.Page
+client.flows.executions.list(flow_id, { ...params }) -> core.Page
-
@@ -15105,7 +15991,7 @@ const response = page.response;
-
-**flowId:** `string` — Flow id
+**flow_id:** `string` — Flow id
@@ -15121,7 +16007,7 @@ const response = page.response;
-
-**requestOptions:** `Executions.RequestOptions`
+**requestOptions:** `ExecutionsClient.RequestOptions`
@@ -15132,7 +16018,7 @@ const response = page.response;
-client.flows.executions.get(flowId, executionId, { ...params }) -> Management.GetFlowExecutionResponseContent
+client.flows.executions.get(flow_id, execution_id, { ...params }) -> Management.GetFlowExecutionResponseContent
-
@@ -15161,7 +16047,7 @@ await client.flows.executions.get("flow_id", "execution_id");
-
-**flowId:** `string` — Flow id
+**flow_id:** `string` — Flow id
@@ -15169,7 +16055,7 @@ await client.flows.executions.get("flow_id", "execution_id");
-
-**executionId:** `string` — Flow execution id
+**execution_id:** `string` — Flow execution id
@@ -15185,7 +16071,7 @@ await client.flows.executions.get("flow_id", "execution_id");
-
-**requestOptions:** `Executions.RequestOptions`
+**requestOptions:** `ExecutionsClient.RequestOptions`
@@ -15196,7 +16082,7 @@ await client.flows.executions.get("flow_id", "execution_id");
-client.flows.executions.delete(flowId, executionId) -> void
+client.flows.executions.delete(flow_id, execution_id) -> void
-
@@ -15225,7 +16111,7 @@ await client.flows.executions.delete("flow_id", "execution_id");
-
-**flowId:** `string` — Flows id
+**flow_id:** `string` — Flows id
@@ -15233,7 +16119,7 @@ await client.flows.executions.delete("flow_id", "execution_id");
-
-**executionId:** `string` — Flow execution identifier
+**execution_id:** `string` — Flow execution identifier
@@ -15241,7 +16127,7 @@ await client.flows.executions.delete("flow_id", "execution_id");
-
-**requestOptions:** `Executions.RequestOptions`
+**requestOptions:** `ExecutionsClient.RequestOptions`
@@ -15311,7 +16197,7 @@ const response = page.response;
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -15367,7 +16253,7 @@ await client.flows.vault.connections.create({
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -15415,7 +16301,7 @@ await client.flows.vault.connections.get("id");
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -15463,7 +16349,7 @@ await client.flows.vault.connections.delete("id");
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -15519,7 +16405,7 @@ await client.flows.vault.connections.update("id");
-
-**requestOptions:** `Connections.RequestOptions`
+**requestOptions:** `ConnectionsClient.RequestOptions`
@@ -15589,7 +16475,7 @@ await client.guardian.enrollments.createTicket({
-
-**requestOptions:** `Enrollments.RequestOptions`
+**requestOptions:** `EnrollmentsClient.RequestOptions`
@@ -15652,7 +16538,7 @@ await client.guardian.enrollments.get("id");
-
-**requestOptions:** `Enrollments.RequestOptions`
+**requestOptions:** `EnrollmentsClient.RequestOptions`
@@ -15715,7 +16601,7 @@ await client.guardian.enrollments.delete("id");
-
-**requestOptions:** `Enrollments.RequestOptions`
+**requestOptions:** `EnrollmentsClient.RequestOptions`
@@ -15772,7 +16658,7 @@ await client.guardian.factors.list();
-
-**requestOptions:** `Factors.RequestOptions`
+**requestOptions:** `FactorsClient.RequestOptions`
@@ -15845,7 +16731,7 @@ await client.guardian.factors.set("push-notification", {
-
-**requestOptions:** `Factors.RequestOptions`
+**requestOptions:** `FactorsClient.RequestOptions`
@@ -15911,7 +16797,7 @@ await client.guardian.policies.list();
-
-**requestOptions:** `Policies.RequestOptions`
+**requestOptions:** `PoliciesClient.RequestOptions`
@@ -15983,7 +16869,7 @@ await client.guardian.policies.set(["all-applications"]);
-
-**requestOptions:** `Policies.RequestOptions`
+**requestOptions:** `PoliciesClient.RequestOptions`
@@ -16040,7 +16926,7 @@ await client.guardian.factors.phone.getMessageTypes();
-
-**requestOptions:** `Phone.RequestOptions`
+**requestOptions:** `PhoneClient.RequestOptions`
@@ -16105,7 +16991,7 @@ await client.guardian.factors.phone.setMessageTypes({
-
-**requestOptions:** `Phone.RequestOptions`
+**requestOptions:** `PhoneClient.RequestOptions`
@@ -16160,7 +17046,7 @@ await client.guardian.factors.phone.getTwilioProvider();
-
-**requestOptions:** `Phone.RequestOptions`
+**requestOptions:** `PhoneClient.RequestOptions`
@@ -16223,7 +17109,7 @@ await client.guardian.factors.phone.setTwilioProvider();
-
-**requestOptions:** `Phone.RequestOptions`
+**requestOptions:** `PhoneClient.RequestOptions`
@@ -16278,7 +17164,7 @@ await client.guardian.factors.phone.getSelectedProvider();
-
-**requestOptions:** `Phone.RequestOptions`
+**requestOptions:** `PhoneClient.RequestOptions`
@@ -16328,7 +17214,7 @@ await client.guardian.factors.phone.setProvider({
-
-**requestOptions:** `Phone.RequestOptions`
+**requestOptions:** `PhoneClient.RequestOptions`
@@ -16383,7 +17269,7 @@ await client.guardian.factors.phone.getTemplates();
-
-**requestOptions:** `Phone.RequestOptions`
+**requestOptions:** `PhoneClient.RequestOptions`
@@ -16449,7 +17335,7 @@ await client.guardian.factors.phone.setTemplates({
-
-**requestOptions:** `Phone.RequestOptions`
+**requestOptions:** `PhoneClient.RequestOptions`
@@ -16506,7 +17392,7 @@ await client.guardian.factors.pushNotification.getApnsProvider();
-
-**requestOptions:** `PushNotification.RequestOptions`
+**requestOptions:** `PushNotificationClient.RequestOptions`
@@ -16569,7 +17455,7 @@ await client.guardian.factors.pushNotification.setApnsProvider({});
-
-**requestOptions:** `PushNotification.RequestOptions`
+**requestOptions:** `PushNotificationClient.RequestOptions`
@@ -16632,7 +17518,7 @@ await client.guardian.factors.pushNotification.setFcmProvider({});
-
-**requestOptions:** `PushNotification.RequestOptions`
+**requestOptions:** `PushNotificationClient.RequestOptions`
@@ -16695,7 +17581,7 @@ await client.guardian.factors.pushNotification.setFcmv1Provider({});
-
-**requestOptions:** `PushNotification.RequestOptions`
+**requestOptions:** `PushNotificationClient.RequestOptions`
@@ -16750,7 +17636,7 @@ await client.guardian.factors.pushNotification.getSnsProvider();
-
-**requestOptions:** `PushNotification.RequestOptions`
+**requestOptions:** `PushNotificationClient.RequestOptions`
@@ -16813,7 +17699,7 @@ await client.guardian.factors.pushNotification.setSnsProvider();
-
-**requestOptions:** `PushNotification.RequestOptions`
+**requestOptions:** `PushNotificationClient.RequestOptions`
@@ -16876,7 +17762,7 @@ await client.guardian.factors.pushNotification.updateSnsProvider();
-
-**requestOptions:** `PushNotification.RequestOptions`
+**requestOptions:** `PushNotificationClient.RequestOptions`
@@ -16931,7 +17817,7 @@ await client.guardian.factors.pushNotification.getSelectedProvider();
-
-**requestOptions:** `PushNotification.RequestOptions`
+**requestOptions:** `PushNotificationClient.RequestOptions`
@@ -16996,7 +17882,7 @@ await client.guardian.factors.pushNotification.setProvider({
-
-**requestOptions:** `PushNotification.RequestOptions`
+**requestOptions:** `PushNotificationClient.RequestOptions`
@@ -17055,7 +17941,7 @@ await client.guardian.factors.sms.getTwilioProvider();
-
-**requestOptions:** `Sms.RequestOptions`
+**requestOptions:** `SmsClient.RequestOptions`
@@ -17120,7 +18006,7 @@ await client.guardian.factors.sms.setTwilioProvider();
-
-**requestOptions:** `Sms.RequestOptions`
+**requestOptions:** `SmsClient.RequestOptions`
@@ -17177,7 +18063,7 @@ await client.guardian.factors.sms.getSelectedProvider();
-
-**requestOptions:** `Sms.RequestOptions`
+**requestOptions:** `SmsClient.RequestOptions`
@@ -17244,7 +18130,7 @@ await client.guardian.factors.sms.setProvider({
-
-**requestOptions:** `Sms.RequestOptions`
+**requestOptions:** `SmsClient.RequestOptions`
@@ -17301,7 +18187,7 @@ await client.guardian.factors.sms.getTemplates();
-
-**requestOptions:** `Sms.RequestOptions`
+**requestOptions:** `SmsClient.RequestOptions`
@@ -17369,7 +18255,7 @@ await client.guardian.factors.sms.setTemplates({
-
-**requestOptions:** `Sms.RequestOptions`
+**requestOptions:** `SmsClient.RequestOptions`
@@ -17426,7 +18312,7 @@ await client.guardian.factors.duo.settings.get();
-
-**requestOptions:** `Settings.RequestOptions`
+**requestOptions:** `SettingsClient.RequestOptions`
@@ -17489,7 +18375,7 @@ await client.guardian.factors.duo.settings.set();
-
-**requestOptions:** `Settings.RequestOptions`
+**requestOptions:** `SettingsClient.RequestOptions`
@@ -17537,7 +18423,7 @@ await client.guardian.factors.duo.settings.update();
-
-**requestOptions:** `Settings.RequestOptions`
+**requestOptions:** `SettingsClient.RequestOptions`
@@ -17602,7 +18488,7 @@ await client.hooks.secrets.get("id");
-
-**requestOptions:** `Secrets.RequestOptions`
+**requestOptions:** `SecretsClient.RequestOptions`
@@ -17675,7 +18561,7 @@ await client.hooks.secrets.create("id", {
-
-**requestOptions:** `Secrets.RequestOptions`
+**requestOptions:** `SecretsClient.RequestOptions`
@@ -17746,7 +18632,7 @@ await client.hooks.secrets.delete("id", ["string"]);
-
-**requestOptions:** `Secrets.RequestOptions`
+**requestOptions:** `SecretsClient.RequestOptions`
@@ -17819,7 +18705,7 @@ await client.hooks.secrets.update("id", {
-
-**requestOptions:** `Secrets.RequestOptions`
+**requestOptions:** `SecretsClient.RequestOptions`
@@ -17884,7 +18770,7 @@ await client.jobs.usersExports.create();
-
-**requestOptions:** `UsersExports.RequestOptions`
+**requestOptions:** `UsersExportsClient.RequestOptions`
@@ -17952,7 +18838,7 @@ await client.jobs.usersImports.create({
-
-**requestOptions:** `UsersImports.RequestOptions`
+**requestOptions:** `UsersImportsClient.RequestOptions`
@@ -18021,7 +18907,7 @@ await client.jobs.verificationEmail.create({
-
-**requestOptions:** `VerificationEmail.RequestOptions`
+**requestOptions:** `VerificationEmailClient.RequestOptions`
@@ -18086,7 +18972,7 @@ await client.jobs.errors.get("id");
-
-**requestOptions:** `Errors.RequestOptions`
+**requestOptions:** `ErrorsClient.RequestOptions`
@@ -18143,7 +19029,7 @@ await client.keys.customSigning.get();
-
-**requestOptions:** `CustomSigning.RequestOptions`
+**requestOptions:** `CustomSigningClient.RequestOptions`
@@ -18212,7 +19098,7 @@ await client.keys.customSigning.set({
-
-**requestOptions:** `CustomSigning.RequestOptions`
+**requestOptions:** `CustomSigningClient.RequestOptions`
@@ -18267,7 +19153,7 @@ await client.keys.customSigning.delete();
-
-**requestOptions:** `CustomSigning.RequestOptions`
+**requestOptions:** `CustomSigningClient.RequestOptions`
@@ -18352,7 +19238,7 @@ const response = page.response;
-
-**requestOptions:** `Encryption.RequestOptions`
+**requestOptions:** `EncryptionClient.RequestOptions`
@@ -18417,7 +19303,7 @@ await client.keys.encryption.create({
-
-**requestOptions:** `Encryption.RequestOptions`
+**requestOptions:** `EncryptionClient.RequestOptions`
@@ -18472,7 +19358,7 @@ await client.keys.encryption.rekey();
-
-**requestOptions:** `Encryption.RequestOptions`
+**requestOptions:** `EncryptionClient.RequestOptions`
@@ -18535,7 +19421,7 @@ await client.keys.encryption.get("kid");
-
-**requestOptions:** `Encryption.RequestOptions`
+**requestOptions:** `EncryptionClient.RequestOptions`
@@ -18608,7 +19494,7 @@ await client.keys.encryption.import("kid", {
-
-**requestOptions:** `Encryption.RequestOptions`
+**requestOptions:** `EncryptionClient.RequestOptions`
@@ -18671,7 +19557,7 @@ await client.keys.encryption.delete("kid");
-
-**requestOptions:** `Encryption.RequestOptions`
+**requestOptions:** `EncryptionClient.RequestOptions`
@@ -18734,7 +19620,7 @@ await client.keys.encryption.createPublicWrappingKey("kid");
-
-**requestOptions:** `Encryption.RequestOptions`
+**requestOptions:** `EncryptionClient.RequestOptions`
@@ -18791,7 +19677,7 @@ await client.keys.signing.list();
-
-**requestOptions:** `Signing.RequestOptions`
+**requestOptions:** `SigningClient.RequestOptions`
@@ -18846,7 +19732,7 @@ await client.keys.signing.rotate();
-
-**requestOptions:** `Signing.RequestOptions`
+**requestOptions:** `SigningClient.RequestOptions`
@@ -18909,7 +19795,7 @@ await client.keys.signing.get("kid");
-
-**requestOptions:** `Signing.RequestOptions`
+**requestOptions:** `SigningClient.RequestOptions`
@@ -18972,7 +19858,7 @@ await client.keys.signing.revoke("kid");
-
-**requestOptions:** `Signing.RequestOptions`
+**requestOptions:** `SigningClient.RequestOptions`
@@ -19054,7 +19940,7 @@ const response = page.response;
-
-**requestOptions:** `ClientGrants.RequestOptions`
+**requestOptions:** `ClientGrantsClient.RequestOptions`
@@ -19112,7 +19998,7 @@ await client.organizations.clientGrants.create("id", {
-
-**requestOptions:** `ClientGrants.RequestOptions`
+**requestOptions:** `ClientGrantsClient.RequestOptions`
@@ -19123,7 +20009,7 @@ await client.organizations.clientGrants.create("id", {
-client.organizations.clientGrants.delete(id, grantId) -> void
+client.organizations.clientGrants.delete(id, grant_id) -> void
-
@@ -19160,7 +20046,7 @@ await client.organizations.clientGrants.delete("id", "grant_id");
-
-**grantId:** `string` — The Client Grant ID to remove from the organization
+**grant_id:** `string` — The Client Grant ID to remove from the organization
@@ -19168,7 +20054,7 @@ await client.organizations.clientGrants.delete("id", "grant_id");
-
-**requestOptions:** `ClientGrants.RequestOptions`
+**requestOptions:** `ClientGrantsClient.RequestOptions`
@@ -19259,7 +20145,7 @@ const response = page.response;
-
-**requestOptions:** `DiscoveryDomains.RequestOptions`
+**requestOptions:** `DiscoveryDomainsClient.RequestOptions`
@@ -19332,7 +20218,7 @@ await client.organizations.discoveryDomains.create("id", {
-
-**requestOptions:** `DiscoveryDomains.RequestOptions`
+**requestOptions:** `DiscoveryDomainsClient.RequestOptions`
@@ -19343,7 +20229,7 @@ await client.organizations.discoveryDomains.create("id", {
-client.organizations.discoveryDomains.get(id, discoveryDomainId) -> Management.GetOrganizationDiscoveryDomainResponseContent
+client.organizations.discoveryDomains.get(id, discovery_domain_id) -> Management.GetOrganizationDiscoveryDomainResponseContent
-
@@ -19395,7 +20281,7 @@ await client.organizations.discoveryDomains.get("id", "discovery_domain_id");
-
-**discoveryDomainId:** `string` — ID of the discovery domain.
+**discovery_domain_id:** `string` — ID of the discovery domain.
@@ -19403,7 +20289,7 @@ await client.organizations.discoveryDomains.get("id", "discovery_domain_id");
-
-**requestOptions:** `DiscoveryDomains.RequestOptions`
+**requestOptions:** `DiscoveryDomainsClient.RequestOptions`
@@ -19414,7 +20300,7 @@ await client.organizations.discoveryDomains.get("id", "discovery_domain_id");
-client.organizations.discoveryDomains.delete(id, discoveryDomainId) -> void
+client.organizations.discoveryDomains.delete(id, discovery_domain_id) -> void
-
@@ -19466,7 +20352,7 @@ await client.organizations.discoveryDomains.delete("id", "discovery_domain_id");
-
-**discoveryDomainId:** `string` — ID of the discovery domain.
+**discovery_domain_id:** `string` — ID of the discovery domain.
@@ -19474,7 +20360,7 @@ await client.organizations.discoveryDomains.delete("id", "discovery_domain_id");
-
-**requestOptions:** `DiscoveryDomains.RequestOptions`
+**requestOptions:** `DiscoveryDomainsClient.RequestOptions`
@@ -19485,7 +20371,7 @@ await client.organizations.discoveryDomains.delete("id", "discovery_domain_id");
-client.organizations.discoveryDomains.update(id, discoveryDomainId, { ...params }) -> Management.UpdateOrganizationDiscoveryDomainResponseContent
+client.organizations.discoveryDomains.update(id, discovery_domain_id, { ...params }) -> Management.UpdateOrganizationDiscoveryDomainResponseContent
-
@@ -19537,7 +20423,7 @@ await client.organizations.discoveryDomains.update("id", "discovery_domain_id");
-
-**discoveryDomainId:** `string` — ID of the discovery domain to update.
+**discovery_domain_id:** `string` — ID of the discovery domain to update.
@@ -19553,7 +20439,7 @@ await client.organizations.discoveryDomains.update("id", "discovery_domain_id");
-
-**requestOptions:** `DiscoveryDomains.RequestOptions`
+**requestOptions:** `DiscoveryDomainsClient.RequestOptions`
@@ -19646,7 +20532,7 @@ const response = page.response;
-
-**requestOptions:** `EnabledConnections.RequestOptions`
+**requestOptions:** `EnabledConnectionsClient.RequestOptions`
@@ -19721,7 +20607,7 @@ await client.organizations.enabledConnections.add("id", {
-
-**requestOptions:** `EnabledConnections.RequestOptions`
+**requestOptions:** `EnabledConnectionsClient.RequestOptions`
@@ -19792,7 +20678,7 @@ await client.organizations.enabledConnections.get("id", "connectionId");
-
-**requestOptions:** `EnabledConnections.RequestOptions`
+**requestOptions:** `EnabledConnectionsClient.RequestOptions`
@@ -19865,7 +20751,7 @@ await client.organizations.enabledConnections.delete("id", "connectionId");
-
-**requestOptions:** `EnabledConnections.RequestOptions`
+**requestOptions:** `EnabledConnectionsClient.RequestOptions`
@@ -19944,7 +20830,7 @@ await client.organizations.enabledConnections.update("id", "connectionId");
-
-**requestOptions:** `EnabledConnections.RequestOptions`
+**requestOptions:** `EnabledConnectionsClient.RequestOptions`
@@ -20043,7 +20929,7 @@ const response = page.response;
-
-**requestOptions:** `Invitations.RequestOptions`
+**requestOptions:** `InvitationsClient.RequestOptions`
@@ -20122,7 +21008,7 @@ await client.organizations.invitations.create("id", {
-
-**requestOptions:** `Invitations.RequestOptions`
+**requestOptions:** `InvitationsClient.RequestOptions`
@@ -20133,7 +21019,7 @@ await client.organizations.invitations.create("id", {
-client.organizations.invitations.get(id, invitationId, { ...params }) -> Management.GetOrganizationInvitationResponseContent
+client.organizations.invitations.get(id, invitation_id, { ...params }) -> Management.GetOrganizationInvitationResponseContent
-
@@ -20173,7 +21059,7 @@ await client.organizations.invitations.get("id", "invitation_id", {
-
-**invitationId:** `string` — The id of the user invitation.
+**invitation_id:** `string` — The id of the user invitation.
@@ -20189,7 +21075,7 @@ await client.organizations.invitations.get("id", "invitation_id", {
-
-**requestOptions:** `Invitations.RequestOptions`
+**requestOptions:** `InvitationsClient.RequestOptions`
@@ -20200,7 +21086,7 @@ await client.organizations.invitations.get("id", "invitation_id", {
-client.organizations.invitations.delete(id, invitationId) -> void
+client.organizations.invitations.delete(id, invitation_id) -> void
-
@@ -20237,7 +21123,7 @@ await client.organizations.invitations.delete("id", "invitation_id");
-
-**invitationId:** `string` — The id of the user invitation.
+**invitation_id:** `string` — The id of the user invitation.
@@ -20245,7 +21131,7 @@ await client.organizations.invitations.delete("id", "invitation_id");
-
-**requestOptions:** `Invitations.RequestOptions`
+**requestOptions:** `InvitationsClient.RequestOptions`
@@ -20361,7 +21247,7 @@ const response = page.response;
-
-**requestOptions:** `Members.RequestOptions`
+**requestOptions:** `MembersClient.RequestOptions`
@@ -20436,7 +21322,7 @@ await client.organizations.members.create("id", {
-
-**requestOptions:** `Members.RequestOptions`
+**requestOptions:** `MembersClient.RequestOptions`
@@ -20494,7 +21380,7 @@ await client.organizations.members.delete("id", {
-
-**requestOptions:** `Members.RequestOptions`
+**requestOptions:** `MembersClient.RequestOptions`
@@ -20507,7 +21393,7 @@ await client.organizations.members.delete("id", {
## Organizations Members Roles
-client.organizations.members.roles.list(id, userId, { ...params }) -> core.Page
+client.organizations.members.roles.list(id, user_id, { ...params }) -> core.Page
-
@@ -20581,7 +21467,7 @@ const response = page.response;
-
-**userId:** `string` — ID of the user to associate roles with.
+**user_id:** `string` — ID of the user to associate roles with.
@@ -20597,7 +21483,7 @@ const response = page.response;
-
-**requestOptions:** `Roles.RequestOptions`
+**requestOptions:** `RolesClient.RequestOptions`
@@ -20608,7 +21494,7 @@ const response = page.response;
-client.organizations.members.roles.assign(id, userId, { ...params }) -> void
+client.organizations.members.roles.assign(id, user_id, { ...params }) -> void
-
@@ -20664,7 +21550,7 @@ await client.organizations.members.roles.assign("id", "user_id", {
-
-**userId:** `string` — ID of the user to associate roles with.
+**user_id:** `string` — ID of the user to associate roles with.
@@ -20680,7 +21566,7 @@ await client.organizations.members.roles.assign("id", "user_id", {
-
-**requestOptions:** `Roles.RequestOptions`
+**requestOptions:** `RolesClient.RequestOptions`
@@ -20691,7 +21577,7 @@ await client.organizations.members.roles.assign("id", "user_id", {
-client.organizations.members.roles.delete(id, userId, { ...params }) -> void
+client.organizations.members.roles.delete(id, user_id, { ...params }) -> void
-
@@ -20747,7 +21633,7 @@ await client.organizations.members.roles.delete("id", "user_id", {
-
-**userId:** `string` — User ID of the organization member to remove roles from.
+**user_id:** `string` — User ID of the organization member to remove roles from.
@@ -20763,7 +21649,7 @@ await client.organizations.members.roles.delete("id", "user_id", {
-
-**requestOptions:** `Roles.RequestOptions`
+**requestOptions:** `RolesClient.RequestOptions`
@@ -20858,7 +21744,7 @@ const response = page.response;
-
-**requestOptions:** `Rendering.RequestOptions`
+**requestOptions:** `RenderingClient.RequestOptions`
@@ -20883,32 +21769,6 @@ const response = page.response;
Learn more about configuring render settings for advanced customization.
-
- Example head_tags array. See our documentation on using Liquid variables within head tags.
-
-{
- "head_tags": [
- {
- "tag": "script",
- "attributes": {
- "defer": true,
- "src": "URL_TO_ASSET",
- "async": true,
- "integrity": [
- "ASSET_SHA"
- ]
- }
- },
- {
- "tag": "link",
- "attributes": {
- "href": "URL_TO_ASSET",
- "rel": "stylesheet"
- }
- }
- ]
-}
-
@@ -20928,8 +21788,6 @@ await client.prompts.rendering.bulkUpdate({
{
prompt: "login",
screen: "login",
- rendering_mode: "advanced",
- head_tags: [{}],
},
],
});
@@ -20956,7 +21814,7 @@ await client.prompts.rendering.bulkUpdate({
-
-**requestOptions:** `Rendering.RequestOptions`
+**requestOptions:** `RenderingClient.RequestOptions`
@@ -21027,7 +21885,7 @@ await client.prompts.rendering.get("login", "login");
-
-**requestOptions:** `Rendering.RequestOptions`
+**requestOptions:** `RenderingClient.RequestOptions`
@@ -21052,32 +21910,6 @@ await client.prompts.rendering.get("login", "login");
Learn more about configuring render settings for advanced customization.
-
- Example head_tags array. See our documentation on using Liquid variables within head tags.
-
-{
- "head_tags": [
- {
- "tag": "script",
- "attributes": {
- "defer": true,
- "src": "URL_TO_ASSET",
- "async": true,
- "integrity": [
- "ASSET_SHA"
- ]
- }
- },
- {
- "tag": "link",
- "attributes": {
- "href": "URL_TO_ASSET",
- "rel": "stylesheet"
- }
- }
- ]
-}
-
@@ -21092,10 +21924,7 @@ Learn more about | null | undefined>;
}
+
+export type NormalizedClientOptions = T & {
+ logging: core.logging.Logger;
+ authProvider?: core.AuthProvider;
+};
+
+export type NormalizedClientOptionsWithAuth = NormalizedClientOptions & {
+ authProvider: core.AuthProvider;
+};
+
+export function normalizeClientOptions(options: T): NormalizedClientOptions {
+ return {
+ ...options,
+ logging: core.logging.createLogger(options?.logging),
+ } as NormalizedClientOptions;
+}
+
+export function normalizeClientOptionsWithAuth(
+ options: T,
+): NormalizedClientOptionsWithAuth {
+ const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth;
+ const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
+ normalized.authProvider ??= new BearerAuthProvider(normalizedWithNoOpAuthProvider);
+ return normalized;
+}
+
+function withNoOpAuthProvider(
+ options: NormalizedClientOptions,
+): NormalizedClientOptionsWithAuth {
+ return {
+ ...options,
+ authProvider: new core.NoOpAuthProvider(),
+ };
+}
diff --git a/src/management/Client.ts b/src/management/Client.ts
index 27d27c180d..67fe3fb0a7 100644
--- a/src/management/Client.ts
+++ b/src/management/Client.ts
@@ -1,265 +1,272 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "./BaseClient.js";
import * as environments from "./environments.js";
import * as core from "./core/index.js";
-import { Actions } from "./api/resources/actions/client/Client.js";
-import { Branding } from "./api/resources/branding/client/Client.js";
-import { ClientGrants } from "./api/resources/clientGrants/client/Client.js";
-import { Clients } from "./api/resources/clients/client/Client.js";
-import { Connections } from "./api/resources/connections/client/Client.js";
-import { CustomDomains } from "./api/resources/customDomains/client/Client.js";
-import { DeviceCredentials } from "./api/resources/deviceCredentials/client/Client.js";
-import { EmailTemplates } from "./api/resources/emailTemplates/client/Client.js";
-import { EventStreams } from "./api/resources/eventStreams/client/Client.js";
-import { Flows } from "./api/resources/flows/client/Client.js";
-import { Forms } from "./api/resources/forms/client/Client.js";
-import { UserGrants } from "./api/resources/userGrants/client/Client.js";
-import { Hooks } from "./api/resources/hooks/client/Client.js";
-import { Jobs } from "./api/resources/jobs/client/Client.js";
-import { LogStreams } from "./api/resources/logStreams/client/Client.js";
-import { Logs } from "./api/resources/logs/client/Client.js";
-import { NetworkAcls } from "./api/resources/networkAcls/client/Client.js";
-import { Organizations } from "./api/resources/organizations/client/Client.js";
-import { Prompts } from "./api/resources/prompts/client/Client.js";
-import { RefreshTokens } from "./api/resources/refreshTokens/client/Client.js";
-import { ResourceServers } from "./api/resources/resourceServers/client/Client.js";
-import { Roles } from "./api/resources/roles/client/Client.js";
-import { Rules } from "./api/resources/rules/client/Client.js";
-import { RulesConfigs } from "./api/resources/rulesConfigs/client/Client.js";
-import { SelfServiceProfiles } from "./api/resources/selfServiceProfiles/client/Client.js";
-import { Sessions } from "./api/resources/sessions/client/Client.js";
-import { Stats } from "./api/resources/stats/client/Client.js";
-import { SupplementalSignals } from "./api/resources/supplementalSignals/client/Client.js";
-import { Tickets } from "./api/resources/tickets/client/Client.js";
-import { TokenExchangeProfiles } from "./api/resources/tokenExchangeProfiles/client/Client.js";
-import { UserAttributeProfiles } from "./api/resources/userAttributeProfiles/client/Client.js";
-import { UserBlocks } from "./api/resources/userBlocks/client/Client.js";
-import { Users } from "./api/resources/users/client/Client.js";
-import { Anomaly } from "./api/resources/anomaly/client/Client.js";
-import { AttackProtection } from "./api/resources/attackProtection/client/Client.js";
-import { Emails } from "./api/resources/emails/client/Client.js";
-import { Guardian } from "./api/resources/guardian/client/Client.js";
-import { Keys } from "./api/resources/keys/client/Client.js";
-import { RiskAssessments } from "./api/resources/riskAssessments/client/Client.js";
-import { Tenants } from "./api/resources/tenants/client/Client.js";
-import { VerifiableCredentials } from "./api/resources/verifiableCredentials/client/Client.js";
+import { ActionsClient } from "./api/resources/actions/client/Client.js";
+import { BrandingClient } from "./api/resources/branding/client/Client.js";
+import { ClientGrantsClient } from "./api/resources/clientGrants/client/Client.js";
+import { ClientsClient } from "./api/resources/clients/client/Client.js";
+import { ConnectionProfilesClient } from "./api/resources/connectionProfiles/client/Client.js";
+import { ConnectionsClient } from "./api/resources/connections/client/Client.js";
+import { CustomDomainsClient } from "./api/resources/customDomains/client/Client.js";
+import { DeviceCredentialsClient } from "./api/resources/deviceCredentials/client/Client.js";
+import { EmailTemplatesClient } from "./api/resources/emailTemplates/client/Client.js";
+import { EventStreamsClient } from "./api/resources/eventStreams/client/Client.js";
+import { FlowsClient } from "./api/resources/flows/client/Client.js";
+import { FormsClient } from "./api/resources/forms/client/Client.js";
+import { UserGrantsClient } from "./api/resources/userGrants/client/Client.js";
+import { HooksClient } from "./api/resources/hooks/client/Client.js";
+import { JobsClient } from "./api/resources/jobs/client/Client.js";
+import { LogStreamsClient } from "./api/resources/logStreams/client/Client.js";
+import { LogsClient } from "./api/resources/logs/client/Client.js";
+import { NetworkAclsClient } from "./api/resources/networkAcls/client/Client.js";
+import { OrganizationsClient } from "./api/resources/organizations/client/Client.js";
+import { PromptsClient } from "./api/resources/prompts/client/Client.js";
+import { RefreshTokensClient } from "./api/resources/refreshTokens/client/Client.js";
+import { ResourceServersClient } from "./api/resources/resourceServers/client/Client.js";
+import { RolesClient } from "./api/resources/roles/client/Client.js";
+import { RulesClient } from "./api/resources/rules/client/Client.js";
+import { RulesConfigsClient } from "./api/resources/rulesConfigs/client/Client.js";
+import { SelfServiceProfilesClient } from "./api/resources/selfServiceProfiles/client/Client.js";
+import { SessionsClient } from "./api/resources/sessions/client/Client.js";
+import { StatsClient } from "./api/resources/stats/client/Client.js";
+import { SupplementalSignalsClient } from "./api/resources/supplementalSignals/client/Client.js";
+import { TicketsClient } from "./api/resources/tickets/client/Client.js";
+import { TokenExchangeProfilesClient } from "./api/resources/tokenExchangeProfiles/client/Client.js";
+import { UserAttributeProfilesClient } from "./api/resources/userAttributeProfiles/client/Client.js";
+import { UserBlocksClient } from "./api/resources/userBlocks/client/Client.js";
+import { UsersClient } from "./api/resources/users/client/Client.js";
+import { AnomalyClient } from "./api/resources/anomaly/client/Client.js";
+import { AttackProtectionClient } from "./api/resources/attackProtection/client/Client.js";
+import { EmailsClient } from "./api/resources/emails/client/Client.js";
+import { GuardianClient } from "./api/resources/guardian/client/Client.js";
+import { KeysClient } from "./api/resources/keys/client/Client.js";
+import { RiskAssessmentsClient } from "./api/resources/riskAssessments/client/Client.js";
+import { TenantsClient } from "./api/resources/tenants/client/Client.js";
+import { VerifiableCredentialsClient } from "./api/resources/verifiableCredentials/client/Client.js";
export declare namespace ManagementClient {
- export interface Options extends BaseClientOptions {}
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
export class ManagementClient {
- protected readonly _options: ManagementClient.Options;
- protected _actions: Actions | undefined;
- protected _branding: Branding | undefined;
- protected _clientGrants: ClientGrants | undefined;
- protected _clients: Clients | undefined;
- protected _connections: Connections | undefined;
- protected _customDomains: CustomDomains | undefined;
- protected _deviceCredentials: DeviceCredentials | undefined;
- protected _emailTemplates: EmailTemplates | undefined;
- protected _eventStreams: EventStreams | undefined;
- protected _flows: Flows | undefined;
- protected _forms: Forms | undefined;
- protected _userGrants: UserGrants | undefined;
- protected _hooks: Hooks | undefined;
- protected _jobs: Jobs | undefined;
- protected _logStreams: LogStreams | undefined;
- protected _logs: Logs | undefined;
- protected _networkAcls: NetworkAcls | undefined;
- protected _organizations: Organizations | undefined;
- protected _prompts: Prompts | undefined;
- protected _refreshTokens: RefreshTokens | undefined;
- protected _resourceServers: ResourceServers | undefined;
- protected _roles: Roles | undefined;
- protected _rules: Rules | undefined;
- protected _rulesConfigs: RulesConfigs | undefined;
- protected _selfServiceProfiles: SelfServiceProfiles | undefined;
- protected _sessions: Sessions | undefined;
- protected _stats: Stats | undefined;
- protected _supplementalSignals: SupplementalSignals | undefined;
- protected _tickets: Tickets | undefined;
- protected _tokenExchangeProfiles: TokenExchangeProfiles | undefined;
- protected _userAttributeProfiles: UserAttributeProfiles | undefined;
- protected _userBlocks: UserBlocks | undefined;
- protected _users: Users | undefined;
- protected _anomaly: Anomaly | undefined;
- protected _attackProtection: AttackProtection | undefined;
- protected _emails: Emails | undefined;
- protected _guardian: Guardian | undefined;
- protected _keys: Keys | undefined;
- protected _riskAssessments: RiskAssessments | undefined;
- protected _tenants: Tenants | undefined;
- protected _verifiableCredentials: VerifiableCredentials | undefined;
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _actions: ActionsClient | undefined;
+ protected _branding: BrandingClient | undefined;
+ protected _clientGrants: ClientGrantsClient | undefined;
+ protected _clients: ClientsClient | undefined;
+ protected _connectionProfiles: ConnectionProfilesClient | undefined;
+ protected _connections: ConnectionsClient | undefined;
+ protected _customDomains: CustomDomainsClient | undefined;
+ protected _deviceCredentials: DeviceCredentialsClient | undefined;
+ protected _emailTemplates: EmailTemplatesClient | undefined;
+ protected _eventStreams: EventStreamsClient | undefined;
+ protected _flows: FlowsClient | undefined;
+ protected _forms: FormsClient | undefined;
+ protected _userGrants: UserGrantsClient | undefined;
+ protected _hooks: HooksClient | undefined;
+ protected _jobs: JobsClient | undefined;
+ protected _logStreams: LogStreamsClient | undefined;
+ protected _logs: LogsClient | undefined;
+ protected _networkAcls: NetworkAclsClient | undefined;
+ protected _organizations: OrganizationsClient | undefined;
+ protected _prompts: PromptsClient | undefined;
+ protected _refreshTokens: RefreshTokensClient | undefined;
+ protected _resourceServers: ResourceServersClient | undefined;
+ protected _roles: RolesClient | undefined;
+ protected _rules: RulesClient | undefined;
+ protected _rulesConfigs: RulesConfigsClient | undefined;
+ protected _selfServiceProfiles: SelfServiceProfilesClient | undefined;
+ protected _sessions: SessionsClient | undefined;
+ protected _stats: StatsClient | undefined;
+ protected _supplementalSignals: SupplementalSignalsClient | undefined;
+ protected _tickets: TicketsClient | undefined;
+ protected _tokenExchangeProfiles: TokenExchangeProfilesClient | undefined;
+ protected _userAttributeProfiles: UserAttributeProfilesClient | undefined;
+ protected _userBlocks: UserBlocksClient | undefined;
+ protected _users: UsersClient | undefined;
+ protected _anomaly: AnomalyClient | undefined;
+ protected _attackProtection: AttackProtectionClient | undefined;
+ protected _emails: EmailsClient | undefined;
+ protected _guardian: GuardianClient | undefined;
+ protected _keys: KeysClient | undefined;
+ protected _riskAssessments: RiskAssessmentsClient | undefined;
+ protected _tenants: TenantsClient | undefined;
+ protected _verifiableCredentials: VerifiableCredentialsClient | undefined;
- constructor(_options: ManagementClient.Options) {
- this._options = _options;
+ constructor(options: ManagementClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get actions(): Actions {
- return (this._actions ??= new Actions(this._options));
+ public get actions(): ActionsClient {
+ return (this._actions ??= new ActionsClient(this._options));
}
- public get branding(): Branding {
- return (this._branding ??= new Branding(this._options));
+ public get branding(): BrandingClient {
+ return (this._branding ??= new BrandingClient(this._options));
}
- public get clientGrants(): ClientGrants {
- return (this._clientGrants ??= new ClientGrants(this._options));
+ public get clientGrants(): ClientGrantsClient {
+ return (this._clientGrants ??= new ClientGrantsClient(this._options));
}
- public get clients(): Clients {
- return (this._clients ??= new Clients(this._options));
+ public get clients(): ClientsClient {
+ return (this._clients ??= new ClientsClient(this._options));
}
- public get connections(): Connections {
- return (this._connections ??= new Connections(this._options));
+ public get connectionProfiles(): ConnectionProfilesClient {
+ return (this._connectionProfiles ??= new ConnectionProfilesClient(this._options));
}
- public get customDomains(): CustomDomains {
- return (this._customDomains ??= new CustomDomains(this._options));
+ public get connections(): ConnectionsClient {
+ return (this._connections ??= new ConnectionsClient(this._options));
}
- public get deviceCredentials(): DeviceCredentials {
- return (this._deviceCredentials ??= new DeviceCredentials(this._options));
+ public get customDomains(): CustomDomainsClient {
+ return (this._customDomains ??= new CustomDomainsClient(this._options));
}
- public get emailTemplates(): EmailTemplates {
- return (this._emailTemplates ??= new EmailTemplates(this._options));
+ public get deviceCredentials(): DeviceCredentialsClient {
+ return (this._deviceCredentials ??= new DeviceCredentialsClient(this._options));
}
- public get eventStreams(): EventStreams {
- return (this._eventStreams ??= new EventStreams(this._options));
+ public get emailTemplates(): EmailTemplatesClient {
+ return (this._emailTemplates ??= new EmailTemplatesClient(this._options));
}
- public get flows(): Flows {
- return (this._flows ??= new Flows(this._options));
+ public get eventStreams(): EventStreamsClient {
+ return (this._eventStreams ??= new EventStreamsClient(this._options));
}
- public get forms(): Forms {
- return (this._forms ??= new Forms(this._options));
+ public get flows(): FlowsClient {
+ return (this._flows ??= new FlowsClient(this._options));
}
- public get userGrants(): UserGrants {
- return (this._userGrants ??= new UserGrants(this._options));
+ public get forms(): FormsClient {
+ return (this._forms ??= new FormsClient(this._options));
}
- public get hooks(): Hooks {
- return (this._hooks ??= new Hooks(this._options));
+ public get userGrants(): UserGrantsClient {
+ return (this._userGrants ??= new UserGrantsClient(this._options));
}
- public get jobs(): Jobs {
- return (this._jobs ??= new Jobs(this._options));
+ public get hooks(): HooksClient {
+ return (this._hooks ??= new HooksClient(this._options));
}
- public get logStreams(): LogStreams {
- return (this._logStreams ??= new LogStreams(this._options));
+ public get jobs(): JobsClient {
+ return (this._jobs ??= new JobsClient(this._options));
}
- public get logs(): Logs {
- return (this._logs ??= new Logs(this._options));
+ public get logStreams(): LogStreamsClient {
+ return (this._logStreams ??= new LogStreamsClient(this._options));
}
- public get networkAcls(): NetworkAcls {
- return (this._networkAcls ??= new NetworkAcls(this._options));
+ public get logs(): LogsClient {
+ return (this._logs ??= new LogsClient(this._options));
}
- public get organizations(): Organizations {
- return (this._organizations ??= new Organizations(this._options));
+ public get networkAcls(): NetworkAclsClient {
+ return (this._networkAcls ??= new NetworkAclsClient(this._options));
}
- public get prompts(): Prompts {
- return (this._prompts ??= new Prompts(this._options));
+ public get organizations(): OrganizationsClient {
+ return (this._organizations ??= new OrganizationsClient(this._options));
}
- public get refreshTokens(): RefreshTokens {
- return (this._refreshTokens ??= new RefreshTokens(this._options));
+ public get prompts(): PromptsClient {
+ return (this._prompts ??= new PromptsClient(this._options));
}
- public get resourceServers(): ResourceServers {
- return (this._resourceServers ??= new ResourceServers(this._options));
+ public get refreshTokens(): RefreshTokensClient {
+ return (this._refreshTokens ??= new RefreshTokensClient(this._options));
}
- public get roles(): Roles {
- return (this._roles ??= new Roles(this._options));
+ public get resourceServers(): ResourceServersClient {
+ return (this._resourceServers ??= new ResourceServersClient(this._options));
}
- public get rules(): Rules {
- return (this._rules ??= new Rules(this._options));
+ public get roles(): RolesClient {
+ return (this._roles ??= new RolesClient(this._options));
}
- public get rulesConfigs(): RulesConfigs {
- return (this._rulesConfigs ??= new RulesConfigs(this._options));
+ public get rules(): RulesClient {
+ return (this._rules ??= new RulesClient(this._options));
}
- public get selfServiceProfiles(): SelfServiceProfiles {
- return (this._selfServiceProfiles ??= new SelfServiceProfiles(this._options));
+ public get rulesConfigs(): RulesConfigsClient {
+ return (this._rulesConfigs ??= new RulesConfigsClient(this._options));
}
- public get sessions(): Sessions {
- return (this._sessions ??= new Sessions(this._options));
+ public get selfServiceProfiles(): SelfServiceProfilesClient {
+ return (this._selfServiceProfiles ??= new SelfServiceProfilesClient(this._options));
}
- public get stats(): Stats {
- return (this._stats ??= new Stats(this._options));
+ public get sessions(): SessionsClient {
+ return (this._sessions ??= new SessionsClient(this._options));
}
- public get supplementalSignals(): SupplementalSignals {
- return (this._supplementalSignals ??= new SupplementalSignals(this._options));
+ public get stats(): StatsClient {
+ return (this._stats ??= new StatsClient(this._options));
}
- public get tickets(): Tickets {
- return (this._tickets ??= new Tickets(this._options));
+ public get supplementalSignals(): SupplementalSignalsClient {
+ return (this._supplementalSignals ??= new SupplementalSignalsClient(this._options));
}
- public get tokenExchangeProfiles(): TokenExchangeProfiles {
- return (this._tokenExchangeProfiles ??= new TokenExchangeProfiles(this._options));
+ public get tickets(): TicketsClient {
+ return (this._tickets ??= new TicketsClient(this._options));
}
- public get userAttributeProfiles(): UserAttributeProfiles {
- return (this._userAttributeProfiles ??= new UserAttributeProfiles(this._options));
+ public get tokenExchangeProfiles(): TokenExchangeProfilesClient {
+ return (this._tokenExchangeProfiles ??= new TokenExchangeProfilesClient(this._options));
}
- public get userBlocks(): UserBlocks {
- return (this._userBlocks ??= new UserBlocks(this._options));
+ public get userAttributeProfiles(): UserAttributeProfilesClient {
+ return (this._userAttributeProfiles ??= new UserAttributeProfilesClient(this._options));
}
- public get users(): Users {
- return (this._users ??= new Users(this._options));
+ public get userBlocks(): UserBlocksClient {
+ return (this._userBlocks ??= new UserBlocksClient(this._options));
}
- public get anomaly(): Anomaly {
- return (this._anomaly ??= new Anomaly(this._options));
+ public get users(): UsersClient {
+ return (this._users ??= new UsersClient(this._options));
}
- public get attackProtection(): AttackProtection {
- return (this._attackProtection ??= new AttackProtection(this._options));
+ public get anomaly(): AnomalyClient {
+ return (this._anomaly ??= new AnomalyClient(this._options));
}
- public get emails(): Emails {
- return (this._emails ??= new Emails(this._options));
+ public get attackProtection(): AttackProtectionClient {
+ return (this._attackProtection ??= new AttackProtectionClient(this._options));
}
- public get guardian(): Guardian {
- return (this._guardian ??= new Guardian(this._options));
+ public get emails(): EmailsClient {
+ return (this._emails ??= new EmailsClient(this._options));
}
- public get keys(): Keys {
- return (this._keys ??= new Keys(this._options));
+ public get guardian(): GuardianClient {
+ return (this._guardian ??= new GuardianClient(this._options));
}
- public get riskAssessments(): RiskAssessments {
- return (this._riskAssessments ??= new RiskAssessments(this._options));
+ public get keys(): KeysClient {
+ return (this._keys ??= new KeysClient(this._options));
}
- public get tenants(): Tenants {
- return (this._tenants ??= new Tenants(this._options));
+ public get riskAssessments(): RiskAssessmentsClient {
+ return (this._riskAssessments ??= new RiskAssessmentsClient(this._options));
}
- public get verifiableCredentials(): VerifiableCredentials {
- return (this._verifiableCredentials ??= new VerifiableCredentials(this._options));
+ public get tenants(): TenantsClient {
+ return (this._tenants ??= new TenantsClient(this._options));
+ }
+
+ public get verifiableCredentials(): VerifiableCredentialsClient {
+ return (this._verifiableCredentials ??= new VerifiableCredentialsClient(this._options));
}
}
diff --git a/src/management/api/errors/BadRequestError.ts b/src/management/api/errors/BadRequestError.ts
index 79fe19853b..ec9157f989 100644
--- a/src/management/api/errors/BadRequestError.ts
+++ b/src/management/api/errors/BadRequestError.ts
@@ -11,6 +11,11 @@ export class BadRequestError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, BadRequestError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/errors/ConflictError.ts b/src/management/api/errors/ConflictError.ts
index 92267320d9..30f81cb018 100644
--- a/src/management/api/errors/ConflictError.ts
+++ b/src/management/api/errors/ConflictError.ts
@@ -11,6 +11,11 @@ export class ConflictError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, ConflictError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/errors/ContentTooLargeError.ts b/src/management/api/errors/ContentTooLargeError.ts
index d93249c9c9..cad6296125 100644
--- a/src/management/api/errors/ContentTooLargeError.ts
+++ b/src/management/api/errors/ContentTooLargeError.ts
@@ -11,6 +11,11 @@ export class ContentTooLargeError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, ContentTooLargeError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/errors/ForbiddenError.ts b/src/management/api/errors/ForbiddenError.ts
index 79c69a14d7..0b727503d8 100644
--- a/src/management/api/errors/ForbiddenError.ts
+++ b/src/management/api/errors/ForbiddenError.ts
@@ -11,6 +11,11 @@ export class ForbiddenError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, ForbiddenError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/errors/InternalServerError.ts b/src/management/api/errors/InternalServerError.ts
index cba6978e3c..fcf94549f3 100644
--- a/src/management/api/errors/InternalServerError.ts
+++ b/src/management/api/errors/InternalServerError.ts
@@ -11,6 +11,11 @@ export class InternalServerError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, InternalServerError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/errors/NotFoundError.ts b/src/management/api/errors/NotFoundError.ts
index 0eeb7776b3..365f815734 100644
--- a/src/management/api/errors/NotFoundError.ts
+++ b/src/management/api/errors/NotFoundError.ts
@@ -11,6 +11,11 @@ export class NotFoundError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, NotFoundError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/errors/PaymentRequiredError.ts b/src/management/api/errors/PaymentRequiredError.ts
index 66a8906795..f0c0a9b117 100644
--- a/src/management/api/errors/PaymentRequiredError.ts
+++ b/src/management/api/errors/PaymentRequiredError.ts
@@ -11,6 +11,11 @@ export class PaymentRequiredError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, PaymentRequiredError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/errors/ServiceUnavailableError.ts b/src/management/api/errors/ServiceUnavailableError.ts
index 899fcc9aa4..a76ff716e9 100644
--- a/src/management/api/errors/ServiceUnavailableError.ts
+++ b/src/management/api/errors/ServiceUnavailableError.ts
@@ -11,6 +11,11 @@ export class ServiceUnavailableError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, ServiceUnavailableError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/errors/TooManyRequestsError.ts b/src/management/api/errors/TooManyRequestsError.ts
index 2eae718162..10a8a0e0c7 100644
--- a/src/management/api/errors/TooManyRequestsError.ts
+++ b/src/management/api/errors/TooManyRequestsError.ts
@@ -11,6 +11,11 @@ export class TooManyRequestsError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, TooManyRequestsError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/errors/UnauthorizedError.ts b/src/management/api/errors/UnauthorizedError.ts
index 9b0b1ae0cc..ac9fb7b229 100644
--- a/src/management/api/errors/UnauthorizedError.ts
+++ b/src/management/api/errors/UnauthorizedError.ts
@@ -11,6 +11,11 @@ export class UnauthorizedError extends errors.ManagementError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, UnauthorizedError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/management/api/requests/requests.ts b/src/management/api/requests/requests.ts
index 0a5ad8bfef..18c5a7cba3 100644
--- a/src/management/api/requests/requests.ts
+++ b/src/management/api/requests/requests.ts
@@ -289,11 +289,13 @@ export interface CreateClientRequestContent {
* See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.
*/
skip_non_verifiable_callback_uri_confirmation_prompt?: boolean;
+ token_exchange?: Management.ClientTokenExchangeConfiguration;
/** Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */
par_request_expiry?: number | null;
token_quota?: Management.CreateTokenQuota;
/** The identifier of the resource server that this client is linked to. */
resource_server_identifier?: string;
+ express_configuration?: Management.ExpressConfiguration;
async_approval_notification_channels?: Management.ClientAsyncApprovalNotificationsChannelsApiPostConfiguration;
}
@@ -392,11 +394,55 @@ export interface UpdateClientRequestContent {
* See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.
*/
skip_non_verifiable_callback_uri_confirmation_prompt?: boolean | null;
+ token_exchange?: Management.ClientTokenExchangeConfigurationOrNull | null;
/** Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */
par_request_expiry?: number | null;
+ express_configuration?: Management.ExpressConfigurationOrNull | null;
async_approval_notification_channels?: Management.ClientAsyncApprovalNotificationsChannelsApiPatchConfiguration;
}
+/**
+ * @example
+ * {
+ * from: "from",
+ * take: 1
+ * }
+ */
+export interface ListConnectionProfileRequestParameters {
+ /** Optional Id from which to start selection. */
+ from?: string | null;
+ /** Number of results per page. Defaults to 5. */
+ take?: number | null;
+}
+
+/**
+ * @example
+ * {
+ * name: "name"
+ * }
+ */
+export interface CreateConnectionProfileRequestContent {
+ name: Management.ConnectionProfileName;
+ organization?: Management.ConnectionProfileOrganization;
+ connection_name_prefix_template?: Management.ConnectionNamePrefixTemplate;
+ enabled_features?: Management.ConnectionProfileEnabledFeatures;
+ connection_config?: Management.ConnectionProfileConfig;
+ strategy_overrides?: Management.ConnectionProfileStrategyOverrides;
+}
+
+/**
+ * @example
+ * {}
+ */
+export interface UpdateConnectionProfileRequestContent {
+ name?: Management.ConnectionProfileName;
+ organization?: Management.ConnectionProfileOrganization;
+ connection_name_prefix_template?: Management.ConnectionNamePrefixTemplate;
+ enabled_features?: Management.ConnectionProfileEnabledFeatures;
+ connection_config?: Management.ConnectionProfileConfig;
+ strategy_overrides?: Management.ConnectionProfileStrategyOverrides;
+}
+
/**
* @example
* {
@@ -484,6 +530,32 @@ export interface UpdateConnectionRequestContent {
connected_accounts?: Management.ConnectionConnectedAccountsPurpose;
}
+/**
+ * @example
+ * {
+ * take: 1,
+ * from: "from",
+ * q: "q",
+ * fields: "fields",
+ * include_fields: true,
+ * sort: "sort"
+ * }
+ */
+export interface ListCustomDomainsRequestParameters {
+ /** Number of results per page. Defaults to 50. */
+ take?: number | null;
+ /** Optional Id from which to start selection. */
+ from?: string | null;
+ /** Query in Lucene query string syntax. */
+ q?: string | null;
+ /** Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields. */
+ fields?: string | null;
+ /** Whether specified fields are to be included (true) or excluded (false). */
+ include_fields?: boolean | null;
+ /** Field to sort by. Only domain:1 (ascending order by domain) is supported at this time. */
+ sort?: string | null;
+}
+
/**
* @example
* {
@@ -498,6 +570,7 @@ export interface CreateCustomDomainRequestContent {
verification_method?: Management.CustomDomainVerificationMethodEnum;
tls_policy?: Management.CustomDomainTlsPolicyEnum;
custom_client_ip_header?: Management.CustomDomainCustomClientIpHeader | undefined;
+ domain_metadata?: Management.DomainMetadata;
}
/**
@@ -507,6 +580,7 @@ export interface CreateCustomDomainRequestContent {
export interface UpdateCustomDomainRequestContent {
tls_policy?: Management.CustomDomainTlsPolicyEnum;
custom_client_ip_header?: Management.CustomDomainCustomClientIpHeader | undefined;
+ domain_metadata?: Management.DomainMetadata;
}
/**
@@ -1432,6 +1506,7 @@ export interface ChangePasswordTicketRequestContent {
mark_email_as_verified?: boolean;
/** Whether to include the email address as part of the returnUrl in the reset_email (true), or not (false). */
includeEmailInRedirect?: boolean;
+ identity?: Management.ChangePasswordTicketIdentity;
}
/**
@@ -2971,9 +3046,7 @@ export interface ListAculsRequestParameters {
* {
* configs: [{
* prompt: "login",
- * screen: "login",
- * rendering_mode: "advanced",
- * head_tags: [{}]
+ * screen: "login"
* }]
* }
*/
@@ -2983,22 +3056,18 @@ export interface BulkUpdateAculRequestContent {
/**
* @example
- * {
- * rendering_mode: "advanced",
- * head_tags: [{}]
- * }
+ * {}
*/
export interface UpdateAculRequestContent {
- rendering_mode: Management.AculRenderingModeEnum;
- /** Context values to make available */
- context_configuration?: string[];
+ rendering_mode?: Management.AculRenderingModeEnum;
+ context_configuration?: Management.AculContextConfiguration;
/** Override Universal Login default head tags */
default_head_tags_disabled?: boolean | null;
- /** An array of head tags */
- head_tags: Management.AculHeadTag[];
- filters?: Management.AculFilters | null;
/** Use page template with ACUL */
use_page_template?: boolean | null;
+ /** An array of head tags */
+ head_tags?: Management.AculHeadTag[];
+ filters?: Management.AculFilters | null;
}
/**
@@ -3186,6 +3255,7 @@ export interface UpdateTenantSettingsRequestContent {
* See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information.
*/
skip_non_verifiable_callback_uri_confirmation_prompt?: boolean | null;
+ resource_parameter_profile?: Management.TenantSettingsResourceParameterProfile;
}
export namespace UpdateTenantSettingsRequestContent {
diff --git a/src/management/api/resources/actions/client/Client.ts b/src/management/api/resources/actions/client/Client.ts
index f4c582ddc3..a011f1b7cb 100644
--- a/src/management/api/resources/actions/client/Client.ts
+++ b/src/management/api/resources/actions/client/Client.ts
@@ -1,48 +1,50 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
import * as environments from "../../../../environments.js";
import * as core from "../../../../core/index.js";
import * as Management from "../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
+import { mergeHeaders } from "../../../../core/headers.js";
import * as errors from "../../../../errors/index.js";
-import { Versions } from "../resources/versions/client/Client.js";
-import { Executions } from "../resources/executions/client/Client.js";
-import { Triggers } from "../resources/triggers/client/Client.js";
+import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
+import { VersionsClient } from "../resources/versions/client/Client.js";
+import { ExecutionsClient } from "../resources/executions/client/Client.js";
+import { TriggersClient } from "../resources/triggers/client/Client.js";
-export declare namespace Actions {
- export interface Options extends BaseClientOptions {}
+export declare namespace ActionsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Actions {
- protected readonly _options: Actions.Options;
- protected _versions: Versions | undefined;
- protected _executions: Executions | undefined;
- protected _triggers: Triggers | undefined;
+export class ActionsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _versions: VersionsClient | undefined;
+ protected _executions: ExecutionsClient | undefined;
+ protected _triggers: TriggersClient | undefined;
- constructor(_options: Actions.Options) {
- this._options = _options;
+ constructor(options: ActionsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get versions(): Versions {
- return (this._versions ??= new Versions(this._options));
+ public get versions(): VersionsClient {
+ return (this._versions ??= new VersionsClient(this._options));
}
- public get executions(): Executions {
- return (this._executions ??= new Executions(this._options));
+ public get executions(): ExecutionsClient {
+ return (this._executions ??= new ExecutionsClient(this._options));
}
- public get triggers(): Triggers {
- return (this._triggers ??= new Triggers(this._options));
+ public get triggers(): TriggersClient {
+ return (this._triggers ??= new TriggersClient(this._options));
}
/**
* Retrieve all actions.
*
* @param {Management.ListActionsRequestParameters} request
- * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -61,7 +63,7 @@ export class Actions {
*/
public async list(
request: Management.ListActionsRequestParameters = {},
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): Promise> {
const list = core.HttpResponsePromise.interceptFunction(
async (
@@ -87,9 +89,10 @@ export class Actions {
if (installed !== undefined) {
_queryParams["installed"] = installed?.toString() ?? null;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -106,6 +109,7 @@ export class Actions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -140,21 +144,7 @@ export class Actions {
});
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /actions/actions.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/actions/actions");
},
);
let _offset = request?.page != null ? request?.page : 0;
@@ -162,10 +152,10 @@ export class Actions {
return new core.Page({
response: dataWithRawResponse.data,
rawResponse: dataWithRawResponse.rawResponse,
- hasNextPage: (response) => (response?.actions ?? []).length >= (request?.per_page ?? 1),
+ hasNextPage: (response) => (response?.actions ?? []).length >= Math.floor(request?.per_page ?? 1),
getItems: (response) => response?.actions ?? [],
- loadPage: (response) => {
- _offset += response?.actions != null ? response.actions.length : 1;
+ loadPage: (_response) => {
+ _offset += 1;
return list(core.setObjectProperty(request, "page", _offset));
},
});
@@ -175,7 +165,7 @@ export class Actions {
* Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow.
*
* @param {Management.CreateActionRequestContent} request
- * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -192,18 +182,19 @@ export class Actions {
*/
public create(
request: Management.CreateActionRequestContent,
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
}
private async __create(
request: Management.CreateActionRequestContent,
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -223,6 +214,7 @@ export class Actions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -250,28 +242,14 @@ export class Actions {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling POST /actions/actions.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/actions/actions");
}
/**
* Retrieve an action by its ID.
*
* @param {string} id - The ID of the action to retrieve.
- * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -284,18 +262,19 @@ export class Actions {
*/
public get(
id: string,
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
}
private async __get(
id: string,
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -312,6 +291,7 @@ export class Actions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: _response.body as Management.GetActionResponseContent, rawResponse: _response.rawResponse };
@@ -338,21 +318,7 @@ export class Actions {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /actions/actions/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/actions/actions/{id}");
}
/**
@@ -360,7 +326,7 @@ export class Actions {
*
* @param {string} id - The ID of the action to delete.
* @param {Management.DeleteActionRequestParameters} request
- * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -376,7 +342,7 @@ export class Actions {
public delete(
id: string,
request: Management.DeleteActionRequestParameters = {},
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__delete(id, request, requestOptions));
}
@@ -384,7 +350,7 @@ export class Actions {
private async __delete(
id: string,
request: Management.DeleteActionRequestParameters = {},
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): Promise> {
const { force } = request;
const _queryParams: Record = {};
@@ -392,9 +358,10 @@ export class Actions {
_queryParams["force"] = force?.toString() ?? null;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -411,6 +378,7 @@ export class Actions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -437,21 +405,7 @@ export class Actions {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling DELETE /actions/actions/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/actions/actions/{id}");
}
/**
@@ -459,7 +413,7 @@ export class Actions {
*
* @param {string} id - The id of the action to update.
* @param {Management.UpdateActionRequestContent} request
- * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -473,7 +427,7 @@ export class Actions {
public update(
id: string,
request: Management.UpdateActionRequestContent = {},
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
}
@@ -481,11 +435,12 @@ export class Actions {
private async __update(
id: string,
request: Management.UpdateActionRequestContent = {},
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -505,6 +460,7 @@ export class Actions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -534,28 +490,14 @@ export class Actions {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling PATCH /actions/actions/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/actions/actions/{id}");
}
/**
* Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow.
*
* @param {string} id - The ID of an action.
- * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -567,18 +509,19 @@ export class Actions {
*/
public deploy(
id: string,
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__deploy(id, requestOptions));
}
private async __deploy(
id: string,
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -595,6 +538,7 @@ export class Actions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -622,23 +566,7 @@ export class Actions {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling POST /actions/actions/{id}/deploy.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/actions/actions/{id}/deploy");
}
/**
@@ -646,7 +574,7 @@ export class Actions {
*
* @param {string} id - The id of the action to test.
* @param {Management.TestActionRequestContent} request
- * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -663,7 +591,7 @@ export class Actions {
public test(
id: string,
request: Management.TestActionRequestContent,
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__test(id, request, requestOptions));
}
@@ -671,11 +599,12 @@ export class Actions {
private async __test(
id: string,
request: Management.TestActionRequestContent,
- requestOptions?: Actions.RequestOptions,
+ requestOptions?: ActionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -695,6 +624,7 @@ export class Actions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: _response.body as Management.TestActionResponseContent, rawResponse: _response.rawResponse };
@@ -719,26 +649,6 @@ export class Actions {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling POST /actions/actions/{id}/test.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/actions/actions/{id}/test");
}
}
diff --git a/src/management/api/resources/actions/resources/executions/client/Client.ts b/src/management/api/resources/actions/resources/executions/client/Client.ts
index c534f0e428..99ecfb9fdc 100644
--- a/src/management/api/resources/actions/resources/executions/client/Client.ts
+++ b/src/management/api/resources/actions/resources/executions/client/Client.ts
@@ -1,30 +1,32 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Executions {
- export interface Options extends BaseClientOptions {}
+export declare namespace ExecutionsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Executions {
- protected readonly _options: Executions.Options;
+export class ExecutionsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Executions.Options) {
- this._options = _options;
+ constructor(options: ExecutionsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* Retrieve information about a specific execution of a trigger. Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation.
*
* @param {string} id - The ID of the execution to retrieve.
- * @param {Executions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ExecutionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -37,18 +39,19 @@ export class Executions {
*/
public get(
id: string,
- requestOptions?: Executions.RequestOptions,
+ requestOptions?: ExecutionsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
}
private async __get(
id: string,
- requestOptions?: Executions.RequestOptions,
+ requestOptions?: ExecutionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -65,6 +68,7 @@ export class Executions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -94,24 +98,6 @@ export class Executions {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /actions/executions/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/actions/executions/{id}");
}
}
diff --git a/src/management/api/resources/actions/resources/triggers/client/Client.ts b/src/management/api/resources/actions/resources/triggers/client/Client.ts
index 18213fcb59..34a41c1516 100644
--- a/src/management/api/resources/actions/resources/triggers/client/Client.ts
+++ b/src/management/api/resources/actions/resources/triggers/client/Client.ts
@@ -1,35 +1,37 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
-import { Bindings } from "../resources/bindings/client/Client.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
+import { BindingsClient } from "../resources/bindings/client/Client.js";
-export declare namespace Triggers {
- export interface Options extends BaseClientOptions {}
+export declare namespace TriggersClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Triggers {
- protected readonly _options: Triggers.Options;
- protected _bindings: Bindings | undefined;
+export class TriggersClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _bindings: BindingsClient | undefined;
- constructor(_options: Triggers.Options) {
- this._options = _options;
+ constructor(options: TriggersClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get bindings(): Bindings {
- return (this._bindings ??= new Bindings(this._options));
+ public get bindings(): BindingsClient {
+ return (this._bindings ??= new BindingsClient(this._options));
}
/**
* Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound.
*
- * @param {Triggers.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TriggersClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -40,17 +42,18 @@ export class Triggers {
* await client.actions.triggers.list()
*/
public list(
- requestOptions?: Triggers.RequestOptions,
+ requestOptions?: TriggersClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
}
private async __list(
- requestOptions?: Triggers.RequestOptions,
+ requestOptions?: TriggersClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -67,6 +70,7 @@ export class Triggers {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -94,24 +98,6 @@ export class Triggers {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /actions/triggers.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/actions/triggers");
}
}
diff --git a/src/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.ts b/src/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.ts
index a3d94c44c4..06648c216d 100644
--- a/src/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.ts
+++ b/src/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.ts
@@ -1,23 +1,28 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js";
+import {
+ type NormalizedClientOptionsWithAuth,
+ normalizeClientOptionsWithAuth,
+} from "../../../../../../../../BaseClient.js";
import * as environments from "../../../../../../../../environments.js";
import * as core from "../../../../../../../../core/index.js";
import * as Management from "../../../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../../../core/headers.js";
import * as errors from "../../../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Bindings {
- export interface Options extends BaseClientOptions {}
+export declare namespace BindingsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Bindings {
- protected readonly _options: Bindings.Options;
+export class BindingsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Bindings.Options) {
- this._options = _options;
+ constructor(options: BindingsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -25,7 +30,7 @@ export class Bindings {
*
* @param {Management.ActionTriggerTypeEnum} triggerId - An actions extensibility point.
* @param {Management.ListActionTriggerBindingsRequestParameters} request
- * @param {Bindings.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BindingsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -41,7 +46,7 @@ export class Bindings {
public async list(
triggerId: Management.ActionTriggerTypeEnum,
request: Management.ListActionTriggerBindingsRequestParameters = {},
- requestOptions?: Bindings.RequestOptions,
+ requestOptions?: BindingsClient.RequestOptions,
): Promise> {
const list = core.HttpResponsePromise.interceptFunction(
async (
@@ -55,9 +60,10 @@ export class Bindings {
if (perPage !== undefined) {
_queryParams["per_page"] = perPage?.toString() ?? null;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -74,6 +80,7 @@ export class Bindings {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -108,23 +115,12 @@ export class Bindings {
});
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /actions/triggers/{triggerId}/bindings.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/actions/triggers/{triggerId}/bindings",
+ );
},
);
let _offset = request?.page != null ? request?.page : 0;
@@ -132,10 +128,10 @@ export class Bindings {
return new core.Page({
response: dataWithRawResponse.data,
rawResponse: dataWithRawResponse.rawResponse,
- hasNextPage: (response) => (response?.bindings ?? []).length >= (request?.per_page ?? 1),
+ hasNextPage: (response) => (response?.bindings ?? []).length >= Math.floor(request?.per_page ?? 1),
getItems: (response) => response?.bindings ?? [],
- loadPage: (response) => {
- _offset += response?.bindings != null ? response.bindings.length : 1;
+ loadPage: (_response) => {
+ _offset += 1;
return list(core.setObjectProperty(request, "page", _offset));
},
});
@@ -146,7 +142,7 @@ export class Bindings {
*
* @param {Management.ActionTriggerTypeEnum} triggerId - An actions extensibility point.
* @param {Management.UpdateActionBindingsRequestContent} request
- * @param {Bindings.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BindingsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -159,7 +155,7 @@ export class Bindings {
public updateMany(
triggerId: Management.ActionTriggerTypeEnum,
request: Management.UpdateActionBindingsRequestContent = {},
- requestOptions?: Bindings.RequestOptions,
+ requestOptions?: BindingsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__updateMany(triggerId, request, requestOptions));
}
@@ -167,11 +163,12 @@ export class Bindings {
private async __updateMany(
triggerId: Management.ActionTriggerTypeEnum,
request: Management.UpdateActionBindingsRequestContent = {},
- requestOptions?: Bindings.RequestOptions,
+ requestOptions?: BindingsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -191,6 +188,7 @@ export class Bindings {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -218,26 +216,11 @@ export class Bindings {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /actions/triggers/{triggerId}/bindings.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/actions/triggers/{triggerId}/bindings",
+ );
}
}
diff --git a/src/management/api/resources/actions/resources/versions/client/Client.ts b/src/management/api/resources/actions/resources/versions/client/Client.ts
index 285df46ea7..0f91b9f36b 100644
--- a/src/management/api/resources/actions/resources/versions/client/Client.ts
+++ b/src/management/api/resources/actions/resources/versions/client/Client.ts
@@ -1,23 +1,25 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Versions {
- export interface Options extends BaseClientOptions {}
+export declare namespace VersionsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Versions {
- protected readonly _options: Versions.Options;
+export class VersionsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Versions.Options) {
- this._options = _options;
+ constructor(options: VersionsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -25,7 +27,7 @@ export class Versions {
*
* @param {string} actionId - The ID of the action.
* @param {Management.ListActionVersionsRequestParameters} request
- * @param {Versions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -41,7 +43,7 @@ export class Versions {
public async list(
actionId: string,
request: Management.ListActionVersionsRequestParameters = {},
- requestOptions?: Versions.RequestOptions,
+ requestOptions?: VersionsClient.RequestOptions,
): Promise> {
const list = core.HttpResponsePromise.interceptFunction(
async (
@@ -55,9 +57,10 @@ export class Versions {
if (perPage !== undefined) {
_queryParams["per_page"] = perPage?.toString() ?? null;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -74,6 +77,7 @@ export class Versions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -108,23 +112,12 @@ export class Versions {
});
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /actions/actions/{actionId}/versions.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/actions/actions/{actionId}/versions",
+ );
},
);
let _offset = request?.page != null ? request?.page : 0;
@@ -132,10 +125,10 @@ export class Versions {
return new core.Page({
response: dataWithRawResponse.data,
rawResponse: dataWithRawResponse.rawResponse,
- hasNextPage: (response) => (response?.versions ?? []).length >= (request?.per_page ?? 1),
+ hasNextPage: (response) => (response?.versions ?? []).length >= Math.floor(request?.per_page ?? 1),
getItems: (response) => response?.versions ?? [],
- loadPage: (response) => {
- _offset += response?.versions != null ? response.versions.length : 1;
+ loadPage: (_response) => {
+ _offset += 1;
return list(core.setObjectProperty(request, "page", _offset));
},
});
@@ -146,7 +139,7 @@ export class Versions {
*
* @param {string} actionId - The ID of the action.
* @param {string} id - The ID of the action version.
- * @param {Versions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -160,7 +153,7 @@ export class Versions {
public get(
actionId: string,
id: string,
- requestOptions?: Versions.RequestOptions,
+ requestOptions?: VersionsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(actionId, id, requestOptions));
}
@@ -168,11 +161,12 @@ export class Versions {
private async __get(
actionId: string,
id: string,
- requestOptions?: Versions.RequestOptions,
+ requestOptions?: VersionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -189,6 +183,7 @@ export class Versions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -218,23 +213,12 @@ export class Versions {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /actions/actions/{actionId}/versions/{id}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/actions/actions/{actionId}/versions/{id}",
+ );
}
/**
@@ -243,7 +227,7 @@ export class Versions {
* @param {string} actionId - The ID of an action.
* @param {string} id - The ID of an action version.
* @param {Management.DeployActionVersionRequestContent | undefined} request
- * @param {Versions.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {VersionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -257,7 +241,7 @@ export class Versions {
actionId: string,
id: string,
request?: Management.DeployActionVersionRequestContent | undefined,
- requestOptions?: Versions.RequestOptions,
+ requestOptions?: VersionsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__deploy(actionId, id, request, requestOptions));
}
@@ -266,11 +250,12 @@ export class Versions {
actionId: string,
id: string,
request?: Management.DeployActionVersionRequestContent | undefined,
- requestOptions?: Versions.RequestOptions,
+ requestOptions?: VersionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -290,6 +275,7 @@ export class Versions {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -317,26 +303,11 @@ export class Versions {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling POST /actions/actions/{actionId}/versions/{id}/deploy.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/actions/actions/{actionId}/versions/{id}/deploy",
+ );
}
}
diff --git a/src/management/api/resources/anomaly/client/Client.ts b/src/management/api/resources/anomaly/client/Client.ts
index 0e7c7fe3b8..06e6ec3e4c 100644
--- a/src/management/api/resources/anomaly/client/Client.ts
+++ b/src/management/api/resources/anomaly/client/Client.ts
@@ -1,23 +1,24 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions } from "../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
import * as environments from "../../../../environments.js";
import * as core from "../../../../core/index.js";
-import { Blocks } from "../resources/blocks/client/Client.js";
+import { BlocksClient } from "../resources/blocks/client/Client.js";
-export declare namespace Anomaly {
- export interface Options extends BaseClientOptions {}
+export declare namespace AnomalyClient {
+ export type Options = BaseClientOptions;
}
-export class Anomaly {
- protected readonly _options: Anomaly.Options;
- protected _blocks: Blocks | undefined;
+export class AnomalyClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _blocks: BlocksClient | undefined;
- constructor(_options: Anomaly.Options) {
- this._options = _options;
+ constructor(options: AnomalyClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get blocks(): Blocks {
- return (this._blocks ??= new Blocks(this._options));
+ public get blocks(): BlocksClient {
+ return (this._blocks ??= new BlocksClient(this._options));
}
}
diff --git a/src/management/api/resources/anomaly/resources/blocks/client/Client.ts b/src/management/api/resources/anomaly/resources/blocks/client/Client.ts
index 586ea3c7d2..8a65b1495b 100644
--- a/src/management/api/resources/anomaly/resources/blocks/client/Client.ts
+++ b/src/management/api/resources/anomaly/resources/blocks/client/Client.ts
@@ -1,30 +1,32 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Blocks {
- export interface Options extends BaseClientOptions {}
+export declare namespace BlocksClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Blocks {
- protected readonly _options: Blocks.Options;
+export class BlocksClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Blocks.Options) {
- this._options = _options;
+ constructor(options: BlocksClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* Check if the given IP address is blocked via the Suspicious IP Throttling due to multiple suspicious attempts.
*
* @param {Management.AnomalyIpFormat} id - IP address to check.
- * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BlocksClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -37,18 +39,19 @@ export class Blocks {
*/
public checkIp(
id: Management.AnomalyIpFormat,
- requestOptions?: Blocks.RequestOptions,
+ requestOptions?: BlocksClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__checkIp(id, requestOptions));
}
private async __checkIp(
id: Management.AnomalyIpFormat,
- requestOptions?: Blocks.RequestOptions,
+ requestOptions?: BlocksClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -65,6 +68,7 @@ export class Blocks {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -91,28 +95,14 @@ export class Blocks {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /anomaly/blocks/ips/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/anomaly/blocks/ips/{id}");
}
/**
* Remove a block imposed by Suspicious IP Throttling for the given IP address.
*
* @param {Management.AnomalyIpFormat} id - IP address to unblock.
- * @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BlocksClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -124,18 +114,19 @@ export class Blocks {
*/
public unblockIp(
id: Management.AnomalyIpFormat,
- requestOptions?: Blocks.RequestOptions,
+ requestOptions?: BlocksClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__unblockIp(id, requestOptions));
}
private async __unblockIp(
id: Management.AnomalyIpFormat,
- requestOptions?: Blocks.RequestOptions,
+ requestOptions?: BlocksClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -152,6 +143,7 @@ export class Blocks {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -176,26 +168,6 @@ export class Blocks {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling DELETE /anomaly/blocks/ips/{id}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/anomaly/blocks/ips/{id}");
}
}
diff --git a/src/management/api/resources/attackProtection/client/Client.ts b/src/management/api/resources/attackProtection/client/Client.ts
index faa7f9ab1e..9a507993db 100644
--- a/src/management/api/resources/attackProtection/client/Client.ts
+++ b/src/management/api/resources/attackProtection/client/Client.ts
@@ -1,47 +1,48 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions } from "../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
import * as environments from "../../../../environments.js";
import * as core from "../../../../core/index.js";
-import { BotDetection } from "../resources/botDetection/client/Client.js";
-import { BreachedPasswordDetection } from "../resources/breachedPasswordDetection/client/Client.js";
-import { BruteForceProtection } from "../resources/bruteForceProtection/client/Client.js";
-import { Captcha } from "../resources/captcha/client/Client.js";
-import { SuspiciousIpThrottling } from "../resources/suspiciousIpThrottling/client/Client.js";
-
-export declare namespace AttackProtection {
- export interface Options extends BaseClientOptions {}
+import { BotDetectionClient } from "../resources/botDetection/client/Client.js";
+import { BreachedPasswordDetectionClient } from "../resources/breachedPasswordDetection/client/Client.js";
+import { BruteForceProtectionClient } from "../resources/bruteForceProtection/client/Client.js";
+import { CaptchaClient } from "../resources/captcha/client/Client.js";
+import { SuspiciousIpThrottlingClient } from "../resources/suspiciousIpThrottling/client/Client.js";
+
+export declare namespace AttackProtectionClient {
+ export type Options = BaseClientOptions;
}
-export class AttackProtection {
- protected readonly _options: AttackProtection.Options;
- protected _botDetection: BotDetection | undefined;
- protected _breachedPasswordDetection: BreachedPasswordDetection | undefined;
- protected _bruteForceProtection: BruteForceProtection | undefined;
- protected _captcha: Captcha | undefined;
- protected _suspiciousIpThrottling: SuspiciousIpThrottling | undefined;
+export class AttackProtectionClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _botDetection: BotDetectionClient | undefined;
+ protected _breachedPasswordDetection: BreachedPasswordDetectionClient | undefined;
+ protected _bruteForceProtection: BruteForceProtectionClient | undefined;
+ protected _captcha: CaptchaClient | undefined;
+ protected _suspiciousIpThrottling: SuspiciousIpThrottlingClient | undefined;
- constructor(_options: AttackProtection.Options) {
- this._options = _options;
+ constructor(options: AttackProtectionClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get botDetection(): BotDetection {
- return (this._botDetection ??= new BotDetection(this._options));
+ public get botDetection(): BotDetectionClient {
+ return (this._botDetection ??= new BotDetectionClient(this._options));
}
- public get breachedPasswordDetection(): BreachedPasswordDetection {
- return (this._breachedPasswordDetection ??= new BreachedPasswordDetection(this._options));
+ public get breachedPasswordDetection(): BreachedPasswordDetectionClient {
+ return (this._breachedPasswordDetection ??= new BreachedPasswordDetectionClient(this._options));
}
- public get bruteForceProtection(): BruteForceProtection {
- return (this._bruteForceProtection ??= new BruteForceProtection(this._options));
+ public get bruteForceProtection(): BruteForceProtectionClient {
+ return (this._bruteForceProtection ??= new BruteForceProtectionClient(this._options));
}
- public get captcha(): Captcha {
- return (this._captcha ??= new Captcha(this._options));
+ public get captcha(): CaptchaClient {
+ return (this._captcha ??= new CaptchaClient(this._options));
}
- public get suspiciousIpThrottling(): SuspiciousIpThrottling {
- return (this._suspiciousIpThrottling ??= new SuspiciousIpThrottling(this._options));
+ public get suspiciousIpThrottling(): SuspiciousIpThrottlingClient {
+ return (this._suspiciousIpThrottling ??= new SuspiciousIpThrottlingClient(this._options));
}
}
diff --git a/src/management/api/resources/attackProtection/resources/botDetection/client/Client.ts b/src/management/api/resources/attackProtection/resources/botDetection/client/Client.ts
index e192f77da5..d070d24b4c 100644
--- a/src/management/api/resources/attackProtection/resources/botDetection/client/Client.ts
+++ b/src/management/api/resources/attackProtection/resources/botDetection/client/Client.ts
@@ -1,29 +1,31 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace BotDetection {
- export interface Options extends BaseClientOptions {}
+export declare namespace BotDetectionClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class BotDetection {
- protected readonly _options: BotDetection.Options;
+export class BotDetectionClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: BotDetection.Options) {
- this._options = _options;
+ constructor(options: BotDetectionClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* Get the Bot Detection configuration of your tenant.
*
- * @param {BotDetection.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BotDetectionClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -34,17 +36,18 @@ export class BotDetection {
* await client.attackProtection.botDetection.get()
*/
public get(
- requestOptions?: BotDetection.RequestOptions,
+ requestOptions?: BotDetectionClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
}
private async __get(
- requestOptions?: BotDetection.RequestOptions,
+ requestOptions?: BotDetectionClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -61,6 +64,7 @@ export class BotDetection {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -88,30 +92,19 @@ export class BotDetection {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /attack-protection/bot-detection.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/attack-protection/bot-detection",
+ );
}
/**
* Update the Bot Detection configuration of your tenant.
*
* @param {Management.UpdateBotDetectionSettingsRequestContent} request
- * @param {BotDetection.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BotDetectionClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -124,18 +117,19 @@ export class BotDetection {
*/
public update(
request: Management.UpdateBotDetectionSettingsRequestContent = {},
- requestOptions?: BotDetection.RequestOptions,
+ requestOptions?: BotDetectionClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
}
private async __update(
request: Management.UpdateBotDetectionSettingsRequestContent = {},
- requestOptions?: BotDetection.RequestOptions,
+ requestOptions?: BotDetectionClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -155,6 +149,7 @@ export class BotDetection {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -184,26 +179,11 @@ export class BotDetection {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /attack-protection/bot-detection.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/attack-protection/bot-detection",
+ );
}
}
diff --git a/src/management/api/resources/attackProtection/resources/breachedPasswordDetection/client/Client.ts b/src/management/api/resources/attackProtection/resources/breachedPasswordDetection/client/Client.ts
index b5f0c5b963..db859ec7ce 100644
--- a/src/management/api/resources/attackProtection/resources/breachedPasswordDetection/client/Client.ts
+++ b/src/management/api/resources/attackProtection/resources/breachedPasswordDetection/client/Client.ts
@@ -1,29 +1,31 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace BreachedPasswordDetection {
- export interface Options extends BaseClientOptions {}
+export declare namespace BreachedPasswordDetectionClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class BreachedPasswordDetection {
- protected readonly _options: BreachedPasswordDetection.Options;
+export class BreachedPasswordDetectionClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: BreachedPasswordDetection.Options) {
- this._options = _options;
+ constructor(options: BreachedPasswordDetectionClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* Retrieve details of the Breached Password Detection configuration of your tenant.
*
- * @param {BreachedPasswordDetection.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BreachedPasswordDetectionClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -33,17 +35,18 @@ export class BreachedPasswordDetection {
* await client.attackProtection.breachedPasswordDetection.get()
*/
public get(
- requestOptions?: BreachedPasswordDetection.RequestOptions,
+ requestOptions?: BreachedPasswordDetectionClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
}
private async __get(
- requestOptions?: BreachedPasswordDetection.RequestOptions,
+ requestOptions?: BreachedPasswordDetectionClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -60,6 +63,7 @@ export class BreachedPasswordDetection {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -85,30 +89,19 @@ export class BreachedPasswordDetection {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /attack-protection/breached-password-detection.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/attack-protection/breached-password-detection",
+ );
}
/**
* Update details of the Breached Password Detection configuration of your tenant.
*
* @param {Management.UpdateBreachedPasswordDetectionSettingsRequestContent} request
- * @param {BreachedPasswordDetection.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BreachedPasswordDetectionClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -120,18 +113,19 @@ export class BreachedPasswordDetection {
*/
public update(
request: Management.UpdateBreachedPasswordDetectionSettingsRequestContent = {},
- requestOptions?: BreachedPasswordDetection.RequestOptions,
+ requestOptions?: BreachedPasswordDetectionClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
}
private async __update(
request: Management.UpdateBreachedPasswordDetectionSettingsRequestContent = {},
- requestOptions?: BreachedPasswordDetection.RequestOptions,
+ requestOptions?: BreachedPasswordDetectionClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -151,6 +145,7 @@ export class BreachedPasswordDetection {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -178,26 +173,11 @@ export class BreachedPasswordDetection {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /attack-protection/breached-password-detection.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/attack-protection/breached-password-detection",
+ );
}
}
diff --git a/src/management/api/resources/attackProtection/resources/bruteForceProtection/client/Client.ts b/src/management/api/resources/attackProtection/resources/bruteForceProtection/client/Client.ts
index 6dccb82a2c..8e7318838a 100644
--- a/src/management/api/resources/attackProtection/resources/bruteForceProtection/client/Client.ts
+++ b/src/management/api/resources/attackProtection/resources/bruteForceProtection/client/Client.ts
@@ -1,29 +1,31 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace BruteForceProtection {
- export interface Options extends BaseClientOptions {}
+export declare namespace BruteForceProtectionClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class BruteForceProtection {
- protected readonly _options: BruteForceProtection.Options;
+export class BruteForceProtectionClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: BruteForceProtection.Options) {
- this._options = _options;
+ constructor(options: BruteForceProtectionClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* Retrieve details of the Brute-force Protection configuration of your tenant.
*
- * @param {BruteForceProtection.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BruteForceProtectionClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -33,17 +35,18 @@ export class BruteForceProtection {
* await client.attackProtection.bruteForceProtection.get()
*/
public get(
- requestOptions?: BruteForceProtection.RequestOptions,
+ requestOptions?: BruteForceProtectionClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
}
private async __get(
- requestOptions?: BruteForceProtection.RequestOptions,
+ requestOptions?: BruteForceProtectionClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -60,6 +63,7 @@ export class BruteForceProtection {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -85,30 +89,19 @@ export class BruteForceProtection {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /attack-protection/brute-force-protection.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/attack-protection/brute-force-protection",
+ );
}
/**
* Update the Brute-force Protection configuration of your tenant.
*
* @param {Management.UpdateBruteForceSettingsRequestContent} request
- * @param {BruteForceProtection.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BruteForceProtectionClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -120,18 +113,19 @@ export class BruteForceProtection {
*/
public update(
request: Management.UpdateBruteForceSettingsRequestContent = {},
- requestOptions?: BruteForceProtection.RequestOptions,
+ requestOptions?: BruteForceProtectionClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
}
private async __update(
request: Management.UpdateBruteForceSettingsRequestContent = {},
- requestOptions?: BruteForceProtection.RequestOptions,
+ requestOptions?: BruteForceProtectionClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -151,6 +145,7 @@ export class BruteForceProtection {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -178,26 +173,11 @@ export class BruteForceProtection {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /attack-protection/brute-force-protection.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/attack-protection/brute-force-protection",
+ );
}
}
diff --git a/src/management/api/resources/attackProtection/resources/captcha/client/Client.ts b/src/management/api/resources/attackProtection/resources/captcha/client/Client.ts
index 3896913121..53b03faa9c 100644
--- a/src/management/api/resources/attackProtection/resources/captcha/client/Client.ts
+++ b/src/management/api/resources/attackProtection/resources/captcha/client/Client.ts
@@ -1,29 +1,31 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Captcha {
- export interface Options extends BaseClientOptions {}
+export declare namespace CaptchaClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Captcha {
- protected readonly _options: Captcha.Options;
+export class CaptchaClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Captcha.Options) {
- this._options = _options;
+ constructor(options: CaptchaClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* Get the CAPTCHA configuration for your client.
*
- * @param {Captcha.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {CaptchaClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -34,17 +36,18 @@ export class Captcha {
* await client.attackProtection.captcha.get()
*/
public get(
- requestOptions?: Captcha.RequestOptions,
+ requestOptions?: CaptchaClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
}
private async __get(
- requestOptions?: Captcha.RequestOptions,
+ requestOptions?: CaptchaClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -61,6 +64,7 @@ export class Captcha {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -88,30 +92,14 @@ export class Captcha {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /attack-protection/captcha.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/attack-protection/captcha");
}
/**
* Update existing CAPTCHA configuration for your client.
*
* @param {Management.UpdateAttackProtectionCaptchaRequestContent} request
- * @param {Captcha.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {CaptchaClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -123,18 +111,19 @@ export class Captcha {
*/
public update(
request: Management.UpdateAttackProtectionCaptchaRequestContent = {},
- requestOptions?: Captcha.RequestOptions,
+ requestOptions?: CaptchaClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
}
private async __update(
request: Management.UpdateAttackProtectionCaptchaRequestContent = {},
- requestOptions?: Captcha.RequestOptions,
+ requestOptions?: CaptchaClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -154,6 +143,7 @@ export class Captcha {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -181,26 +171,6 @@ export class Captcha {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /attack-protection/captcha.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/attack-protection/captcha");
}
}
diff --git a/src/management/api/resources/attackProtection/resources/suspiciousIpThrottling/client/Client.ts b/src/management/api/resources/attackProtection/resources/suspiciousIpThrottling/client/Client.ts
index 71d79cfee7..bdb0aa51fa 100644
--- a/src/management/api/resources/attackProtection/resources/suspiciousIpThrottling/client/Client.ts
+++ b/src/management/api/resources/attackProtection/resources/suspiciousIpThrottling/client/Client.ts
@@ -1,29 +1,31 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace SuspiciousIpThrottling {
- export interface Options extends BaseClientOptions {}
+export declare namespace SuspiciousIpThrottlingClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class SuspiciousIpThrottling {
- protected readonly _options: SuspiciousIpThrottling.Options;
+export class SuspiciousIpThrottlingClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: SuspiciousIpThrottling.Options) {
- this._options = _options;
+ constructor(options: SuspiciousIpThrottlingClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* Retrieve details of the Suspicious IP Throttling configuration of your tenant.
*
- * @param {SuspiciousIpThrottling.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {SuspiciousIpThrottlingClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -33,17 +35,18 @@ export class SuspiciousIpThrottling {
* await client.attackProtection.suspiciousIpThrottling.get()
*/
public get(
- requestOptions?: SuspiciousIpThrottling.RequestOptions,
+ requestOptions?: SuspiciousIpThrottlingClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
}
private async __get(
- requestOptions?: SuspiciousIpThrottling.RequestOptions,
+ requestOptions?: SuspiciousIpThrottlingClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -60,6 +63,7 @@ export class SuspiciousIpThrottling {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -85,30 +89,19 @@ export class SuspiciousIpThrottling {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /attack-protection/suspicious-ip-throttling.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/attack-protection/suspicious-ip-throttling",
+ );
}
/**
* Update the details of the Suspicious IP Throttling configuration of your tenant.
*
* @param {Management.UpdateSuspiciousIpThrottlingSettingsRequestContent} request
- * @param {SuspiciousIpThrottling.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {SuspiciousIpThrottlingClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -120,18 +113,19 @@ export class SuspiciousIpThrottling {
*/
public update(
request: Management.UpdateSuspiciousIpThrottlingSettingsRequestContent = {},
- requestOptions?: SuspiciousIpThrottling.RequestOptions,
+ requestOptions?: SuspiciousIpThrottlingClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
}
private async __update(
request: Management.UpdateSuspiciousIpThrottlingSettingsRequestContent = {},
- requestOptions?: SuspiciousIpThrottling.RequestOptions,
+ requestOptions?: SuspiciousIpThrottlingClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -151,6 +145,7 @@ export class SuspiciousIpThrottling {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -178,26 +173,11 @@ export class SuspiciousIpThrottling {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /attack-protection/suspicious-ip-throttling.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/attack-protection/suspicious-ip-throttling",
+ );
}
}
diff --git a/src/management/api/resources/branding/client/Client.ts b/src/management/api/resources/branding/client/Client.ts
index 26f970c179..4d4ed2c213 100644
--- a/src/management/api/resources/branding/client/Client.ts
+++ b/src/management/api/resources/branding/client/Client.ts
@@ -1,47 +1,49 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
import * as environments from "../../../../environments.js";
import * as core from "../../../../core/index.js";
import * as Management from "../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
+import { mergeHeaders } from "../../../../core/headers.js";
import * as errors from "../../../../errors/index.js";
-import { Templates } from "../resources/templates/client/Client.js";
-import { Themes } from "../resources/themes/client/Client.js";
-import { Phone } from "../resources/phone/client/Client.js";
+import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
+import { TemplatesClient } from "../resources/templates/client/Client.js";
+import { ThemesClient } from "../resources/themes/client/Client.js";
+import { PhoneClient } from "../resources/phone/client/Client.js";
-export declare namespace Branding {
- export interface Options extends BaseClientOptions {}
+export declare namespace BrandingClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Branding {
- protected readonly _options: Branding.Options;
- protected _templates: Templates | undefined;
- protected _themes: Themes | undefined;
- protected _phone: Phone | undefined;
+export class BrandingClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _templates: TemplatesClient | undefined;
+ protected _themes: ThemesClient | undefined;
+ protected _phone: PhoneClient | undefined;
- constructor(_options: Branding.Options) {
- this._options = _options;
+ constructor(options: BrandingClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get templates(): Templates {
- return (this._templates ??= new Templates(this._options));
+ public get templates(): TemplatesClient {
+ return (this._templates ??= new TemplatesClient(this._options));
}
- public get themes(): Themes {
- return (this._themes ??= new Themes(this._options));
+ public get themes(): ThemesClient {
+ return (this._themes ??= new ThemesClient(this._options));
}
- public get phone(): Phone {
- return (this._phone ??= new Phone(this._options));
+ public get phone(): PhoneClient {
+ return (this._phone ??= new PhoneClient(this._options));
}
/**
* Retrieve branding settings.
*
- * @param {Branding.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BrandingClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -51,17 +53,18 @@ export class Branding {
* await client.branding.get()
*/
public get(
- requestOptions?: Branding.RequestOptions,
+ requestOptions?: BrandingClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
}
private async __get(
- requestOptions?: Branding.RequestOptions,
+ requestOptions?: BrandingClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -78,6 +81,7 @@ export class Branding {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -103,28 +107,14 @@ export class Branding {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /branding.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/branding");
}
/**
* Update branding settings.
*
* @param {Management.UpdateBrandingRequestContent} request
- * @param {Branding.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {BrandingClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -136,18 +126,19 @@ export class Branding {
*/
public update(
request: Management.UpdateBrandingRequestContent = {},
- requestOptions?: Branding.RequestOptions,
+ requestOptions?: BrandingClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
}
private async __update(
request: Management.UpdateBrandingRequestContent = {},
- requestOptions?: Branding.RequestOptions,
+ requestOptions?: BrandingClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -167,6 +158,7 @@ export class Branding {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -194,24 +186,6 @@ export class Branding {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling PATCH /branding.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/branding");
}
}
diff --git a/src/management/api/resources/branding/resources/phone/client/Client.ts b/src/management/api/resources/branding/resources/phone/client/Client.ts
index 2945c66e79..62abbe0573 100644
--- a/src/management/api/resources/branding/resources/phone/client/Client.ts
+++ b/src/management/api/resources/branding/resources/phone/client/Client.ts
@@ -1,29 +1,30 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
-import { Providers } from "../resources/providers/client/Client.js";
-import { Templates } from "../resources/templates/client/Client.js";
+import { ProvidersClient } from "../resources/providers/client/Client.js";
+import { TemplatesClient } from "../resources/templates/client/Client.js";
-export declare namespace Phone {
- export interface Options extends BaseClientOptions {}
+export declare namespace PhoneClient {
+ export type Options = BaseClientOptions;
}
-export class Phone {
- protected readonly _options: Phone.Options;
- protected _providers: Providers | undefined;
- protected _templates: Templates | undefined;
+export class PhoneClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _providers: ProvidersClient | undefined;
+ protected _templates: TemplatesClient | undefined;
- constructor(_options: Phone.Options) {
- this._options = _options;
+ constructor(options: PhoneClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get providers(): Providers {
- return (this._providers ??= new Providers(this._options));
+ public get providers(): ProvidersClient {
+ return (this._providers ??= new ProvidersClient(this._options));
}
- public get templates(): Templates {
- return (this._templates ??= new Templates(this._options));
+ public get templates(): TemplatesClient {
+ return (this._templates ??= new TemplatesClient(this._options));
}
}
diff --git a/src/management/api/resources/branding/resources/phone/resources/providers/client/Client.ts b/src/management/api/resources/branding/resources/phone/resources/providers/client/Client.ts
index cb78f8e024..9d418407ce 100644
--- a/src/management/api/resources/branding/resources/phone/resources/providers/client/Client.ts
+++ b/src/management/api/resources/branding/resources/phone/resources/providers/client/Client.ts
@@ -1,30 +1,35 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js";
+import {
+ type NormalizedClientOptionsWithAuth,
+ normalizeClientOptionsWithAuth,
+} from "../../../../../../../../BaseClient.js";
import * as environments from "../../../../../../../../environments.js";
import * as core from "../../../../../../../../core/index.js";
import * as Management from "../../../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../../../core/headers.js";
import * as errors from "../../../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Providers {
- export interface Options extends BaseClientOptions {}
+export declare namespace ProvidersClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Providers {
- protected readonly _options: Providers.Options;
+export class ProvidersClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Providers.Options) {
- this._options = _options;
+ constructor(options: ProvidersClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* Retrieve a list of phone providers details set for a Tenant. A list of fields to include or exclude may also be specified.
*
* @param {Management.ListBrandingPhoneProvidersRequestParameters} request
- * @param {Providers.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -38,14 +43,14 @@ export class Providers {
*/
public list(
request: Management.ListBrandingPhoneProvidersRequestParameters = {},
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
}
private async __list(
request: Management.ListBrandingPhoneProvidersRequestParameters = {},
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): Promise> {
const { disabled } = request;
const _queryParams: Record = {};
@@ -53,9 +58,10 @@ export class Providers {
_queryParams["disabled"] = disabled?.toString() ?? null;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -72,6 +78,7 @@ export class Providers {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -99,21 +106,7 @@ export class Providers {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /branding/phone/providers.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/branding/phone/providers");
}
/**
@@ -121,7 +114,7 @@ export class Providers {
* The credentials object requires different properties depending on the phone provider (which is specified using the name property).
*
* @param {Management.CreateBrandingPhoneProviderRequestContent} request
- * @param {Providers.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -139,18 +132,19 @@ export class Providers {
*/
public create(
request: Management.CreateBrandingPhoneProviderRequestContent,
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
}
private async __create(
request: Management.CreateBrandingPhoneProviderRequestContent,
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -170,6 +164,7 @@ export class Providers {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -199,30 +194,14 @@ export class Providers {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling POST /branding/phone/providers.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/branding/phone/providers");
}
/**
* Retrieve phone provider details. A list of fields to include or exclude may also be specified.
*
* @param {string} id
- * @param {Providers.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -235,18 +214,19 @@ export class Providers {
*/
public get(
id: string,
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
}
private async __get(
id: string,
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -263,6 +243,7 @@ export class Providers {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -292,30 +273,19 @@ export class Providers {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /branding/phone/providers/{id}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/branding/phone/providers/{id}",
+ );
}
/**
* Delete the configured phone provider.
*
* @param {string} id
- * @param {Providers.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -325,14 +295,18 @@ export class Providers {
* @example
* await client.branding.phone.providers.delete("id")
*/
- public delete(id: string, requestOptions?: Providers.RequestOptions): core.HttpResponsePromise {
+ public delete(id: string, requestOptions?: ProvidersClient.RequestOptions): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
}
- private async __delete(id: string, requestOptions?: Providers.RequestOptions): Promise> {
+ private async __delete(
+ id: string,
+ requestOptions?: ProvidersClient.RequestOptions,
+ ): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -349,6 +323,7 @@ export class Providers {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -373,23 +348,12 @@ export class Providers {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling DELETE /branding/phone/providers/{id}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "DELETE",
+ "/branding/phone/providers/{id}",
+ );
}
/**
@@ -398,7 +362,7 @@ export class Providers {
*
* @param {string} id
* @param {Management.UpdateBrandingPhoneProviderRequestContent} request
- * @param {Providers.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -413,7 +377,7 @@ export class Providers {
public update(
id: string,
request: Management.UpdateBrandingPhoneProviderRequestContent = {},
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
}
@@ -421,11 +385,12 @@ export class Providers {
private async __update(
id: string,
request: Management.UpdateBrandingPhoneProviderRequestContent = {},
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -445,6 +410,7 @@ export class Providers {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -476,29 +442,18 @@ export class Providers {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /branding/phone/providers/{id}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/branding/phone/providers/{id}",
+ );
}
/**
* @param {string} id
* @param {Management.CreatePhoneProviderSendTestRequestContent} request
- * @param {Providers.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -515,7 +470,7 @@ export class Providers {
public test(
id: string,
request: Management.CreatePhoneProviderSendTestRequestContent,
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__test(id, request, requestOptions));
}
@@ -523,11 +478,12 @@ export class Providers {
private async __test(
id: string,
request: Management.CreatePhoneProviderSendTestRequestContent,
- requestOptions?: Providers.RequestOptions,
+ requestOptions?: ProvidersClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -547,6 +503,7 @@ export class Providers {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -578,26 +535,11 @@ export class Providers {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling POST /branding/phone/providers/{id}/try.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/branding/phone/providers/{id}/try",
+ );
}
}
diff --git a/src/management/api/resources/branding/resources/phone/resources/templates/client/Client.ts b/src/management/api/resources/branding/resources/phone/resources/templates/client/Client.ts
index 5812dfa2f2..1a86081aa7 100644
--- a/src/management/api/resources/branding/resources/phone/resources/templates/client/Client.ts
+++ b/src/management/api/resources/branding/resources/phone/resources/templates/client/Client.ts
@@ -1,28 +1,33 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js";
+import {
+ type NormalizedClientOptionsWithAuth,
+ normalizeClientOptionsWithAuth,
+} from "../../../../../../../../BaseClient.js";
import * as environments from "../../../../../../../../environments.js";
import * as core from "../../../../../../../../core/index.js";
import * as Management from "../../../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../../../core/headers.js";
import * as errors from "../../../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Templates {
- export interface Options extends BaseClientOptions {}
+export declare namespace TemplatesClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Templates {
- protected readonly _options: Templates.Options;
+export class TemplatesClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Templates.Options) {
- this._options = _options;
+ constructor(options: TemplatesClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* @param {Management.ListPhoneTemplatesRequestParameters} request
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -36,14 +41,14 @@ export class Templates {
*/
public list(
request: Management.ListPhoneTemplatesRequestParameters = {},
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
}
private async __list(
request: Management.ListPhoneTemplatesRequestParameters = {},
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): Promise> {
const { disabled } = request;
const _queryParams: Record = {};
@@ -51,9 +56,10 @@ export class Templates {
_queryParams["disabled"] = disabled?.toString() ?? null;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -70,6 +76,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -97,26 +104,12 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /branding/phone/templates.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/branding/phone/templates");
}
/**
* @param {Management.CreatePhoneTemplateRequestContent} request
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -129,18 +122,19 @@ export class Templates {
*/
public create(
request: Management.CreatePhoneTemplateRequestContent = {},
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
}
private async __create(
request: Management.CreatePhoneTemplateRequestContent = {},
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -160,6 +154,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -189,28 +184,12 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling POST /branding/phone/templates.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/branding/phone/templates");
}
/**
* @param {string} id
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -223,18 +202,19 @@ export class Templates {
*/
public get(
id: string,
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
}
private async __get(
id: string,
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -251,6 +231,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -280,28 +261,17 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /branding/phone/templates/{id}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/branding/phone/templates/{id}",
+ );
}
/**
* @param {string} id
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -312,14 +282,18 @@ export class Templates {
* @example
* await client.branding.phone.templates.delete("id")
*/
- public delete(id: string, requestOptions?: Templates.RequestOptions): core.HttpResponsePromise {
+ public delete(id: string, requestOptions?: TemplatesClient.RequestOptions): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
}
- private async __delete(id: string, requestOptions?: Templates.RequestOptions): Promise> {
+ private async __delete(
+ id: string,
+ requestOptions?: TemplatesClient.RequestOptions,
+ ): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -336,6 +310,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -362,29 +337,18 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling DELETE /branding/phone/templates/{id}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "DELETE",
+ "/branding/phone/templates/{id}",
+ );
}
/**
* @param {string} id
* @param {Management.UpdatePhoneTemplateRequestContent} request
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -398,7 +362,7 @@ export class Templates {
public update(
id: string,
request: Management.UpdatePhoneTemplateRequestContent = {},
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
}
@@ -406,11 +370,12 @@ export class Templates {
private async __update(
id: string,
request: Management.UpdatePhoneTemplateRequestContent = {},
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -430,6 +395,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -459,29 +425,18 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /branding/phone/templates/{id}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/branding/phone/templates/{id}",
+ );
}
/**
* @param {string} id
* @param {Management.ResetPhoneTemplateRequestContent} request
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -496,7 +451,7 @@ export class Templates {
public reset(
id: string,
request?: Management.ResetPhoneTemplateRequestContent,
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__reset(id, request, requestOptions));
}
@@ -504,11 +459,12 @@ export class Templates {
private async __reset(
id: string,
request?: Management.ResetPhoneTemplateRequestContent,
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -528,6 +484,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -555,29 +512,18 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /branding/phone/templates/{id}/reset.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/branding/phone/templates/{id}/reset",
+ );
}
/**
* @param {string} id
* @param {Management.CreatePhoneTemplateTestNotificationRequestContent} request
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -593,7 +539,7 @@ export class Templates {
public test(
id: string,
request: Management.CreatePhoneTemplateTestNotificationRequestContent,
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__test(id, request, requestOptions));
}
@@ -601,11 +547,12 @@ export class Templates {
private async __test(
id: string,
request: Management.CreatePhoneTemplateTestNotificationRequestContent,
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -625,6 +572,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -654,26 +602,11 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling POST /branding/phone/templates/{id}/try.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/branding/phone/templates/{id}/try",
+ );
}
}
diff --git a/src/management/api/resources/branding/resources/templates/client/Client.ts b/src/management/api/resources/branding/resources/templates/client/Client.ts
index 0b95f228eb..1ac3a9085c 100644
--- a/src/management/api/resources/branding/resources/templates/client/Client.ts
+++ b/src/management/api/resources/branding/resources/templates/client/Client.ts
@@ -1,27 +1,29 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Templates {
- export interface Options extends BaseClientOptions {}
+export declare namespace TemplatesClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Templates {
- protected readonly _options: Templates.Options;
+export class TemplatesClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Templates.Options) {
- this._options = _options;
+ constructor(options: TemplatesClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.PaymentRequiredError}
@@ -33,17 +35,18 @@ export class Templates {
* await client.branding.templates.getUniversalLogin()
*/
public getUniversalLogin(
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__getUniversalLogin(requestOptions));
}
private async __getUniversalLogin(
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -60,6 +63,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -89,23 +93,12 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /branding/templates/universal-login.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/branding/templates/universal-login",
+ );
}
/**
@@ -135,7 +128,7 @@ export class Templates {
*
*
* @param {Management.UpdateUniversalLoginTemplateRequestContent} request
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -149,18 +142,19 @@ export class Templates {
*/
public updateUniversalLogin(
request: Management.UpdateUniversalLoginTemplateRequestContent,
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__updateUniversalLogin(request, requestOptions));
}
private async __updateUniversalLogin(
request: Management.UpdateUniversalLoginTemplateRequestContent,
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -180,6 +174,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -208,27 +203,16 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PUT /branding/templates/universal-login.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PUT",
+ "/branding/templates/universal-login",
+ );
}
/**
- * @param {Templates.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.PaymentRequiredError}
@@ -238,16 +222,17 @@ export class Templates {
* @example
* await client.branding.templates.deleteUniversalLogin()
*/
- public deleteUniversalLogin(requestOptions?: Templates.RequestOptions): core.HttpResponsePromise {
+ public deleteUniversalLogin(requestOptions?: TemplatesClient.RequestOptions): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__deleteUniversalLogin(requestOptions));
}
private async __deleteUniversalLogin(
- requestOptions?: Templates.RequestOptions,
+ requestOptions?: TemplatesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -264,6 +249,7 @@ export class Templates {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -288,26 +274,11 @@ export class Templates {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling DELETE /branding/templates/universal-login.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "DELETE",
+ "/branding/templates/universal-login",
+ );
}
}
diff --git a/src/management/api/resources/branding/resources/themes/client/Client.ts b/src/management/api/resources/branding/resources/themes/client/Client.ts
index e878249fa3..186b85ab3a 100644
--- a/src/management/api/resources/branding/resources/themes/client/Client.ts
+++ b/src/management/api/resources/branding/resources/themes/client/Client.ts
@@ -1,30 +1,32 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Themes {
- export interface Options extends BaseClientOptions {}
+export declare namespace ThemesClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Themes {
- protected readonly _options: Themes.Options;
+export class ThemesClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Themes.Options) {
- this._options = _options;
+ constructor(options: ThemesClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* Create branding theme.
*
* @param {Management.CreateBrandingThemeRequestContent} request
- * @param {Themes.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ThemesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -108,18 +110,19 @@ export class Themes {
*/
public create(
request: Management.CreateBrandingThemeRequestContent,
- requestOptions?: Themes.RequestOptions,
+ requestOptions?: ThemesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
}
private async __create(
request: Management.CreateBrandingThemeRequestContent,
- requestOptions?: Themes.RequestOptions,
+ requestOptions?: ThemesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -139,6 +142,7 @@ export class Themes {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -168,27 +172,13 @@ export class Themes {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling POST /branding/themes.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/branding/themes");
}
/**
* Retrieve default branding theme.
*
- * @param {Themes.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ThemesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -199,17 +189,18 @@ export class Themes {
* await client.branding.themes.getDefault()
*/
public getDefault(
- requestOptions?: Themes.RequestOptions,
+ requestOptions?: ThemesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__getDefault(requestOptions));
}
private async __getDefault(
- requestOptions?: Themes.RequestOptions,
+ requestOptions?: ThemesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -226,6 +217,7 @@ export class Themes {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -253,28 +245,14 @@ export class Themes {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /branding/themes/default.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/branding/themes/default");
}
/**
* Retrieve branding theme.
*
* @param {string} themeId - The ID of the theme
- * @param {Themes.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ThemesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -286,18 +264,19 @@ export class Themes {
*/
public get(
themeId: string,
- requestOptions?: Themes.RequestOptions,
+ requestOptions?: ThemesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(themeId, requestOptions));
}
private async __get(
themeId: string,
- requestOptions?: Themes.RequestOptions,
+ requestOptions?: ThemesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -314,6 +293,7 @@ export class Themes {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -341,30 +321,14 @@ export class Themes {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /branding/themes/{themeId}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/branding/themes/{themeId}");
}
/**
* Delete branding theme.
*
* @param {string} themeId - The ID of the theme
- * @param {Themes.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ThemesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -374,17 +338,18 @@ export class Themes {
* @example
* await client.branding.themes.delete("themeId")
*/
- public delete(themeId: string, requestOptions?: Themes.RequestOptions): core.HttpResponsePromise {
+ public delete(themeId: string, requestOptions?: ThemesClient.RequestOptions): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__delete(themeId, requestOptions));
}
private async __delete(
themeId: string,
- requestOptions?: Themes.RequestOptions,
+ requestOptions?: ThemesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -401,6 +366,7 @@ export class Themes {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -425,23 +391,7 @@ export class Themes {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling DELETE /branding/themes/{themeId}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/branding/themes/{themeId}");
}
/**
@@ -449,7 +399,7 @@ export class Themes {
*
* @param {string} themeId - The ID of the theme
* @param {Management.UpdateBrandingThemeRequestContent} request
- * @param {Themes.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ThemesClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -534,7 +484,7 @@ export class Themes {
public update(
themeId: string,
request: Management.UpdateBrandingThemeRequestContent,
- requestOptions?: Themes.RequestOptions,
+ requestOptions?: ThemesClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(themeId, request, requestOptions));
}
@@ -542,11 +492,12 @@ export class Themes {
private async __update(
themeId: string,
request: Management.UpdateBrandingThemeRequestContent,
- requestOptions?: Themes.RequestOptions,
+ requestOptions?: ThemesClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -566,6 +517,7 @@ export class Themes {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -595,26 +547,6 @@ export class Themes {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling PATCH /branding/themes/{themeId}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/branding/themes/{themeId}");
}
}
diff --git a/src/management/api/resources/clientGrants/client/Client.ts b/src/management/api/resources/clientGrants/client/Client.ts
index 91a26b3d25..0f57afa805 100644
--- a/src/management/api/resources/clientGrants/client/Client.ts
+++ b/src/management/api/resources/clientGrants/client/Client.ts
@@ -1,36 +1,38 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
import * as environments from "../../../../environments.js";
import * as core from "../../../../core/index.js";
import * as Management from "../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
+import { mergeHeaders } from "../../../../core/headers.js";
import * as errors from "../../../../errors/index.js";
-import { Organizations } from "../resources/organizations/client/Client.js";
+import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
+import { OrganizationsClient } from "../resources/organizations/client/Client.js";
-export declare namespace ClientGrants {
- export interface Options extends BaseClientOptions {}
+export declare namespace ClientGrantsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class ClientGrants {
- protected readonly _options: ClientGrants.Options;
- protected _organizations: Organizations | undefined;
+export class ClientGrantsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _organizations: OrganizationsClient | undefined;
- constructor(_options: ClientGrants.Options) {
- this._options = _options;
+ constructor(options: ClientGrantsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get organizations(): Organizations {
- return (this._organizations ??= new Organizations(this._options));
+ public get organizations(): OrganizationsClient {
+ return (this._organizations ??= new OrganizationsClient(this._options));
}
/**
* Retrieve a list of client grants, including the scopes associated with the application/API pair.
*
* @param {Management.ListClientGrantsRequestParameters} request
- * @param {ClientGrants.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientGrantsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -48,7 +50,7 @@ export class ClientGrants {
*/
public async list(
request: Management.ListClientGrantsRequestParameters = {},
- requestOptions?: ClientGrants.RequestOptions,
+ requestOptions?: ClientGrantsClient.RequestOptions,
): Promise> {
const list = core.HttpResponsePromise.interceptFunction(
async (
@@ -81,9 +83,10 @@ export class ClientGrants {
if (subjectType !== undefined) {
_queryParams["subject_type"] = subjectType;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -100,6 +103,7 @@ export class ClientGrants {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -129,21 +133,7 @@ export class ClientGrants {
});
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /client-grants.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/client-grants");
},
);
const dataWithRawResponse = await list(request).withRawResponse();
@@ -165,7 +155,7 @@ export class ClientGrants {
* Create a client grant for a machine-to-machine login flow. To learn more, read Client Credential Flow.
*
* @param {Management.CreateClientGrantRequestContent} request
- * @param {ClientGrants.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientGrantsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -182,18 +172,19 @@ export class ClientGrants {
*/
public create(
request: Management.CreateClientGrantRequestContent,
- requestOptions?: ClientGrants.RequestOptions,
+ requestOptions?: ClientGrantsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
}
private async __create(
request: Management.CreateClientGrantRequestContent,
- requestOptions?: ClientGrants.RequestOptions,
+ requestOptions?: ClientGrantsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -213,6 +204,7 @@ export class ClientGrants {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -244,28 +236,14 @@ export class ClientGrants {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling POST /client-grants.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/client-grants");
}
/**
* Delete the Client Credential Flow from your machine-to-machine application.
*
* @param {string} id - ID of the client grant to delete.
- * @param {ClientGrants.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientGrantsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -275,17 +253,18 @@ export class ClientGrants {
* @example
* await client.clientGrants.delete("id")
*/
- public delete(id: string, requestOptions?: ClientGrants.RequestOptions): core.HttpResponsePromise {
+ public delete(id: string, requestOptions?: ClientGrantsClient.RequestOptions): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
}
private async __delete(
id: string,
- requestOptions?: ClientGrants.RequestOptions,
+ requestOptions?: ClientGrantsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -302,6 +281,7 @@ export class ClientGrants {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -326,21 +306,7 @@ export class ClientGrants {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling DELETE /client-grants/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/client-grants/{id}");
}
/**
@@ -348,7 +314,7 @@ export class ClientGrants {
*
* @param {string} id - ID of the client grant to update.
* @param {Management.UpdateClientGrantRequestContent} request
- * @param {ClientGrants.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientGrantsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -362,7 +328,7 @@ export class ClientGrants {
public update(
id: string,
request: Management.UpdateClientGrantRequestContent = {},
- requestOptions?: ClientGrants.RequestOptions,
+ requestOptions?: ClientGrantsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
}
@@ -370,11 +336,12 @@ export class ClientGrants {
private async __update(
id: string,
request: Management.UpdateClientGrantRequestContent = {},
- requestOptions?: ClientGrants.RequestOptions,
+ requestOptions?: ClientGrantsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -394,6 +361,7 @@ export class ClientGrants {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -423,24 +391,6 @@ export class ClientGrants {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling PATCH /client-grants/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/client-grants/{id}");
}
}
diff --git a/src/management/api/resources/clientGrants/resources/organizations/client/Client.ts b/src/management/api/resources/clientGrants/resources/organizations/client/Client.ts
index f5734f8063..3fd3db36dc 100644
--- a/src/management/api/resources/clientGrants/resources/organizations/client/Client.ts
+++ b/src/management/api/resources/clientGrants/resources/organizations/client/Client.ts
@@ -1,29 +1,31 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Organizations {
- export interface Options extends BaseClientOptions {}
+export declare namespace OrganizationsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Organizations {
- protected readonly _options: Organizations.Options;
+export class OrganizationsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Organizations.Options) {
- this._options = _options;
+ constructor(options: OrganizationsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
* @param {string} id - ID of the client grant
* @param {Management.ListClientGrantOrganizationsRequestParameters} request
- * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -39,7 +41,7 @@ export class Organizations {
public async list(
id: string,
request: Management.ListClientGrantOrganizationsRequestParameters = {},
- requestOptions?: Organizations.RequestOptions,
+ requestOptions?: OrganizationsClient.RequestOptions,
): Promise> {
const list = core.HttpResponsePromise.interceptFunction(
async (
@@ -53,9 +55,10 @@ export class Organizations {
if (take !== undefined) {
_queryParams["take"] = take?.toString() ?? null;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -72,6 +75,7 @@ export class Organizations {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -106,23 +110,12 @@ export class Organizations {
});
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /client-grants/{id}/organizations.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/client-grants/{id}/organizations",
+ );
},
);
const dataWithRawResponse = await list(request).withRawResponse();
@@ -137,8 +130,4 @@ export class Organizations {
},
});
}
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
- }
}
diff --git a/src/management/api/resources/clients/client/Client.ts b/src/management/api/resources/clients/client/Client.ts
index cc28de579b..960d8850a9 100644
--- a/src/management/api/resources/clients/client/Client.ts
+++ b/src/management/api/resources/clients/client/Client.ts
@@ -1,35 +1,37 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
import * as environments from "../../../../environments.js";
import * as core from "../../../../core/index.js";
import * as Management from "../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
+import { mergeHeaders } from "../../../../core/headers.js";
import * as errors from "../../../../errors/index.js";
-import { Credentials } from "../resources/credentials/client/Client.js";
-import { Connections } from "../resources/connections/client/Client.js";
+import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
+import { CredentialsClient } from "../resources/credentials/client/Client.js";
+import { ConnectionsClient } from "../resources/connections/client/Client.js";
-export declare namespace Clients {
- export interface Options extends BaseClientOptions {}
+export declare namespace ClientsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Clients {
- protected readonly _options: Clients.Options;
- protected _credentials: Credentials | undefined;
- protected _connections: Connections | undefined;
+export class ClientsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _credentials: CredentialsClient | undefined;
+ protected _connections: ConnectionsClient | undefined;
- constructor(_options: Clients.Options) {
- this._options = _options;
+ constructor(options: ClientsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get credentials(): Credentials {
- return (this._credentials ??= new Credentials(this._options));
+ public get credentials(): CredentialsClient {
+ return (this._credentials ??= new CredentialsClient(this._options));
}
- public get connections(): Connections {
- return (this._connections ??= new Connections(this._options));
+ public get connections(): ConnectionsClient {
+ return (this._connections ??= new ConnectionsClient(this._options));
}
/**
@@ -68,7 +70,7 @@ export class Clients {
*
*
* @param {Management.ListClientsRequestParameters} request
- * @param {Clients.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -90,7 +92,7 @@ export class Clients {
*/
public async list(
request: Management.ListClientsRequestParameters = {},
- requestOptions?: Clients.RequestOptions,
+ requestOptions?: ClientsClient.RequestOptions,
): Promise> {
const list = core.HttpResponsePromise.interceptFunction(
async (
@@ -135,9 +137,10 @@ export class Clients {
if (q !== undefined) {
_queryParams["q"] = q;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -154,6 +157,7 @@ export class Clients {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -188,21 +192,7 @@ export class Clients {
});
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /clients.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/clients");
},
);
let _offset = request?.page != null ? request?.page : 0;
@@ -210,10 +200,10 @@ export class Clients {
return new core.Page({
response: dataWithRawResponse.data,
rawResponse: dataWithRawResponse.rawResponse,
- hasNextPage: (response) => (response?.clients ?? []).length >= (request?.per_page ?? 1),
+ hasNextPage: (response) => (response?.clients ?? []).length >= Math.floor(request?.per_page ?? 1),
getItems: (response) => response?.clients ?? [],
- loadPage: (response) => {
- _offset += response?.clients != null ? response.clients.length : 1;
+ loadPage: (_response) => {
+ _offset += 1;
return list(core.setObjectProperty(request, "page", _offset));
},
});
@@ -236,7 +226,7 @@ export class Clients {
* SSO Integrations created via this endpoint will accept login requests and share user profile information.
*
* @param {Management.CreateClientRequestContent} request
- * @param {Clients.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -251,18 +241,19 @@ export class Clients {
*/
public create(
request: Management.CreateClientRequestContent,
- requestOptions?: Clients.RequestOptions,
+ requestOptions?: ClientsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
}
private async __create(
request: Management.CreateClientRequestContent,
- requestOptions?: Clients.RequestOptions,
+ requestOptions?: ClientsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -282,6 +273,7 @@ export class Clients {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -311,21 +303,7 @@ export class Clients {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling POST /clients.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/clients");
}
/**
@@ -363,7 +341,7 @@ export class Clients {
*
* @param {string} id - ID of the client to retrieve.
* @param {Management.GetClientRequestParameters} request
- * @param {Clients.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -380,7 +358,7 @@ export class Clients {
public get(
id: string,
request: Management.GetClientRequestParameters = {},
- requestOptions?: Clients.RequestOptions,
+ requestOptions?: ClientsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__get(id, request, requestOptions));
}
@@ -388,7 +366,7 @@ export class Clients {
private async __get(
id: string,
request: Management.GetClientRequestParameters = {},
- requestOptions?: Clients.RequestOptions,
+ requestOptions?: ClientsClient.RequestOptions,
): Promise> {
const { fields, include_fields: includeFields } = request;
const _queryParams: Record = {};
@@ -400,9 +378,10 @@ export class Clients {
_queryParams["include_fields"] = includeFields?.toString() ?? null;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -419,6 +398,7 @@ export class Clients {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: _response.body as Management.GetClientResponseContent, rawResponse: _response.rawResponse };
@@ -445,28 +425,14 @@ export class Clients {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling GET /clients/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/clients/{id}");
}
/**
* Delete a client and related configuration (rules, connections, etc).
*
* @param {string} id - ID of the client to delete.
- * @param {Clients.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -476,14 +442,18 @@ export class Clients {
* @example
* await client.clients.delete("id")
*/
- public delete(id: string, requestOptions?: Clients.RequestOptions): core.HttpResponsePromise {
+ public delete(id: string, requestOptions?: ClientsClient.RequestOptions): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
}
- private async __delete(id: string, requestOptions?: Clients.RequestOptions): Promise> {
+ private async __delete(
+ id: string,
+ requestOptions?: ClientsClient.RequestOptions,
+ ): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -500,6 +470,7 @@ export class Clients {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -524,21 +495,7 @@ export class Clients {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling DELETE /clients/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/clients/{id}");
}
/**
@@ -554,7 +511,7 @@ export class Clients {
*
* @param {string} id - ID of the client to update.
* @param {Management.UpdateClientRequestContent} request
- * @param {Clients.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -568,7 +525,7 @@ export class Clients {
public update(
id: string,
request: Management.UpdateClientRequestContent = {},
- requestOptions?: Clients.RequestOptions,
+ requestOptions?: ClientsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
}
@@ -576,11 +533,12 @@ export class Clients {
private async __update(
id: string,
request: Management.UpdateClientRequestContent = {},
- requestOptions?: Clients.RequestOptions,
+ requestOptions?: ClientsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -600,6 +558,7 @@ export class Clients {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -629,21 +588,7 @@ export class Clients {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError("Timeout exceeded when calling PATCH /clients/{id}.");
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/clients/{id}");
}
/**
@@ -654,7 +599,7 @@ export class Clients {
* For more information, read Rotate Client Secrets.
*
* @param {string} id - ID of the client that will rotate secrets.
- * @param {Clients.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ClientsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -667,18 +612,19 @@ export class Clients {
*/
public rotateSecret(
id: string,
- requestOptions?: Clients.RequestOptions,
+ requestOptions?: ClientsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(this.__rotateSecret(id, requestOptions));
}
private async __rotateSecret(
id: string,
- requestOptions?: Clients.RequestOptions,
+ requestOptions?: ClientsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -695,6 +641,7 @@ export class Clients {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -724,26 +671,6 @@ export class Clients {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling POST /clients/{id}/rotate-secret.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/clients/{id}/rotate-secret");
}
}
diff --git a/src/management/api/resources/clients/resources/connections/client/Client.ts b/src/management/api/resources/clients/resources/connections/client/Client.ts
index 2a32aeb069..af22aaa2d2 100644
--- a/src/management/api/resources/clients/resources/connections/client/Client.ts
+++ b/src/management/api/resources/clients/resources/connections/client/Client.ts
@@ -1,23 +1,25 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Connections {
- export interface Options extends BaseClientOptions {}
+export declare namespace ConnectionsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Connections {
- protected readonly _options: Connections.Options;
+export class ConnectionsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Connections.Options) {
- this._options = _options;
+ constructor(options: ConnectionsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -33,7 +35,7 @@ export class Connections {
*
* @param {string} id - ID of the client for which to retrieve enabled connections.
* @param {Management.ConnectionsGetRequest} request
- * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ConnectionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -52,7 +54,7 @@ export class Connections {
public async get(
id: string,
request: Management.ConnectionsGetRequest = {},
- requestOptions?: Connections.RequestOptions,
+ requestOptions?: ConnectionsClient.RequestOptions,
): Promise> {
const list = core.HttpResponsePromise.interceptFunction(
async (
@@ -79,9 +81,10 @@ export class Connections {
if (includeFields !== undefined) {
_queryParams["include_fields"] = includeFields?.toString() ?? null;
}
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -98,6 +101,7 @@ export class Connections {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -134,23 +138,12 @@ export class Connections {
});
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /clients/{id}/connections.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/clients/{id}/connections",
+ );
},
);
const dataWithRawResponse = await list(request).withRawResponse();
@@ -165,8 +158,4 @@ export class Connections {
},
});
}
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.token)}`;
- }
}
diff --git a/src/management/api/resources/clients/resources/credentials/client/Client.ts b/src/management/api/resources/clients/resources/credentials/client/Client.ts
index aa8e33b1fe..5c8252d1a3 100644
--- a/src/management/api/resources/clients/resources/credentials/client/Client.ts
+++ b/src/management/api/resources/clients/resources/credentials/client/Client.ts
@@ -1,23 +1,25 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js";
import * as environments from "../../../../../../environments.js";
import * as core from "../../../../../../core/index.js";
import * as Management from "../../../../../index.js";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js";
+import { mergeHeaders } from "../../../../../../core/headers.js";
import * as errors from "../../../../../../errors/index.js";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js";
-export declare namespace Credentials {
- export interface Options extends BaseClientOptions {}
+export declare namespace CredentialsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Credentials {
- protected readonly _options: Credentials.Options;
+export class CredentialsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Credentials.Options) {
- this._options = _options;
+ constructor(options: CredentialsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -25,8 +27,8 @@ export class Credentials {
*
* Important: To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.
*
- * @param {string} clientId - ID of the client.
- * @param {Credentials.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} client_id - ID of the client.
+ * @param {CredentialsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -37,19 +39,20 @@ export class Credentials {
* await client.clients.credentials.list("client_id")
*/
public list(
- clientId: string,
- requestOptions?: Credentials.RequestOptions,
+ client_id: string,
+ requestOptions?: CredentialsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__list(clientId, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__list(client_id, requestOptions));
}
private async __list(
- clientId: string,
- requestOptions?: Credentials.RequestOptions,
+ client_id: string,
+ requestOptions?: CredentialsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -57,7 +60,7 @@ export class Credentials {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.ManagementEnvironment.Default,
- `clients/${core.url.encodePathParam(clientId)}/credentials`,
+ `clients/${core.url.encodePathParam(client_id)}/credentials`,
),
method: "GET",
headers: _headers,
@@ -66,6 +69,7 @@ export class Credentials {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: _response.body as Management.ClientCredential[], rawResponse: _response.rawResponse };
@@ -90,23 +94,12 @@ export class Credentials {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /clients/{client_id}/credentials.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/clients/{client_id}/credentials",
+ );
}
/**
@@ -144,9 +137,9 @@ export class Credentials {
* To enable the credential for JWT-secured Authorization requests, set the signed_request_objectproperty on the client. For more information, read Configure JWT-secured Authorization Requests (JAR)
*
*
- * @param {string} clientId - ID of the client.
+ * @param {string} client_id - ID of the client.
* @param {Management.PostClientCredentialRequestContent} request
- * @param {Credentials.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {CredentialsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
@@ -160,21 +153,22 @@ export class Credentials {
* })
*/
public create(
- clientId: string,
+ client_id: string,
request: Management.PostClientCredentialRequestContent,
- requestOptions?: Credentials.RequestOptions,
+ requestOptions?: CredentialsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__create(clientId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__create(client_id, request, requestOptions));
}
private async __create(
- clientId: string,
+ client_id: string,
request: Management.PostClientCredentialRequestContent,
- requestOptions?: Credentials.RequestOptions,
+ requestOptions?: CredentialsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -182,7 +176,7 @@ export class Credentials {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.ManagementEnvironment.Default,
- `clients/${core.url.encodePathParam(clientId)}/credentials`,
+ `clients/${core.url.encodePathParam(client_id)}/credentials`,
),
method: "POST",
headers: _headers,
@@ -194,6 +188,7 @@ export class Credentials {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -223,23 +218,12 @@ export class Credentials {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling POST /clients/{client_id}/credentials.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/clients/{client_id}/credentials",
+ );
}
/**
@@ -247,9 +231,9 @@ export class Credentials {
*
* Important: To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.
*
- * @param {string} clientId - ID of the client.
- * @param {string} credentialId - ID of the credential.
- * @param {Credentials.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} client_id - ID of the client.
+ * @param {string} credential_id - ID of the credential.
+ * @param {CredentialsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
@@ -260,21 +244,22 @@ export class Credentials {
* await client.clients.credentials.get("client_id", "credential_id")
*/
public get(
- clientId: string,
- credentialId: string,
- requestOptions?: Credentials.RequestOptions,
+ client_id: string,
+ credential_id: string,
+ requestOptions?: CredentialsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__get(clientId, credentialId, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__get(client_id, credential_id, requestOptions));
}
private async __get(
- clientId: string,
- credentialId: string,
- requestOptions?: Credentials.RequestOptions,
+ client_id: string,
+ credential_id: string,
+ requestOptions?: CredentialsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
@@ -282,7 +267,7 @@ export class Credentials {
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.ManagementEnvironment.Default,
- `clients/${core.url.encodePathParam(clientId)}/credentials/${core.url.encodePathParam(credentialId)}`,
+ `clients/${core.url.encodePathParam(client_id)}/credentials/${core.url.encodePathParam(credential_id)}`,
),
method: "GET",
headers: _headers,
@@ -291,6 +276,7 @@ export class Credentials {
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -318,31 +304,20 @@ export class Credentials {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.ManagementError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.ManagementTimeoutError(
- "Timeout exceeded when calling GET /clients/{client_id}/credentials/{credential_id}.",
- );
- case "unknown":
- throw new errors.ManagementError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/clients/{client_id}/credentials/{credential_id}",
+ );
}
/**
* Delete a client credential you previously created. May be enabled or disabled. For more information, read