-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Session & Refresh token in management api client (#…
…1019) Co-authored-by: gyaneshgouraw-okta <[email protected]>
- Loading branch information
1 parent
8909295
commit 17bac36
Showing
7 changed files
with
665 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/management/__generated/managers/refresh-tokens-manager.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import * as runtime from '../../../lib/runtime.js'; | ||
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js'; | ||
import type { | ||
GetRefreshToken200Response, | ||
DeleteRefreshTokenRequest, | ||
GetRefreshTokenRequest, | ||
} from '../models/index.js'; | ||
|
||
const { BaseAPI } = runtime; | ||
|
||
/** | ||
* | ||
*/ | ||
export class RefreshTokensManager extends BaseAPI { | ||
/** | ||
* Delete a refresh token by its ID. | ||
* Delete a refresh tokens | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async delete( | ||
requestParameters: DeleteRefreshTokenRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<void>> { | ||
runtime.validateRequiredRequestParams(requestParameters, ['id']); | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/refresh-tokens/{id}`.replace( | ||
'{id}', | ||
encodeURIComponent(String(requestParameters.id)) | ||
), | ||
method: 'DELETE', | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.VoidApiResponse.fromResponse(response); | ||
} | ||
|
||
/** | ||
* Retrieve refresh token information. | ||
* Get a refresh token | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async get( | ||
requestParameters: GetRefreshTokenRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<GetRefreshToken200Response>> { | ||
runtime.validateRequiredRequestParams(requestParameters, ['id']); | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/refresh-tokens/{id}`.replace( | ||
'{id}', | ||
encodeURIComponent(String(requestParameters.id)) | ||
), | ||
method: 'GET', | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import * as runtime from '../../../lib/runtime.js'; | ||
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js'; | ||
import type { | ||
GetSession200Response, | ||
DeleteSessionRequest, | ||
GetSessionRequest, | ||
} from '../models/index.js'; | ||
|
||
const { BaseAPI } = runtime; | ||
|
||
/** | ||
* | ||
*/ | ||
export class SessionsManager extends BaseAPI { | ||
/** | ||
* Delete a session by ID. | ||
* Delete session | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async delete( | ||
requestParameters: DeleteSessionRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<void>> { | ||
runtime.validateRequiredRequestParams(requestParameters, ['id']); | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/sessions/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))), | ||
method: 'DELETE', | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.VoidApiResponse.fromResponse(response); | ||
} | ||
|
||
/** | ||
* Retrieve session information. | ||
* Get session | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async get( | ||
requestParameters: GetSessionRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<GetSession200Response>> { | ||
runtime.validateRequiredRequestParams(requestParameters, ['id']); | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/sessions/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))), | ||
method: 'GET', | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
} |
Oops, something went wrong.