Skip to content

Commit

Permalink
Merge branch 'bugfix/refector-the-api-server-config-hook' into q/125.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-e committed Dec 5, 2023
2 parents 8530d32 + d93f516 commit 163f191
Show file tree
Hide file tree
Showing 22 changed files with 810 additions and 2,157 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// /!\ WARNING : THIS FILE IS AUTOGENERATED FROM A KUBERNETES CUSTOM RESOURCE DEFINITION FILE. DO NOT CHANGE IT, use crd-client-generator-ts to update it.
import { customObjects } from './api';
import { CustomObjectsApi } from '@kubernetes/client-node/dist/gen/api/customObjectsApi';
export type Result<T> = T | { error: any };

export type V1alpha1DataService = {
Expand Down Expand Up @@ -71,102 +71,90 @@ export type V1alpha1DataServiceList = {
body: { items: V1alpha1DataService[] };
};

export async function getV1alpha1DataServiceList(
namespace: string,
): Promise<Result<V1alpha1DataServiceList>> {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
export class V1alpha1DataServiceClient {
constructor(private customObjects: CustomObjectsApi) {}
async getV1alpha1DataServiceList(
namespace: string,
): Promise<Result<V1alpha1DataServiceList>> {
try {
return await this.customObjects.listNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
);
} catch (error) {
return { error };
}
}
try {
return await customObjects.listNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
);
} catch (error) {
return { error };
}
}

export async function getV1alpha1DataService(
namespace: string,
V1alpha1DataServiceName: string,
): Promise<Result<V1alpha1DataService>> {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
}
try {
return await customObjects.getNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
V1alpha1DataServiceName,
);
} catch (error) {
return { error };
async getV1alpha1DataService(
namespace: string,
V1alpha1DataServiceName: string,
): Promise<Result<V1alpha1DataService>> {
try {
return await this.customObjects.getNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
V1alpha1DataServiceName,
);
} catch (error) {
return { error };
}
}
}

export async function deleteV1alpha1DataService(
namespace: string,
V1alpha1DataServiceName: string,
) {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
}
try {
return await customObjects.deleteNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
V1alpha1DataServiceName,
{},
);
} catch (error) {
return { error };
async deleteV1alpha1DataService(
namespace: string,
V1alpha1DataServiceName: string,
) {
try {
return await this.customObjects.deleteNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
V1alpha1DataServiceName,
{},
);
} catch (error) {
return { error };
}
}
}

export async function createV1alpha1DataService(
namespace: string,
body: V1alpha1DataService,
): Promise<Result<V1alpha1DataService>> {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
}
try {
return await customObjects.createNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
body,
);
} catch (error) {
return { error };
async createV1alpha1DataService(
namespace: string,
body: V1alpha1DataService,
): Promise<Result<V1alpha1DataService>> {
try {
return await this.customObjects.createNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
body,
);
} catch (error) {
return { error };
}
}
}

export async function patchV1alpha1DataService(
namespace: string,
body: Partial<V1alpha1DataService>,
): Promise<Result<V1alpha1DataService>> {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
}
try {
return await customObjects.patchNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
body,
);
} catch (error) {
return { error };
async patchV1alpha1DataService(
namespace: string,
body: Partial<V1alpha1DataService>,
): Promise<Result<V1alpha1DataService>> {
try {
return await this.customObjects.patchNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
body,
);
} catch (error) {
return { error };
}
}
}

Expand Down Expand Up @@ -240,101 +228,89 @@ export type V1beta1DataServiceList = {
body: { items: V1beta1DataService[] };
};

export async function getV1beta1DataServiceList(
namespace: string,
): Promise<Result<V1beta1DataServiceList>> {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
export class V1beta1DataServiceClient {
constructor(private customObjects: CustomObjectsApi) {}
async getV1beta1DataServiceList(
namespace: string,
): Promise<Result<V1beta1DataServiceList>> {
try {
return await this.customObjects.listNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
);
} catch (error) {
return { error };
}
}
try {
return await customObjects.listNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
);
} catch (error) {
return { error };
}
}

export async function getV1beta1DataService(
namespace: string,
V1beta1DataServiceName: string,
): Promise<Result<V1beta1DataService>> {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
}
try {
return await customObjects.getNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
V1beta1DataServiceName,
);
} catch (error) {
return { error };
async getV1beta1DataService(
namespace: string,
V1beta1DataServiceName: string,
): Promise<Result<V1beta1DataService>> {
try {
return await this.customObjects.getNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
V1beta1DataServiceName,
);
} catch (error) {
return { error };
}
}
}

export async function deleteV1beta1DataService(
namespace: string,
V1beta1DataServiceName: string,
) {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
}
try {
return await customObjects.deleteNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
V1beta1DataServiceName,
{},
);
} catch (error) {
return { error };
async deleteV1beta1DataService(
namespace: string,
V1beta1DataServiceName: string,
) {
try {
return await this.customObjects.deleteNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
V1beta1DataServiceName,
{},
);
} catch (error) {
return { error };
}
}
}

export async function createV1beta1DataService(
namespace: string,
body: V1beta1DataService,
): Promise<Result<V1beta1DataService>> {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
}
try {
return await customObjects.createNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
body,
);
} catch (error) {
return { error };
async createV1beta1DataService(
namespace: string,
body: V1beta1DataService,
): Promise<Result<V1beta1DataService>> {
try {
return await this.customObjects.createNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
body,
);
} catch (error) {
return { error };
}
}
}

export async function patchV1beta1DataService(
namespace: string,
body: Partial<V1beta1DataService>,
): Promise<Result<V1beta1DataService>> {
if (!customObjects) {
return { error: 'customObject has not yet been initialized' };
}
try {
return await customObjects.patchNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
body,
);
} catch (error) {
return { error };
async patchV1beta1DataService(
namespace: string,
body: Partial<V1beta1DataService>,
): Promise<Result<V1beta1DataService>> {
try {
return await this.customObjects.patchNamespacedCustomObject(
'hd.scality.com',
'undefined',
namespace,
'dataservices',
body,
);
} catch (error) {
return { error };
}
}
}
Loading

0 comments on commit 163f191

Please sign in to comment.