Skip to content

Commit

Permalink
Merge branch 'partik-gsoc2023' into linode_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
partik03 authored Aug 25, 2023
2 parents 8ec8606 + 6a25385 commit d8c2fc9
Show file tree
Hide file tree
Showing 20 changed files with 24,312 additions and 18,318 deletions.
25 changes: 25 additions & 0 deletions generator/dummyClasses/oracle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class ClassName {
/**
*
* @param {module} do Oracle SDK
* @param {object} options SDK options
*/
constructor(ocisdk, params, clientConfiguration) {
this._oci = ocisdk;
this._sdkclassName = this._oci.SDKClassName(
params,
clientConfiguration
);
}

function() {
return new Promise((resolve, reject) => {
this._sdkClassName
.SDKFunctionName()
.then(data => resolve(data))
.catch(err => reject(err));
});
}
}

module.exports = ClassName;
72 changes: 72 additions & 0 deletions generator/generatedClasses/DO/storage/do-archivalStorage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*This is an auto generated class, please do not change.*/
/**
* Class to create a ObjectStorageClient object
* @category Oracle Cloud
*/
class Oracle_ArchivalStorage {
/**
*
* @param {module} do Oracle SDK
* @param {object} options SDK options
*/
constructor(ocisdk, params, clientConfiguration) {
this._oci = ocisdk;
this._sdkclassName = this._oci.objectStorageClient(
params,
clientConfiguration
);
}
/**
* Trigers the createBucket function of ObjectStorageClient
* @param {CreateBucketRequest} createBucketRequest - Data required for createBucket
* @returns {Promise<createBucketResponse>}
*/
create(createBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.createBucket(createBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the deleteBucket function of ObjectStorageClient
* @param {DeleteBucketRequest} deleteBucketRequest - Data required for deleteBucket
* @returns {Promise<deleteBucketResponse>}
*/
delete(deleteBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.deleteBucket(deleteBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the listBuckets function of ObjectStorageClient
* @param {ListBucketsRequest} listBucketsRequest - Data required for listBuckets
* @returns {Promise<listBucketsResponse>}
*/
list(listBucketsRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.listBuckets(listBucketsRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the updateBucket function of ObjectStorageClient
* @param {UpdateBucketRequest} updateBucketRequest - Data required for updateBucket
* @returns {Promise<updateBucketResponse>}
*/
update(updateBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.updateBucket(updateBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
}
module.exports = Oracle_ArchivalStorage;
72 changes: 72 additions & 0 deletions generator/generatedClasses/Oracle/storage/oci-archivalStorage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*This is an auto generated class, please do not change.*/
/**
* Class to create a ObjectStorageClient object
* @category Oracle Cloud
*/
class Oracle_ArchivalStorage {
/**
*
* @param {module} do Oracle SDK
* @param {object} options SDK options
*/
constructor(ocisdk, params, clientConfiguration) {
this._oci = ocisdk;
this._sdkclassName = this._oci.objectStorageClient(
params,
clientConfiguration
);
}
/**
* Trigers the createBucket function of ObjectStorageClient
* @param {CreateBucketRequest} createBucketRequest - Data required for createBucket
* @returns {Promise<createBucketResponse>}
*/
create(createBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.createBucket(createBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the deleteBucket function of ObjectStorageClient
* @param {DeleteBucketRequest} deleteBucketRequest - Data required for deleteBucket
* @returns {Promise<deleteBucketResponse>}
*/
delete(deleteBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.deleteBucket(deleteBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the listBuckets function of ObjectStorageClient
* @param {ListBucketsRequest} listBucketsRequest - Data required for listBuckets
* @returns {Promise<listBucketsResponse>}
*/
list(listBucketsRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.listBuckets(listBucketsRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the updateBucket function of ObjectStorageClient
* @param {UpdateBucketRequest} updateBucketRequest - Data required for updateBucket
* @returns {Promise<updateBucketResponse>}
*/
update(updateBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.updateBucket(updateBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
}
module.exports = Oracle_ArchivalStorage;
85 changes: 85 additions & 0 deletions generator/generatedClasses/Oracle/storage/oci-storageBucket.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*This is an auto generated class, please do not change.*/
/**
* Class to create a ObjectStorageClient object
* @category Oracle Cloud
*/
class Oracle_StorageBucket {
/**
*
* @param {module} do Oracle SDK
* @param {object} options SDK options
*/
constructor(ocisdk, params, clientConfiguration) {
this._oci = ocisdk;
this._sdkclassName = this._oci.objectStorageClient(
params,
clientConfiguration
);
}
/**
* Trigers the createBucket function of ObjectStorageClient
* @param {CreateBucketRequest} createBucketRequest - Data required for createBucket
* @returns {Promise<createBucketResponse>}
*/
create(createBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.createBucket(createBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the deleteBucket function of ObjectStorageClient
* @param {DeleteBucketRequest} deleteBucketRequest - Data required for deleteBucket
* @returns {Promise<deleteBucketResponse>}
*/
delete(deleteBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.deleteBucket(deleteBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the getBucket function of ObjectStorageClient
* @param {GetBucketRequest} getBucketRequest - Data required for getBucket
* @returns {Promise<getBucketResponse>}
*/
get(getBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.getBucket(getBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the listBuckets function of ObjectStorageClient
* @param {ListBucketsRequest} listBucketsRequest - Data required for listBuckets
* @returns {Promise<listBucketsResponse>}
*/
list(listBucketsRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.listBuckets(listBucketsRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the reencryptBucket function of ObjectStorageClient
* @param {ReencryptBucketRequest} reencryptBucketRequest - Data required for reencryptBucket
* @returns {Promise<reencryptBucketResponse>}
*/
reencrypt(reencryptBucketRequest) {
return new Promise((resolve, reject) => {
this._objectStorageClient
.reencryptBucket(reencryptBucketRequest)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
}
module.exports = Oracle_StorageBucket;
18 changes: 15 additions & 3 deletions generator/generators/linode/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ function extractSDKData(sdkAst, serviceClass) {
parameters_1.push(parameter);
}
});

methods.push({
functionName: name_1.toString(),
SDKFunctionName: methodName,
Expand All @@ -198,12 +199,13 @@ exports.extractSDKData = extractSDKData;
function getFunctions(sdkFiles, serviceClass) {
return __awaiter(this, void 0, void 0, function() {
var functionsArray, classData;

var _this = this;
return __generator(this, function(_a) {
switch (_a.label) {
case 0:
functionsArray = [];
// console.log(sdkFiles);

return [
4 /*yield*/,
sdkFiles.map(function(file) {
Expand Down Expand Up @@ -257,7 +259,6 @@ function getFunctions(sdkFiles, serviceClass) {
}),
];
case 1:
// console.log(sdkFiles);
_a.sent();
classData = {
className: '',
Expand All @@ -273,7 +274,16 @@ function getFunctions(sdkFiles, serviceClass) {
exports.getFunctions = getFunctions;
function generateLinodeClass(serviceClass, serviceName) {
return __awaiter(this, void 0, void 0, function() {
var methods_1, files, sdkFiles, classData, output, dir, filePath, e_1;

var methods_1,
files,
sdkFiles,
functionsArray,
classData,
output,
filePath,
dir,
e_1;
return __generator(this, function(_a) {
switch (_a.label) {
case 0:
Expand Down Expand Up @@ -318,6 +328,7 @@ function generateLinodeClass(serviceClass, serviceName) {
classData = _a.sent();
classData.className = serviceName + 'LinodeClass';
classData.serviceName = serviceName;

return [
4 /*yield*/,
transformer_1.transform(dummyAst, classData),
Expand All @@ -326,6 +337,7 @@ function generateLinodeClass(serviceClass, serviceName) {
output = _a.sent();
dir = helper_1.getDir(serviceName);
filePath = void 0;

if (
!fs.existsSync(
process.cwd() + '/generatedClasses/Linode/' + dir
Expand Down
Loading

0 comments on commit d8c2fc9

Please sign in to comment.