Skip to content

Commit

Permalink
Merge pull request #180 from partik03/linode_tests
Browse files Browse the repository at this point in the history
Added tests for Linode generator module
  • Loading branch information
mbcse authored Aug 25, 2023
2 parents 6a25385 + d8c2fc9 commit 21135ea
Show file tree
Hide file tree
Showing 29 changed files with 1,221 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*This is an auto generated class, please do not change.*/
/**
* Class to create a ComputeInstanceLinodeClass object
* @category Linode
*/
class Linode_ComputeInstance {
/**
*
* @param {module} do Linode SDK
* @param {object} options SDK options
*/
constructor(linodeSdk, linodeToken) {
this._linode = linodeSdk;
this._linodeToken = linodeToken;
}
/**
* Trigers the getLinodes function of ComputeInstanceLinodeClass
* @param {Params} params - Data required for getLinodes
* @param {Filter} filter - Data required for getLinodes
* @returns {Promise<getLinodesResponse>}
*/
list(params = undefined, filter = undefined) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.getLinodes(params, filter)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the createLinode function of ComputeInstanceLinodeClass
* @param {CreateLinodeRequest} data - Data required for createLinode
* @returns {Promise<createLinodeResponse>}
*/
create(data) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.createLinode(data)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the updateLinode function of ComputeInstanceLinodeClass
* @param {NumberKeyword} linodeId - Data required for updateLinode
* @param {DeepPartial} values - Data required for updateLinode
* @returns {Promise<updateLinodeResponse>}
*/
update(linodeId, values) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.updateLinode(linodeId, values)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the deleteLinode function of ComputeInstanceLinodeClass
* @param {NumberKeyword} linodeId - Data required for deleteLinode
* @returns {Promise<deleteLinodeResponse>}
*/
delete(linodeId) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.deleteLinode(linodeId)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
}
module.exports = Linode_ComputeInstance;
106 changes: 106 additions & 0 deletions generator/generatedClasses/Linode/compute/linode-kubernetes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*This is an auto generated class, please do not change.*/
/**
* Class to create a KubernetesLinodeClass object
* @category Linode
*/
class Linode_Kubernetes {
/**
*
* @param {module} do Linode SDK
* @param {object} options SDK options
*/
constructor(linodeSdk, linodeToken) {
this._linode = linodeSdk;
this._linodeToken = linodeToken;
}
/**
* Trigers the createKubernetesCluster function of KubernetesLinodeClass
* @param {CreateKubeClusterPayload} data - Data required for createKubernetesCluster
* @returns {Promise<createKubernetesClusterResponse>}
*/
create(data) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.createKubernetesCluster(data)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the deleteKubernetesCluster function of KubernetesLinodeClass
* @param {NumberKeyword} clusterID - Data required for deleteKubernetesCluster
* @returns {Promise<deleteKubernetesClusterResponse>}
*/
delete(clusterID) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.deleteKubernetesCluster(clusterID)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the getNodePool function of KubernetesLinodeClass
* @param {NumberKeyword} clusterID - Data required for getNodePool
* @param {NumberKeyword} nodePoolID - Data required for getNodePool
* @returns {Promise<getNodePoolResponse>}
*/
getNodePool(clusterID, nodePoolID) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.getNodePool(clusterID, nodePoolID)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the createNodePool function of KubernetesLinodeClass
* @param {NumberKeyword} clusterID - Data required for createNodePool
* @param {CreateNodePoolData} data - Data required for createNodePool
* @returns {Promise<createNodePoolResponse>}
*/
createNodePool(clusterID, data) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.createNodePool(clusterID, data)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the updateNodePool function of KubernetesLinodeClass
* @param {NumberKeyword} clusterID - Data required for updateNodePool
* @param {NumberKeyword} nodePoolID - Data required for updateNodePool
* @param {Partial} data - Data required for updateNodePool
* @returns {Promise<updateNodePoolResponse>}
*/
updateNodePool(clusterID, nodePoolID, data) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.updateNodePool(clusterID, nodePoolID, data)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the deleteNodePool function of KubernetesLinodeClass
* @param {NumberKeyword} clusterID - Data required for deleteNodePool
* @param {NumberKeyword} nodePoolID - Data required for deleteNodePool
* @returns {Promise<deleteNodePoolResponse>}
*/
deleteNodePool(clusterID, nodePoolID) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.deleteNodePool(clusterID, nodePoolID)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
}
module.exports = Linode_Kubernetes;
108 changes: 108 additions & 0 deletions generator/generatedClasses/Linode/database/linode-noSql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*This is an auto generated class, please do not change.*/
/**
* Class to create a NoSqlLinodeClass object
* @category Linode
*/
class Linode_NoSql {
/**
*
* @param {module} do Linode SDK
* @param {object} options SDK options
*/
constructor(linodeSdk, linodeToken) {
this._linode = linodeSdk;
this._linodeToken = linodeToken;
}
/**
* Trigers the getDatabases function of NoSqlLinodeClass
* @param {Params} params - Data required for getDatabases
* @param {Filter} filter - Data required for getDatabases
* @returns {Promise<getDatabasesResponse>}
*/
getDatabases(params = undefined, filter = undefined) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.getDatabases(params, filter)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the getDatabaseEngines function of NoSqlLinodeClass
* @param {Params} params - Data required for getDatabaseEngines
* @param {Filter} filter - Data required for getDatabaseEngines
* @returns {Promise<getDatabaseEnginesResponse>}
*/
getDatabaseEngines(params = undefined, filter = undefined) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.getDatabaseEngines(params, filter)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the createDatabase function of NoSqlLinodeClass
* @param {UnionType} engine - Data required for createDatabase
* @param {CreateDatabasePayload} data - Data required for createDatabase
* @returns {Promise<createDatabaseResponse>}
*/
createDatabase(engine, data) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.createDatabase(engine, data)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the getEngineDatabase function of NoSqlLinodeClass
* @param {Engine} engine - Data required for getEngineDatabase
* @param {NumberKeyword} databaseID - Data required for getEngineDatabase
* @returns {Promise<getEngineDatabaseResponse>}
*/
getEngineDatabase(engine, databaseID) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.getEngineDatabase(engine, databaseID)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the updateDatabase function of NoSqlLinodeClass
* @param {Engine} engine - Data required for updateDatabase
* @param {NumberKeyword} databaseID - Data required for updateDatabase
* @param {UpdateDatabasePayload} data - Data required for updateDatabase
* @returns {Promise<updateDatabaseResponse>}
*/
updateDatabase(engine, databaseID, data) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.updateDatabase(engine, databaseID, data)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the deleteDatabase function of NoSqlLinodeClass
* @param {Engine} engine - Data required for deleteDatabase
* @param {NumberKeyword} databaseID - Data required for deleteDatabase
* @returns {Promise<deleteDatabaseResponse>}
*/
deleteDatabase(engine, databaseID) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.deleteDatabase(engine, databaseID)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
}
module.exports = Linode_NoSql;
104 changes: 104 additions & 0 deletions generator/generatedClasses/Linode/network/linode-DNS.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*This is an auto generated class, please do not change.*/
/**
* Class to create a DNSLinodeClass object
* @category Linode
*/
class Linode_DNS {
/**
*
* @param {module} do Linode SDK
* @param {object} options SDK options
*/
constructor(linodeSdk, linodeToken) {
this._linode = linodeSdk;
this._linodeToken = linodeToken;
}
/**
* Trigers the getDomains function of DNSLinodeClass
* @param {Params} params - Data required for getDomains
* @param {Filter} filter - Data required for getDomains
* @returns {Promise<getDomainsResponse>}
*/
getDomains(params = undefined, filter = undefined) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.getDomains(params, filter)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the getDomain function of DNSLinodeClass
* @param {NumberKeyword} domainId - Data required for getDomain
* @returns {Promise<getDomainResponse>}
*/
getDomain(domainId) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.getDomain(domainId)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the createDomain function of DNSLinodeClass
* @param {CreateDomainPayload} data - Data required for createDomain
* @returns {Promise<createDomainResponse>}
*/
createDomain(data) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.createDomain(data)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the updateDomain function of DNSLinodeClass
* @param {NumberKeyword} domainId - Data required for updateDomain
* @param {UpdateDomainPayload} data - Data required for updateDomain
* @returns {Promise<updateDomainResponse>}
*/
updateDomain(domainId, data) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.updateDomain(domainId, data)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the deleteDomain function of DNSLinodeClass
* @param {NumberKeyword} domainId - Data required for deleteDomain
* @returns {Promise<deleteDomainResponse>}
*/
deleteDomain(domainId) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.deleteDomain(domainId)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
/**
* Trigers the cloneDomain function of DNSLinodeClass
* @param {NumberKeyword} domainId - Data required for cloneDomain
* @param {CloneDomainPayload} data - Data required for cloneDomain
* @returns {Promise<cloneDomainResponse>}
*/
cloneDomain(domainId, data) {
this._linode.setToken(this._linodeToken);
return new Promise((resolve, reject) => {
this._linode
.cloneDomain(domainId, data)
.then(data => resolve(data))
.catch(err => reject(err));
});
}
}
module.exports = Linode_DNS;
Loading

0 comments on commit 21135ea

Please sign in to comment.