diff --git a/packages/clients/src/api/webhosting/v1alpha1/api.gen.ts b/packages/clients/src/api/webhosting/v1alpha1/api.gen.ts index a547e52e5..34b7ca8b8 100644 --- a/packages/clients/src/api/webhosting/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/webhosting/v1alpha1/api.gen.ts @@ -17,6 +17,7 @@ import { unmarshalListControlPanelsResponse, unmarshalListHostingsResponse, unmarshalListOffersResponse, + unmarshalResetHostingPasswordResponse, unmarshalSession, } from './marshalling.gen' import type { @@ -33,6 +34,8 @@ import type { ListHostingsResponse, ListOffersRequest, ListOffersResponse, + ResetHostingPasswordRequest, + ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest, @@ -258,8 +261,7 @@ export class API extends ParentAPI { ) /** - * List all control panels type. List the control panels type: cpanel or - * plesk. + * "List the control panels type: cpanel or plesk.". * * @param request - The request {@link ListControlPanelsRequest} * @returns A Promise of ListControlPanelsResponse @@ -283,4 +285,15 @@ export class API extends ParentAPI { }, unmarshalSession, ) + + resetHostingPassword = (request: Readonly) => + this.client.fetch( + { + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/reset-password`, + }, + unmarshalResetHostingPasswordResponse, + ) } diff --git a/packages/clients/src/api/webhosting/v1alpha1/index.gen.ts b/packages/clients/src/api/webhosting/v1alpha1/index.gen.ts index 8031b57e6..8ff40252a 100644 --- a/packages/clients/src/api/webhosting/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/webhosting/v1alpha1/index.gen.ts @@ -33,6 +33,8 @@ export type { Offer, OfferProduct, OfferQuotaWarning, + ResetHostingPasswordRequest, + ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest, diff --git a/packages/clients/src/api/webhosting/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/webhosting/v1alpha1/marshalling.gen.ts index 9196717be..a363a6d7b 100644 --- a/packages/clients/src/api/webhosting/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/webhosting/v1alpha1/marshalling.gen.ts @@ -22,6 +22,7 @@ import type { Nameserver, Offer, OfferProduct, + ResetHostingPasswordResponse, Session, UpdateHostingRequest, } from './types.gen' @@ -235,6 +236,20 @@ export const unmarshalListOffersResponse = ( } as ListOffersResponse } +export const unmarshalResetHostingPasswordResponse = ( + data: unknown, +): ResetHostingPasswordResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.`, + ) + } + + return { + password: data.password, + } as ResetHostingPasswordResponse +} + export const unmarshalSession = (data: unknown): Session => { if (!isJSONObject(data)) { throw new TypeError( diff --git a/packages/clients/src/api/webhosting/v1alpha1/types.gen.ts b/packages/clients/src/api/webhosting/v1alpha1/types.gen.ts index d4376eeec..56e7a36ed 100644 --- a/packages/clients/src/api/webhosting/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/webhosting/v1alpha1/types.gen.ts @@ -383,6 +383,21 @@ export interface ListOffersResponse { offers: Offer[] } +export type ResetHostingPasswordRequest = { + /** + * Region to target. If none is passed will use default region from the + * config. + */ + region?: Region + /** UUID of the hosting. */ + hostingId: string +} + +export interface ResetHostingPasswordResponse { + /** New password. */ + password: string +} + export type RestoreHostingRequest = { /** * Region to target. If none is passed will use default region from the