Skip to content

Commit

Permalink
Added support for Session & Refresh token in management api client (#…
Browse files Browse the repository at this point in the history
…1019)

Co-authored-by: gyaneshgouraw-okta <[email protected]>
  • Loading branch information
gyaneshgouraw-okta and gyaneshgouraw-okta authored Jul 10, 2024
1 parent 8909295 commit 17bac36
Show file tree
Hide file tree
Showing 7 changed files with 665 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/management/__generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import {
LogsManager,
OrganizationsManager,
PromptsManager,
RefreshTokensManager,
ResourceServersManager,
RolesManager,
RulesManager,
RulesConfigsManager,
SessionsManager,
StatsManager,
TenantsManager,
TicketsManager,
Expand Down Expand Up @@ -59,10 +61,12 @@ export abstract class ManagementClientBase {
public readonly logs = new LogsManager(this.configuration);
public readonly organizations = new OrganizationsManager(this.configuration);
public readonly prompts = new PromptsManager(this.configuration);
public readonly refreshTokens = new RefreshTokensManager(this.configuration);
public readonly resourceServers = new ResourceServersManager(this.configuration);
public readonly roles = new RolesManager(this.configuration);
public readonly rules = new RulesManager(this.configuration);
public readonly rulesConfigs = new RulesConfigsManager(this.configuration);
public readonly sessions = new SessionsManager(this.configuration);
public readonly stats = new StatsManager(this.configuration);
public readonly tenants = new TenantsManager(this.configuration);
public readonly tickets = new TicketsManager(this.configuration);
Expand Down
2 changes: 2 additions & 0 deletions src/management/__generated/managers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ export * from './log-streams-manager.js';
export * from './logs-manager.js';
export * from './organizations-manager.js';
export * from './prompts-manager.js';
export * from './refresh-tokens-manager.js';
export * from './resource-servers-manager.js';
export * from './roles-manager.js';
export * from './rules-manager.js';
export * from './rules-configs-manager.js';
export * from './sessions-manager.js';
export * from './stats-manager.js';
export * from './tenants-manager.js';
export * from './tickets-manager.js';
Expand Down
66 changes: 66 additions & 0 deletions src/management/__generated/managers/refresh-tokens-manager.ts
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);
}
}
60 changes: 60 additions & 0 deletions src/management/__generated/managers/sessions-manager.ts
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);
}
}
Loading

0 comments on commit 17bac36

Please sign in to comment.