Skip to content

Commit

Permalink
#804 osb repo fe openapi spec change
Browse files Browse the repository at this point in the history
  • Loading branch information
D-GopalKrishna committed Jan 15, 2024
1 parent c64b731 commit ab8fa9a
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 2 deletions.
63 changes: 63 additions & 0 deletions applications/osb-portal/src/apiclient/workspaces/apis/RestApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ export interface WorkspaceresourcePostRequest {
workspaceResource: WorkspaceResource;
}

export interface WorkspacesControllersOsbrepositoryControllerSetthumbnailRequest {
id: number;
thumbNail?: Blob;
}

export interface WorkspacesControllersWorkspaceControllerAddimageRequest {
id: number;
image?: Blob;
Expand Down Expand Up @@ -1323,6 +1328,64 @@ export class RestApi extends runtime.BaseAPI {
return await response.value();
}

/**
* Sets the thumbnail of the workspace.
*/
async workspacesControllersOsbrepositoryControllerSetthumbnailRaw(requestParameters: WorkspacesControllersOsbrepositoryControllerSetthumbnailRequest): Promise<runtime.ApiResponse<void>> {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling workspacesControllersOsbrepositoryControllerSetthumbnail.');
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const consumes: runtime.Consume[] = [
{ contentType: 'multipart/form-data' },
];
// @ts-ignore: canConsumeForm may be unused
const canConsumeForm = runtime.canConsumeForm(consumes);

let formParams: { append(param: string, value: any): any };
let useForm = false;
// use FormData to transmit files using content-type "multipart/form-data"
useForm = canConsumeForm;
if (useForm) {
formParams = new FormData();
} else {
formParams = new URLSearchParams();
}

if (requestParameters.thumbNail !== undefined) {
formParams.append('thumbNail', requestParameters.thumbNail as any);
}

const response = await this.request({
path: `/osbrepository/{id}/thumbnail/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: formParams,
});

return new runtime.VoidApiResponse(response);
}

/**
* Sets the thumbnail of the workspace.
*/
async workspacesControllersOsbrepositoryControllerSetthumbnail(requestParameters: WorkspacesControllersOsbrepositoryControllerSetthumbnailRequest): Promise<void> {
await this.workspacesControllersOsbrepositoryControllerSetthumbnailRaw(requestParameters);
}

/**
* Adds and image to the workspace.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ export interface OSBRepository {
* @memberof OSBRepository
*/
defaultContext?: string;
/**
*
* @type {string}
* @memberof OSBRepository
*/
thumbnail?: string;
/**
* OSBRepository keycloak user id, will be automatically be set to the logged in user
* @type {string}
Expand Down Expand Up @@ -178,6 +184,7 @@ export function OSBRepositoryFromJSONTyped(json: any, ignoreDiscriminator: boole
'autoSync': !exists(json, 'auto_sync') ? undefined : json['auto_sync'],
'uri': json['uri'],
'defaultContext': !exists(json, 'default_context') ? undefined : json['default_context'],
'thumbnail': !exists(json, 'thumbnail') ? undefined : json['thumbnail'],
'userId': !exists(json, 'user_id') ? undefined : json['user_id'],
'timestampCreated': !exists(json, 'timestamp_created') ? undefined : (new Date(json['timestamp_created'])),
'timestampUpdated': !exists(json, 'timestamp_updated') ? undefined : (new Date(json['timestamp_updated'])),
Expand Down Expand Up @@ -208,6 +215,7 @@ export function OSBRepositoryToJSON(value?: OSBRepository | null): any {
'auto_sync': value.autoSync,
'uri': value.uri,
'default_context': value.defaultContext,
'thumbnail': value.thumbnail,
'user_id': value.userId,
'timestamp_created': value.timestampCreated === undefined ? undefined : (value.timestampCreated.toISOString()),
'timestamp_updated': value.timestampUpdated === undefined ? undefined : (value.timestampUpdated.toISOString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ export interface OSBRepositoryBase {
* @memberof OSBRepositoryBase
*/
defaultContext?: string;
/**
*
* @type {string}
* @memberof OSBRepositoryBase
*/
thumbnail?: string;
/**
* OSBRepository keycloak user id, will be automatically be set to the logged in user
* @type {string}
Expand Down Expand Up @@ -122,6 +128,7 @@ export function OSBRepositoryBaseFromJSONTyped(json: any, ignoreDiscriminator: b
'autoSync': !exists(json, 'auto_sync') ? undefined : json['auto_sync'],
'uri': json['uri'],
'defaultContext': !exists(json, 'default_context') ? undefined : json['default_context'],
'thumbnail': !exists(json, 'thumbnail') ? undefined : json['thumbnail'],
'userId': !exists(json, 'user_id') ? undefined : json['user_id'],
'timestampCreated': !exists(json, 'timestamp_created') ? undefined : (new Date(json['timestamp_created'])),
'timestampUpdated': !exists(json, 'timestamp_updated') ? undefined : (new Date(json['timestamp_updated'])),
Expand All @@ -146,6 +153,7 @@ export function OSBRepositoryBaseToJSON(value?: OSBRepositoryBase | null): any {
'auto_sync': value.autoSync,
'uri': value.uri,
'default_context': value.defaultContext,
'thumbnail': value.thumbnail,
'user_id': value.userId,
'timestamp_created': value.timestampCreated === undefined ? undefined : (value.timestampCreated.toISOString()),
'timestamp_updated': value.timestampUpdated === undefined ? undefined : (value.timestampUpdated.toISOString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export interface OSBRepositoryEntity {
* @memberof OSBRepositoryEntity
*/
defaultContext?: string;
/**
*
* @type {string}
* @memberof OSBRepositoryEntity
*/
thumbnail?: string;
/**
* OSBRepository keycloak user id, will be automatically be set to the logged in user
* @type {string}
Expand Down Expand Up @@ -126,6 +132,7 @@ export function OSBRepositoryEntityFromJSONTyped(json: any, ignoreDiscriminator:
'autoSync': !exists(json, 'auto_sync') ? undefined : json['auto_sync'],
'uri': json['uri'],
'defaultContext': !exists(json, 'default_context') ? undefined : json['default_context'],
'thumbnail': !exists(json, 'thumbnail') ? undefined : json['thumbnail'],
'userId': !exists(json, 'user_id') ? undefined : json['user_id'],
'timestampCreated': !exists(json, 'timestamp_created') ? undefined : (new Date(json['timestamp_created'])),
'timestampUpdated': !exists(json, 'timestamp_updated') ? undefined : (new Date(json['timestamp_updated'])),
Expand All @@ -150,6 +157,7 @@ export function OSBRepositoryEntityToJSON(value?: OSBRepositoryEntity | null): a
'auto_sync': value.autoSync,
'uri': value.uri,
'default_context': value.defaultContext,
'thumbnail': value.thumbnail,
'user_id': value.userId,
'timestamp_created': value.timestampCreated === undefined ? undefined : (value.timestampCreated.toISOString()),
'timestamp_updated': value.timestampUpdated === undefined ? undefined : (value.timestampUpdated.toISOString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,12 @@ export const EditRepoDialog = ({
/>
</Box>
<Box>
<ThumbnailUploadArea
{/* <ThumbnailUploadArea
thumbnail={ }
setThumbnai={ }
thumbnailPreview={ }
thumbnailError={ }
/>
/> */}
</Box>
</DialogContent>
<DialogActions>
Expand Down

0 comments on commit ab8fa9a

Please sign in to comment.