Skip to content

Commit

Permalink
Merge branch 'partik-gsoc2023' into linode_package
Browse files Browse the repository at this point in the history
  • Loading branch information
partik03 authored Aug 25, 2023
2 parents 9a1e27b + dbf0148 commit 5df7bf5
Show file tree
Hide file tree
Showing 41 changed files with 44,853 additions and 7,707 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;
12 changes: 10 additions & 2 deletions generator/generators/linode/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,14 @@ function extractSDKData(sdkAst, serviceClass) {
exports.extractSDKData = extractSDKData;
function getFunctions(sdkFiles, serviceClass) {
return __awaiter(this, void 0, void 0, function() {
var functionsArray;
var functionsArray, classData;

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

return [
4 /*yield*/,
sdkFiles.map(function(file) {
Expand Down Expand Up @@ -273,7 +275,12 @@ function getFunctions(sdkFiles, serviceClass) {
];
case 1:
_a.sent();
return [2 /*return*/, functionsArray];
classData = {
className: '',
functions: functionsArray,
serviceName: null,
};
return [2 /*return*/, classData];
}
});
});
Expand Down Expand Up @@ -345,6 +352,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
7 changes: 6 additions & 1 deletion generator/generators/linode/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ export async function getFunctions(sdkFiles, serviceClass) {
}
});
});
return functionsArray;
const classData: ClassData = {
className: '',
functions: functionsArray,
serviceName: null,
};
return classData;
}

export async function generateLinodeClass(serviceClass, serviceName) {
Expand Down
Loading

0 comments on commit 5df7bf5

Please sign in to comment.