Skip to content

Commit

Permalink
Self Service SSO GA release changes (#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharpandey13 authored Nov 22, 2024
1 parent b77e0f7 commit bab52e9
Show file tree
Hide file tree
Showing 3 changed files with 535 additions and 312 deletions.
151 changes: 136 additions & 15 deletions src/management/__generated/managers/self-service-profiles-manager.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import * as runtime from '../../../lib/runtime.js';
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js';
import type {
GetSelfServiceProfiles200Response,
PostSsoTicketRequest,
SsProfile,
SsProfileCreate,
SsProfileList,
SsProfileUpdate,
SsoAccessTicketResponse,
SsoTicketRequestJson,
GetSelfServiceProfiles200ResponseOneOf,
DeleteSelfServiceProfilesByIdRequest,
GetSelfServiceProfileCustomTextRequest,
GetSelfServiceProfilesRequest,
GetSelfServiceProfilesByIdRequest,
PatchSelfServiceProfilesByIdRequest,
PostSsoTicketRequest,
PostRevokeRequest,
PostSsoTicketOperationRequest,
PutSelfServiceProfileCustomTextRequest,
} from '../models/index.js';

const { BaseAPI } = runtime;
Expand All @@ -25,7 +30,7 @@ export class SelfServiceProfilesManager extends BaseAPI {
*
* @throws {RequiredError}
*/
async deleteSelfServiceProfiles(
async delete(
requestParameters: DeleteSelfServiceProfilesByIdRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<void>> {
Expand All @@ -45,17 +50,71 @@ export class SelfServiceProfilesManager extends BaseAPI {
return runtime.VoidApiResponse.fromResponse(response);
}

/**
* Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page.
*
* Get custom text for a self-service profile
*
* @throws {RequiredError}
*/
async getCustomText(
requestParameters: GetSelfServiceProfileCustomTextRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<{ [key: string]: any }>> {
runtime.validateRequiredRequestParams(requestParameters, ['id', 'language', 'page']);

const response = await this.request(
{
path: `/self-service-profiles/{id}/custom-text/{language}/{page}`
.replace('{id}', encodeURIComponent(String(requestParameters.id)))
.replace('{language}', encodeURIComponent(String(requestParameters.language)))
.replace('{page}', encodeURIComponent(String(requestParameters.page))),
method: 'GET',
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse<any>(response);
}

/**
* Retrieves self-service profiles. Currently only one profile can be created per tenant.
* Retrieve self-service profiles
* Get self-service profiles
*
* @throws {RequiredError}
*/
async getSelfServiceProfiles(initOverrides?: InitOverride): Promise<ApiResponse<SsProfileList>> {
async getAll(
requestParameters: GetSelfServiceProfilesRequest & { include_totals: true },
initOverrides?: InitOverride
): Promise<ApiResponse<GetSelfServiceProfiles200ResponseOneOf>>;
async getAll(
requestParameters?: GetSelfServiceProfilesRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<Array<SsProfile>>>;
async getAll(
requestParameters: GetSelfServiceProfilesRequest = {},
initOverrides?: InitOverride
): Promise<ApiResponse<GetSelfServiceProfiles200Response>> {
const queryParameters = runtime.applyQueryParams(requestParameters, [
{
key: 'page',
config: {},
},
{
key: 'per_page',
config: {},
},
{
key: 'include_totals',
config: {},
},
]);

const response = await this.request(
{
path: `/self-service-profiles`,
method: 'GET',
query: queryParameters,
},
initOverrides
);
Expand All @@ -65,11 +124,11 @@ export class SelfServiceProfilesManager extends BaseAPI {

/**
* Retrieves a self-service profile by Id.
* Retrieve a self-service profile by Id
* Get a self-service profile by Id
*
* @throws {RequiredError}
*/
async getSelfServiceProfilesById(
async get(
requestParameters: GetSelfServiceProfilesByIdRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<SsProfile>> {
Expand All @@ -95,7 +154,7 @@ export class SelfServiceProfilesManager extends BaseAPI {
*
* @throws {RequiredError}
*/
async patchSelfServiceProfiles(
async update(
requestParameters: PatchSelfServiceProfilesByIdRequest,
bodyParameters: SsProfileUpdate,
initOverrides?: InitOverride
Expand All @@ -122,13 +181,40 @@ export class SelfServiceProfilesManager extends BaseAPI {
return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a `202 Accepted` response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a `202 Accepted` response is also returned, signaling that no further action is required.
* Clients should treat these `202` responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found.
*
* Revoke an SSO access ticket
*
* @throws {RequiredError}
*/
async revokeSsoTicket(
requestParameters: PostRevokeRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<any>> {
runtime.validateRequiredRequestParams(requestParameters, ['profileId', 'id']);

const response = await this.request(
{
path: `/self-service-profiles/{profileId}/sso-ticket/{id}/revoke`
.replace('{profileId}', encodeURIComponent(String(requestParameters.profileId)))
.replace('{id}', encodeURIComponent(String(requestParameters.id))),
method: 'POST',
},
initOverrides
);

return runtime.TextApiResponse.fromResponse(response) as any;
}

/**
* Creates a self-service profile. Currently only one profile can be created per tenant.
* Create a self-service profile
*
* @throws {RequiredError}
*/
async postSelfServiceProfiles(
async create(
bodyParameters: SsProfileCreate,
initOverrides?: InitOverride
): Promise<ApiResponse<SsProfile>> {
Expand All @@ -150,14 +236,15 @@ export class SelfServiceProfilesManager extends BaseAPI {
}

/**
* Creates an sso-access ticket to initiate the Self Service SSO Flow using a self-service profile.
* Create an sso-access ticket to initiate the Self Service SSO Flow
* Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile.
*
* Create an SSO access ticket to initiate the Self Service SSO Flow
*
* @throws {RequiredError}
*/
async postSsoTicket(
requestParameters: PostSsoTicketRequest,
bodyParameters: SsoTicketRequestJson,
async createSsoTicket(
requestParameters: PostSsoTicketOperationRequest,
bodyParameters: PostSsoTicketRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<SsoAccessTicketResponse>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);
Expand All @@ -181,4 +268,38 @@ export class SelfServiceProfilesManager extends BaseAPI {

return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Updates text customizations for a given self-service profile, language and Self Service SSO Flow page.
*
* Set custom text for a self-service profile
*
* @throws {RequiredError}
*/
async updateCustomText(
requestParameters: PutSelfServiceProfileCustomTextRequest,
bodyParameters: { [key: string]: any },
initOverrides?: InitOverride
): Promise<ApiResponse<{ [key: string]: any }>> {
runtime.validateRequiredRequestParams(requestParameters, ['id', 'language', 'page']);

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';

const response = await this.request(
{
path: `/self-service-profiles/{id}/custom-text/{language}/{page}`
.replace('{id}', encodeURIComponent(String(requestParameters.id)))
.replace('{language}', encodeURIComponent(String(requestParameters.language)))
.replace('{page}', encodeURIComponent(String(requestParameters.page))),
method: 'PUT',
headers: headerParameters,
body: bodyParameters,
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse<any>(response);
}
}
Loading

0 comments on commit bab52e9

Please sign in to comment.