-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from zoho/beta
2.0.0
- Loading branch information
Showing
2,013 changed files
with
216,164 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
lib/core/com/zoho/crm/api/mass_delete_tags/error_detail1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import {SDKException} from "../exception/sdk_exception.js"; | ||
import {Constants} from "../../../../../../utils/util/constants.js"; | ||
|
||
class ErrorDetail1{ | ||
|
||
apiName; | ||
jsonPath; | ||
keyModified = new Map(); | ||
/** | ||
* The method to get the apiName | ||
* @returns {String} A String representing the apiName | ||
*/ | ||
getAPIName() { | ||
return this.apiName; | ||
|
||
} | ||
|
||
/** | ||
* The method to set the value to apiName | ||
* @param {String} apiName A String representing the apiName | ||
*/ | ||
setAPIName(apiName) { | ||
if((apiName != null) && (!(Object.prototype.toString.call(apiName) == "[object String]"))) { | ||
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: apiName EXPECTED TYPE: String", null, null); | ||
} | ||
this.apiName = apiName; | ||
this.keyModified.set("api_name", 1); | ||
|
||
} | ||
|
||
/** | ||
* The method to get the jsonPath | ||
* @returns {String} A String representing the jsonPath | ||
*/ | ||
getJsonPath() { | ||
return this.jsonPath; | ||
|
||
} | ||
|
||
/** | ||
* The method to set the value to jsonPath | ||
* @param {String} jsonPath A String representing the jsonPath | ||
*/ | ||
setJsonPath(jsonPath) { | ||
if((jsonPath != null) && (!(Object.prototype.toString.call(jsonPath) == "[object String]"))) { | ||
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: jsonPath EXPECTED TYPE: String", null, null); | ||
} | ||
this.jsonPath = jsonPath; | ||
this.keyModified.set("json_path", 1); | ||
|
||
} | ||
|
||
/** | ||
* The method to check if the user has modified the given key | ||
* @param {String} key A String representing the key | ||
* @returns {number} A number representing the modification | ||
*/ | ||
isKeyModified(key) { | ||
if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { | ||
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); | ||
} | ||
if(this.keyModified.has(key)) { | ||
return this.keyModified.get(key); | ||
} | ||
return null; | ||
|
||
} | ||
|
||
/** | ||
* The method to mark the given key as modified | ||
* @param {String} key A String representing the key | ||
* @param {number} modification A number representing the modification | ||
*/ | ||
setKeyModified(key, modification) { | ||
if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) { | ||
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null); | ||
} | ||
if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) { | ||
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null); | ||
} | ||
this.keyModified.set(key, modification); | ||
|
||
} | ||
|
||
} | ||
export { | ||
ErrorDetail1 as MasterModel, | ||
ErrorDetail1 as ErrorDetail1 | ||
} |
1 change: 1 addition & 0 deletions
1
lib/core/com/zoho/crm/api/mass_delete_tags/import_mass_delete_tags.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import * as ZOHOCRMSDK from "@zohocrm/nodejs-sdk-7.0"; | ||
|
||
class GetSupportedAPI { | ||
|
||
static async initialize() { | ||
let environment = ZOHOCRMSDK.USDataCenter.PRODUCTION(); | ||
let token = new ZOHOCRMSDK.OAuthBuilder() | ||
.clientId("client_id") | ||
.clientSecret("client_secret") | ||
.grantToken("grant_token") | ||
.build(); | ||
|
||
await (await new ZOHOCRMSDK.InitializeBuilder()) | ||
.environment(environment) | ||
.token(token) | ||
.initialize(); | ||
} | ||
static async getSupportedAPI() { | ||
let filters = null; | ||
let apisOperations = new ZOHOCRMSDK.Apis.APIsOperations(filters); | ||
let response = await apisOperations.getSupportedAPI(); | ||
|
||
if (response != null) { | ||
console.log("Status Code: " + response.getStatusCode()); | ||
|
||
if (response.getStatusCode() == 204) { | ||
console.log("No Content"); | ||
return; | ||
} | ||
|
||
let responseHandler = response.getObject(); | ||
|
||
if (responseHandler instanceof ZOHOCRMSDK.Apis.ResponseWrapper) { | ||
let responseWrapper = responseHandler; | ||
let apis = responseWrapper.getApis(); | ||
|
||
if (apis != null) { | ||
apis.forEach(api => { | ||
console.log("API Path: " + api.getPath()); | ||
let operationTypes = api.getOperationTypes(); | ||
|
||
operationTypes.forEach(operationType => { | ||
console.log("API Operation Method: " + operationType.getMethod()); | ||
console.log("API Operation OAuthScope: " + operationType.getOauthScope()); | ||
console.log("API Operation MaxCredits: " + operationType.getMaxCredits()); | ||
console.log("API Operation MinCredits: " + operationType.getMinCredits()); | ||
}); | ||
}); | ||
} | ||
} else if (responseHandler instanceof ZOHOCRMSDK.Apis.APIException) { | ||
let exception = responseHandler; | ||
console.log("Status: " + exception.getStatus().getValue()); | ||
console.log("Code: " + exception.getCode().getValue()); | ||
console.log("Details: "); | ||
|
||
for (let [key, value] of Object.entries(exception.getDetails())) { | ||
console.log(`${key}: ${value}`); | ||
} | ||
|
||
console.log("Message: " + exception.getMessage()); | ||
} | ||
} | ||
} | ||
} | ||
|
||
await GetSupportedAPI.initialize(); | ||
await GetSupportedAPI.getSupportedAPI() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import * as ZOHOCRMSDK from "@zohocrm/nodejs-sdk-7.0"; | ||
|
||
class CreateAuditlogExport { | ||
|
||
static async initialize() { | ||
let environment = ZOHOCRMSDK.USDataCenter.PRODUCTION(); | ||
let token = new ZOHOCRMSDK.OAuthBuilder() | ||
.clientId("client_id") | ||
.clientSecret("client_secret") | ||
.grantToken("grant_token") | ||
.build(); | ||
|
||
await (await new ZOHOCRMSDK.InitializeBuilder()) | ||
.environment(environment) | ||
.token(token) | ||
.initialize(); | ||
} | ||
static async createAuditlogExport() { | ||
const auditLogExportOperations = new ZOHOCRMSDK.AuditExportLog.AuditLogExportOperations(); | ||
const request = new ZOHOCRMSDK.AuditExportLog.BodyWrapper(); | ||
const auditLogExport = []; | ||
|
||
const auditLogExport1 = new ZOHOCRMSDK.AuditExportLog.AuditLogExport(); | ||
const criteria = new ZOHOCRMSDK.AuditExportLog.Criteria(); | ||
criteria.setComparator("between"); | ||
|
||
const field = new ZOHOCRMSDK.AuditExportLog.Field(); | ||
field.setAPIName("audited_time"); | ||
await criteria.setField(field); | ||
|
||
const values = []; | ||
values.push(new Date(2024, 2, 20, 10, 10, 19)); | ||
values.push(new Date(2024, 2, 20, 10, 10, 10)); | ||
criteria.setValue(values); | ||
|
||
await auditLogExport1.setCriteria(criteria); | ||
auditLogExport.push(auditLogExport1); | ||
request.setAuditLogExport(auditLogExport); | ||
|
||
const response = await auditLogExportOperations.createAuditlogExport(request); | ||
if (response) { | ||
console.log("Status Code: " + response.getStatusCode()); | ||
const actionHandler = response.getObject(); | ||
if (actionHandler instanceof ZOHOCRMSDK.AuditExportLog.ActionWrapper) { | ||
const actionWrapper = actionHandler; | ||
const actionResponses = actionWrapper.getAuditLogExport(); | ||
for (const actionResponse of actionResponses) { | ||
if (actionResponse instanceof ZOHOCRMSDK.AuditExportLog.SuccessResponse) { | ||
const successResponse = actionResponse; | ||
console.log("Status: " + successResponse.getStatus().getValue()); | ||
console.log("Code: " + successResponse.getCode().getValue()); | ||
console.log("Details: "); | ||
for (let [key, value] of Object.entries(successResponse.getDetails())) { | ||
console.log(key + ": " + value); | ||
} | ||
console.log("Message: " + successResponse.getMessage()); | ||
} else if (actionResponse instanceof ZOHOCRMSDK.AuditExportLog.APIException) { | ||
const exception = actionResponse; | ||
console.log("Status: " + exception.getStatus().getValue()); | ||
console.log("Code: " + exception.getCode().getValue()); | ||
console.log("Details: "); | ||
for (let [key, value] of Object.entries(exception.getDetails())) { | ||
console.log(key + ": " + value); | ||
} | ||
console.log("Message: " + exception.getMessage()); | ||
} | ||
} | ||
} else if (actionHandler instanceof ZOHOCRMSDK.AuditExportLog.APIException) { | ||
const exception = actionHandler; | ||
console.log("Status: " + exception.getStatus().getValue()); | ||
console.log("Code: " + exception.getCode().getValue()); | ||
console.log("Details: "); | ||
for (const [key, value] of Object.entries(exception.getDetails())) { | ||
console.log(key + ": " + value); | ||
} | ||
console.log("Message: " + exception.getMessage()); | ||
} | ||
} | ||
} | ||
} | ||
|
||
await CreateAuditlogExport.initialize(); | ||
await CreateAuditlogExport.createAuditlogExport() |
Oops, something went wrong.