diff --git a/openapi/cloudmersive.barcode/.gitignore b/openapi/cloudmersive.barcode/.gitignore new file mode 100644 index 000000000..1de565933 --- /dev/null +++ b/openapi/cloudmersive.barcode/.gitignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/openapi/cloudmersive.barcode/Ballerina.toml b/openapi/cloudmersive.barcode/Ballerina.toml new file mode 100644 index 000000000..83dab2c58 --- /dev/null +++ b/openapi/cloudmersive.barcode/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +license = ["Apache-2.0"] +keywords = ["Cloudmersive", "barcode"] +org = "ballerinax" +name = "cloudmersive.barcode" +repository = "https://github.com/ballerina-platform/ballerinax-openapi-connectors" +version = "0.1.0-SNAPSHOT" +authors = ["Ballerina"] +[build-options] +observabilityIncluded = true diff --git a/openapi/cloudmersive.barcode/Dependencies.toml b/openapi/cloudmersive.barcode/Dependencies.toml new file mode 100644 index 000000000..1d6708b76 --- /dev/null +++ b/openapi/cloudmersive.barcode/Dependencies.toml @@ -0,0 +1,11 @@ +[[dependency]] +org = "ballerina" +name = "http" +version = "1.1.0-alpha8" + +[[dependency]] +org = "ballerina" +name = "url" +version = "1.1.0-alpha8" + + diff --git a/openapi/cloudmersive.barcode/Module.md b/openapi/cloudmersive.barcode/Module.md new file mode 100644 index 000000000..4273f0c75 --- /dev/null +++ b/openapi/cloudmersive.barcode/Module.md @@ -0,0 +1,46 @@ +## Overview +Cloudmersive Barcode API provide capabilities to generate and recognize 1D and 2D barcodes. + +Ballerina connector for Cloudmersive Barcode allows easy integration with Cloudmersive Barcode REST API via Ballerina language. +It allows scanning photos of barcodes to text, generate 1D barcodes and generate 2D barcodes + +This module supports Cloudmersive Barcode REST API `v1` version. + +### Prerequisites +* Create a Cloudmersive Account +* Obtaining tokens + 1. [Login to the Cloudmersive account](https://account.cloudmersive.com/login) + 2. [Obtain API keys](https://account.cloudmersive.com/keys) + +## Quickstart + +To use the Cloudmersive Barcode connector in your Ballerina application, update the .bal file as follows: +### Step 1: Import cloudmersive.barcode module +First, import the ballerinax/cloudmersive.barcode module into the Ballerina project. +```ballerina +import ballerinax/cloudmersive.barcode; +``` +### Step 2: Configure the connection credentials. +You can now make the connection configuration using the access token. +```ballerina +barcode:ApiKeysConfig config = { + apiKeys : { + hapikey : "" + } +}; + +barcode:Client baseClient = check new Client(clientConfig); + +``` +### Step 3: Lookup EAN barcode + +```ballerina +barcode:BarcodeLookupResponse|error bEvent = baseClient->barcodeEanLookup("4 605664 00005"); + +if (bEvent is barcode:BarcodeLookupResponse) { + log:printInfo("Product data: " + bEvent.toString()); +} else { + log:printError(msg = bEvent.toString()); +} + +``` \ No newline at end of file diff --git a/openapi/cloudmersive.barcode/Package.md b/openapi/cloudmersive.barcode/Package.md new file mode 100644 index 000000000..927266b1c --- /dev/null +++ b/openapi/cloudmersive.barcode/Package.md @@ -0,0 +1,18 @@ +Connects to Cloudmersive Barcode API from Ballerina + +## Package overview + +The `ballerinax/cloudmersive.barcode` is a [Ballerina](https://ballerina.io/) connector for connecting to Cloudmersive Barcode API. + +### Compatibility +| | Version | +|:------------------------:|:--------------------------:| +| Ballerina Language | Ballerina Swan Lake Beta2 | +| Cloudmersive API | v1 | + +## Report issues +To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina connector repository](https://github.com/ballerina-platform/ballerinax-openapi-connectors) +## Useful links +- Discuss code changes of the Ballerina project in [ballerina-dev@googlegroups.com](mailto:ballerina-dev@googlegroups.com). +- Chat live with us via our [Slack channel](https://ballerina.io/community/slack/). +- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag diff --git a/openapi/cloudmersive.barcode/client.bal b/openapi/cloudmersive.barcode/client.bal new file mode 100644 index 000000000..443d070ce --- /dev/null +++ b/openapi/cloudmersive.barcode/client.bal @@ -0,0 +1,153 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; + +# Please visit [here](https://account.cloudmersive.com/keys) to get more information on obtaining API key +# +# + apiKeys - Provide your API Key as `Apikey`. Eg: `{"Apikey" : "}`" +public type ApiKeysConfig record { + map apiKeys; +}; + +# Barcode APIs let you generate barcode images, and recognize values from images of barcodes. +# +# + clientEp - Connector http endpoint +public client class Client { + http:Client clientEp; + map apiKeys; + # Client initialization. + # + # + apiKeyConfig - API key configuration detail + # + clientConfig - Client configuration details + # + serviceUrl - Connector server URL + # + return - Error at failure of client initialization + public isolated function init(ApiKeysConfig apiKeyConfig, http:ClientConfiguration clientConfig = {}, string serviceUrl = "https://testapi.cloudmersive.com/") returns error? { + http:Client httpEp = check new (serviceUrl, clientConfig); + self.clientEp = httpEp; + self.apiKeys = apiKeyConfig.apiKeys; + } + # Lookup EAN barcode value, return product data + # + # + payload - Barcode value + # + return - OK + remote isolated function barcodeEanLookup(string payload) returns BarcodeLookupResponse|error { + string path = string `/barcode/lookup/ean`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + BarcodeLookupResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=BarcodeLookupResponse); + return response; + } + # Scan and recognize an image of a barcode + # + # + payload - The image file to scan + # + return - OK + remote isolated function barcodeScanImage(Body payload) returns BarcodeScanResult|error { + string path = string `/barcode/scan/image`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + BarcodeScanResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=BarcodeScanResult); + return response; + } + # Generate a QR code barcode as PNG file + # + # + payload - QR code text to convert into the QR code barcode + # + return - OK + remote isolated function generateBarcodeQrcode(string payload) returns string|error { + string path = string `/barcode/generate/qrcode`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string); + return response; + } + # Generate a UPC-A code barcode as PNG file + # + # + payload - UPC-A barcode value to generate from + # + return - OK + remote isolated function generateBarcodeUpca(string payload) returns string|error { + string path = string `/barcode/generate/upc-a`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string); + return response; + } + # Generate a UPC-E code barcode as PNG file + # + # + payload - UPC-E barcode value to generate from + # + return - OK + remote isolated function generateBarcodeUpce(string payload) returns string|error { + string path = string `/barcode/generate/upc-e`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string); + return response; + } + # Generate a EAN-13 code barcode as PNG file + # + # + payload - Barcode value to generate from + # + return - OK + remote isolated function generateBarcodeEan13(string payload) returns string|error { + string path = string `/barcode/generate/ean-13`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string); + return response; + } + # Generate a EAN-8 code barcode as PNG file + # + # + payload - Barcode value to generate from + # + return - OK + remote isolated function generateBarcodeEan8(string payload) returns string|error { + string path = string `/barcode/generate/ean-8`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string); + return response; + } +} + +# Generate header map for given header values. +# +# + headerParam - Headers map +# + return - Returns generated map or error at failure of client initialization +isolated function getMapForHeaders(map headerParam) returns map { + map headerMap = {}; + foreach var [key, value] in headerParam.entries() { + if value is string || value is string[] { + headerMap[key] = value; + } + } + return headerMap; +} diff --git a/openapi/cloudmersive.barcode/openapi.yaml b/openapi/cloudmersive.barcode/openapi.yaml new file mode 100644 index 000000000..733a90ca3 --- /dev/null +++ b/openapi/cloudmersive.barcode/openapi.yaml @@ -0,0 +1,342 @@ +openapi: 3.0.1 +info: + title: barcodeapi + description: Barcode APIs let you generate barcode images, and recognize values + from images of barcodes. + version: v1 +servers: +- url: https://testapi.cloudmersive.com/ +paths: + /barcode/lookup/ean: + post: + tags: + - BarcodeLookup + summary: Lookup EAN barcode value, return product data + description: Lookup an input EAN barcode and return key details about the product + operationId: Barcode Ean Lookup + requestBody: + description: Barcode value + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + application/xml: + schema: + type: string + text/xml: + schema: + type: string + application/x-www-form-urlencoded: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BarcodeLookupResponse' + text/json: + schema: + $ref: '#/components/schemas/BarcodeLookupResponse' + application/xml: + schema: + $ref: '#/components/schemas/BarcodeLookupResponse' + text/xml: + schema: + $ref: '#/components/schemas/BarcodeLookupResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /barcode/scan/image: + post: + tags: + - BarcodeScan + summary: Scan and recognize an image of a barcode + description: Scan an image or photo of a barcode and return the result. Supported + barcode types include AZTEC, CODABAR, CODE_39, CODE_93, CODE_128, DATA_MATRIX, + EAN_8, EAN_13, ITF, MAXICODE, PDF_417, QR_CODE, RSS_14, RSS_EXPANDED, UPC_A, + UPC_E, All_1D, UPC_EAN_EXTENSION, MSI, PLESSEY, IMB + operationId: Barcode Scan_Image + requestBody: + content: + multipart/form-data: + schema: + description: The image file to scan + required: + - imageFile + properties: + imageFile: + type: string + description: Image file to perform the operation on. Common file + formats such as PNG, JPEG are supported. + format: binary + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BarcodeScanResult' + text/json: + schema: + $ref: '#/components/schemas/BarcodeScanResult' + application/xml: + schema: + $ref: '#/components/schemas/BarcodeScanResult' + text/xml: + schema: + $ref: '#/components/schemas/BarcodeScanResult' + security: + - Apikey: [] + /barcode/generate/qrcode: + post: + tags: + - GenerateBarcode + summary: Generate a QR code barcode as PNG file + description: Generate a QR code barcode as a PNG file, a type of 2D barcode + which can encode free-form text information + operationId: Generate Barcode_QRCode + requestBody: + description: QR code text to convert into the QR code barcode + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + application/xml: + schema: + type: string + text/xml: + schema: + type: string + application/x-www-form-urlencoded: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/octet-stream: + schema: + title: OutputContent + type: string + description: Output file content from the operation + format: byte + security: + - Apikey: [] + x-codegen-request-body-name: value + /barcode/generate/upc-a: + post: + tags: + - GenerateBarcode + summary: Generate a UPC-A code barcode as PNG file + description: Validate and generate a UPC-A barcode as a PNG file, a type of + 1D barcode + operationId: Generate Barcode_UPCA + requestBody: + description: UPC-A barcode value to generate from + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + application/xml: + schema: + type: string + text/xml: + schema: + type: string + application/x-www-form-urlencoded: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/octet-stream: + schema: + title: OutputContent + type: string + description: Output file content from the operation + format: byte + security: + - Apikey: [] + x-codegen-request-body-name: value + /barcode/generate/upc-e: + post: + tags: + - GenerateBarcode + summary: Generate a UPC-E code barcode as PNG file + description: Validates and generate a UPC-E barcode as a PNG file, a type of + 1D barcode + operationId: Generate Barcode_UPCE + requestBody: + description: UPC-E barcode value to generate from + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + application/xml: + schema: + type: string + text/xml: + schema: + type: string + application/x-www-form-urlencoded: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/octet-stream: + schema: + title: OutputContent + type: string + description: Output file content from the operation + format: byte + security: + - Apikey: [] + x-codegen-request-body-name: value + /barcode/generate/ean-13: + post: + tags: + - GenerateBarcode + summary: Generate a EAN-13 code barcode as PNG file + description: Validates and generate a EAN-13 barcode as a PNG file, a type of + 1D barcode + operationId: Generate Barcode_EAN13 + requestBody: + description: Barcode value to generate from + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + application/xml: + schema: + type: string + text/xml: + schema: + type: string + application/x-www-form-urlencoded: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/octet-stream: + schema: + title: OutputContent + type: string + description: Output file content from the operation + format: byte + security: + - Apikey: [] + x-codegen-request-body-name: value + /barcode/generate/ean-8: + post: + tags: + - GenerateBarcode + summary: Generate a EAN-8 code barcode as PNG file + description: Validates and generate a EAN-8 barcode as a PNG file, a type of + 1D barcode + operationId: Generate Barcode_EAN8 + requestBody: + description: Barcode value to generate from + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + application/xml: + schema: + type: string + text/xml: + schema: + type: string + application/x-www-form-urlencoded: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/octet-stream: + schema: + title: OutputContent + type: string + description: Output file content from the operation + format: byte + security: + - Apikey: [] + x-codegen-request-body-name: value +components: + schemas: + BarcodeLookupResponse: + type: object + properties: + Successful: + type: boolean + description: True if operation was successful, false otherwise + Matches: + type: array + description: Resulting product matches for the input barcode + items: + $ref: '#/components/schemas/ProductMatch' + description: Result of performing a barcode lookup + ProductMatch: + type: object + properties: + EAN: + type: string + description: EAN code for the product + Title: + type: string + description: Title of the product + description: Matching product for the input barcode + BarcodeScanResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + BarcodeType: + type: string + description: The type of the barcode; possible values are AZTEC, CODABAR, + CODE_39, CODE_93, CODE_128, DATA_MATRIX, EAN_8, EAN_13, ITF, MAXICODE, + PDF_417, QR_CODE, RSS_14, RSS_EXPANDED, UPC_A, UPC_E, All_1D, UPC_EAN_EXTENSION, + MSI, PLESSEY, IMB + RawText: + type: string + description: The barcode text + description: Result of the barcode scan + securitySchemes: + Apikey: + type: apiKey + description: API Key Authentication + name: Apikey + in: header diff --git a/openapi/cloudmersive.barcode/types.bal b/openapi/cloudmersive.barcode/types.bal new file mode 100644 index 000000000..6688df1e9 --- /dev/null +++ b/openapi/cloudmersive.barcode/types.bal @@ -0,0 +1,47 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +# Matching product for the input barcode +public type ProductMatch record { + # EAN code for the product + string EAN?; + # Title of the product + string Title?; +}; + +# Result of the barcode scan +public type BarcodeScanResult record { + # True if the operation was successful, false otherwise + boolean Successful?; + # The type of the barcode; possible values are AZTEC, CODABAR, CODE_39, CODE_93, CODE_128, DATA_MATRIX, EAN_8, EAN_13, ITF, MAXICODE, PDF_417, QR_CODE, RSS_14, RSS_EXPANDED, UPC_A, UPC_E, All_1D, UPC_EAN_EXTENSION, MSI, PLESSEY, IMB + string BarcodeType?; + # The barcode text + string RawText?; +}; + +# Result of performing a barcode lookup +public type BarcodeLookupResponse record { + # True if operation was successful, false otherwise + boolean Successful?; + # Resulting product matches for the input barcode + ProductMatch[] Matches?; +}; + +# The image file to scan +public type Body record { + # Image file to perform the operation on. Common file formats such as PNG, JPEG are supported. + string imageFile; +}; diff --git a/openapi/cloudmersive.currency/.gitignore b/openapi/cloudmersive.currency/.gitignore new file mode 100644 index 000000000..1de565933 --- /dev/null +++ b/openapi/cloudmersive.currency/.gitignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/openapi/cloudmersive.currency/Ballerina.toml b/openapi/cloudmersive.currency/Ballerina.toml new file mode 100644 index 000000000..643b66f82 --- /dev/null +++ b/openapi/cloudmersive.currency/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +license = ["Apache-2.0"] +keywords = ["Cloudmersive", "currency"] +org = "ballerinax" +name = "cloudmersive.currency" +repository = "https://github.com/ballerina-platform/ballerinax-openapi-connectors" +version = "0.1.0-SNAPSHOT" +authors = ["Ballerina"] +[build-options] +observabilityIncluded = true diff --git a/openapi/cloudmersive.currency/Dependencies.toml b/openapi/cloudmersive.currency/Dependencies.toml new file mode 100644 index 000000000..1d6708b76 --- /dev/null +++ b/openapi/cloudmersive.currency/Dependencies.toml @@ -0,0 +1,11 @@ +[[dependency]] +org = "ballerina" +name = "http" +version = "1.1.0-alpha8" + +[[dependency]] +org = "ballerina" +name = "url" +version = "1.1.0-alpha8" + + diff --git a/openapi/cloudmersive.currency/Module.md b/openapi/cloudmersive.currency/Module.md new file mode 100644 index 000000000..90d14aa3d --- /dev/null +++ b/openapi/cloudmersive.currency/Module.md @@ -0,0 +1,48 @@ +## Overview +Cloudmersive Currency API provide capabilities to convert prices between currencies, and it leverages real-time +conversion rates for over 30 currencies. + +Ballerina connector for Cloudmersive Currency allows easy integration with Cloudmersive Currency REST API via Ballerina language. +It allows obtaining real-time exchange Rate Data and allows converting prices between over 30 currencies. + +This module supports Cloudmersive Currency REST API `v1` version. + +## Prerequisites +* Create a Cloudmersive Account +* Obtaining tokens + 1. [Login to the Cloudmersive account](https://account.cloudmersive.com/login) + 2. [Obtain API keys](https://account.cloudmersive.com/keys) + + +## Quickstart + +To use the Cloudmersive Currency connector in your Ballerina application, update the .bal file as follows: + +### Step 1: Import cloudmersive.currency module +First, import the ballerinax/cloudmersive.currency module into the Ballerina project. +```ballerina +import ballerinax/cloudmersive.currency; +``` +### Step 2: Configure the connection credentials. +You can now make the connection configuration using the access token. +```ballerina +currency:ApiKeysConfig config = { + apiKeys : { + hapikey : "" + } +}; + +currency:Client baseClient = check new Client(clientConfig); + +``` +### Step 3: Get all currency types +```ballerina +currency:AvailableCurrencyResponse|error bEvent = baseClient->currencyExchangeGetAvailableCurrencies(); + +if (bEvent is currency:AvailableCurrencyResponse) { + log:printInfo("Currency List: " + bEvent.toString()); +} else { + log:printError(msg = bEvent.toString()); +} + +``` \ No newline at end of file diff --git a/openapi/cloudmersive.currency/Package.md b/openapi/cloudmersive.currency/Package.md new file mode 100644 index 000000000..2836b78f8 --- /dev/null +++ b/openapi/cloudmersive.currency/Package.md @@ -0,0 +1,19 @@ +Connects to Cloudmersive Currency API from Ballerina + +## Package overview + +The `ballerinax/cloudmersive.currency` is a [Ballerina](https://ballerina.io/) connector for connecting to Cloudmersive Currency API. + +### Compatibility +| | Version | +|:------------------------:|:--------------------------:| +| Ballerina Language | Ballerina Swan Lake Beta2 | +| Cloudmersive API | v1 | + + +## Report issues +To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina connector repository](https://github.com/ballerina-platform/ballerinax-openapi-connectors) +## Useful links +- Discuss code changes of the Ballerina project in [ballerina-dev@googlegroups.com](mailto:ballerina-dev@googlegroups.com). +- Chat live with us via our [Slack channel](https://ballerina.io/community/slack/). +- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag diff --git a/openapi/cloudmersive.currency/client.bal b/openapi/cloudmersive.currency/client.bal new file mode 100644 index 000000000..9eca22d3c --- /dev/null +++ b/openapi/cloudmersive.currency/client.bal @@ -0,0 +1,99 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; + +# Please visit [here](https://account.cloudmersive.com/keys) to get more information on obtaining API key +# +# + apiKeys - Provide your API Key as `Apikey`. Eg: `{"Apikey" : "}`" +public type ApiKeysConfig record { + map apiKeys; +}; + +# The currency APIs help you retrieve exchange rates and convert prices between currencies easily. +# +# + clientEp - Connector http endpoint +public client class Client { + http:Client clientEp; + map apiKeys; + # Client initialization. + # + # + apiKeyConfig - API key configuration detail + # + clientConfig - Client configuration details + # + serviceUrl - Connector server URL + # + return - Error at failure of client initialization + public isolated function init(ApiKeysConfig apiKeyConfig, http:ClientConfiguration clientConfig = {}, string serviceUrl = "https://testapi.cloudmersive.com/") returns error? { + http:Client httpEp = check new (serviceUrl, clientConfig); + self.clientEp = httpEp; + self.apiKeys = apiKeyConfig.apiKeys; + } + # Get a list of available currencies and corresponding countries + # + # + return - OK + remote isolated function currencyExchangeGetAvailableCurrencies() returns AvailableCurrencyResponse|error { + string path = string `/currency/exchange-rates/list-available`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + //TODO: Update the request as needed; + AvailableCurrencyResponse response = check self.clientEp-> post(path, request, headers = accHeaders, targetType = AvailableCurrencyResponse); + return response; + } + # Converts a price from the source currency into the destination currency + # + # + 'source - Source currency three-digit code (ISO 4217), e.g. USD, EUR, etc. + # + destination - Destination currency three-digit code (ISO 4217), e.g. USD, EUR, etc. + # + payload - Input price, such as 19.99 in source currency + # + return - OK + remote isolated function currencyExchangeConvertCurrency(string 'source, string destination, decimal payload) returns ConvertedCurrencyResult|error { + string path = string `/currency/exchange-rates/convert/${'source}/to/${destination}`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ConvertedCurrencyResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ConvertedCurrencyResult); + return response; + } + # Gets the exchange rate from the source currency into the destination currency + # + # + 'source - Source currency three-digit code (ISO 4217), e.g. USD, EUR, etc. + # + destination - Destination currency three-digit code (ISO 4217), e.g. USD, EUR, etc. + # + return - OK + remote isolated function currencyExchangeGetExchangeRate(string 'source, string destination) returns ExchangeRateResult|error { + string path = string `/currency/exchange-rates/get/${'source}/to/${destination}`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + //TODO: Update the request as needed; + ExchangeRateResult response = check self.clientEp-> post(path, request, headers = accHeaders, targetType = ExchangeRateResult); + return response; + } +} + +# Generate header map for given header values. +# +# + headerParam - Headers map +# + return - Returns generated map or error at failure of client initialization +isolated function getMapForHeaders(map headerParam) returns map { + map headerMap = {}; + foreach var [key, value] in headerParam.entries() { + if value is string || value is string[] { + headerMap[key] = value; + } + } + return headerMap; +} diff --git a/openapi/cloudmersive.currency/openapi.yaml b/openapi/cloudmersive.currency/openapi.yaml new file mode 100644 index 000000000..4a9468019 --- /dev/null +++ b/openapi/cloudmersive.currency/openapi.yaml @@ -0,0 +1,198 @@ +openapi: 3.0.1 +info: + title: currencyapi + description: The currency APIs help you retrieve exchange rates and convert prices + between currencies easily. + version: v1 +servers: +- url: https://testapi.cloudmersive.com/ +paths: + /currency/exchange-rates/list-available: + post: + tags: + - CurrencyExchange + summary: Get a list of available currencies and corresponding countries + description: Enumerates available currencies and the countries that correspond + to these currencies. + operationId: Currency Exchange_Get Available Currencies + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AvailableCurrencyResponse' + text/json: + schema: + $ref: '#/components/schemas/AvailableCurrencyResponse' + application/xml: + schema: + $ref: '#/components/schemas/AvailableCurrencyResponse' + text/xml: + schema: + $ref: '#/components/schemas/AvailableCurrencyResponse' + security: + - Apikey: [] + /currency/exchange-rates/convert/{source}/to/{destination}: + post: + tags: + - CurrencyExchange + summary: Converts a price from the source currency into the destination currency + description: Automatically converts the price in the source currency into the + destination currency using the latest available currency exchange rate data. + operationId: Currency Exchange_Convert Currency + parameters: + - name: source + in: path + description: Source currency three-digit code (ISO 4217), e.g. USD, EUR, etc. + required: true + schema: + type: string + - name: destination + in: path + description: Destination currency three-digit code (ISO 4217), e.g. USD, EUR, + etc. + required: true + schema: + type: string + requestBody: + description: Input price, such as 19.99 in source currency + content: + application/json: + schema: + type: number + format: double + text/json: + schema: + type: number + format: double + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConvertedCurrencyResult' + text/json: + schema: + $ref: '#/components/schemas/ConvertedCurrencyResult' + application/xml: + schema: + $ref: '#/components/schemas/ConvertedCurrencyResult' + text/xml: + schema: + $ref: '#/components/schemas/ConvertedCurrencyResult' + security: + - Apikey: [] + x-codegen-request-body-name: sourcePrice + /currency/exchange-rates/get/{source}/to/{destination}: + post: + tags: + - CurrencyExchange + summary: Gets the exchange rate from the source currency into the destination + currency + description: Automatically gets the exchange rate from the source currency into + the destination currency using the latest available currency exchange rate + data. + operationId: Currency Exchange_Get Exchange Rate + parameters: + - name: source + in: path + description: Source currency three-digit code (ISO 4217), e.g. USD, EUR, etc. + required: true + schema: + type: string + - name: destination + in: path + description: Destination currency three-digit code (ISO 4217), e.g. USD, EUR, + etc. + required: true + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ExchangeRateResult' + text/json: + schema: + $ref: '#/components/schemas/ExchangeRateResult' + application/xml: + schema: + $ref: '#/components/schemas/ExchangeRateResult' + text/xml: + schema: + $ref: '#/components/schemas/ExchangeRateResult' + security: + - Apikey: [] +components: + schemas: + AvailableCurrencyResponse: + type: object + properties: + Currencies: + type: array + description: List of available currencies from the API + items: + $ref: '#/components/schemas/AvailableCurrency' + description: Result of performing an enumerate currencies operation + AvailableCurrency: + type: object + properties: + ISOCurrencyCode: + type: string + description: ISO 4217 currency three-letter code associated with the country + CurrencySymbol: + type: string + description: Symbol associated with the currency + CurrencyEnglishName: + type: string + description: Full name of the currency + CountryName: + type: string + description: Name of the country + CountryThreeLetterCode: + type: string + description: Three-letter ISO 3166-1 country code + CountryISOTwoLetterCode: + type: string + description: Two-letter ISO 3166-1 country code + IsEuropeanUnionMember: + type: boolean + description: True if this country is currently a member of the European + Union (EU), false otherwise + description: Details of a specific currency + ConvertedCurrencyResult: + type: object + properties: + ConvertedPrice: + type: number + description: The converted price in the destination currency + format: double + ISOCurrencyCode: + type: string + description: ISO 4217 currency three-letter code of destination price + CurrencySymbol: + type: string + description: Destination currency symbol + FormattedPriceAsString: + type: string + description: Formatted price in the destination currency as a string + description: Result of performing a Convert Currency operation + ExchangeRateResult: + type: object + properties: + ExchangeRate: + type: number + description: The exchange rate from the source to the destination currency + format: double + description: Result of performing a get exchange rate operation + securitySchemes: + Apikey: + type: apiKey + description: API Key Authentication + name: Apikey + in: header diff --git a/openapi/cloudmersive.currency/types.bal b/openapi/cloudmersive.currency/types.bal new file mode 100644 index 000000000..213f12307 --- /dev/null +++ b/openapi/cloudmersive.currency/types.bal @@ -0,0 +1,57 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +# Details of a specific currency +public type AvailableCurrency record { + # ISO 4217 currency three-letter code associated with the country + string ISOCurrencyCode?; + # Symbol associated with the currency + string CurrencySymbol?; + # Full name of the currency + string CurrencyEnglishName?; + # Name of the country + string CountryName?; + # Three-letter ISO 3166-1 country code + string CountryThreeLetterCode?; + # Two-letter ISO 3166-1 country code + string CountryISOTwoLetterCode?; + # True if this country is currently a member of the European Union (EU), false otherwise + boolean IsEuropeanUnionMember?; +}; + +# Result of performing an enumerate currencies operation +public type AvailableCurrencyResponse record { + # List of available currencies from the API + AvailableCurrency[] Currencies?; +}; + +# Result of performing a get exchange rate operation +public type ExchangeRateResult record { + # The exchange rate from the source to the destination currency + float ExchangeRate?; +}; + +# Result of performing a Convert Currency operation +public type ConvertedCurrencyResult record { + # The converted price in the destination currency + float ConvertedPrice?; + # ISO 4217 currency three-letter code of destination price + string ISOCurrencyCode?; + # Destination currency symbol + string CurrencySymbol?; + # Formatted price in the destination currency as a string + string FormattedPriceAsString?; +}; diff --git a/openapi/cloudmersive.security/.gitignore b/openapi/cloudmersive.security/.gitignore new file mode 100644 index 000000000..1de565933 --- /dev/null +++ b/openapi/cloudmersive.security/.gitignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/openapi/cloudmersive.security/Ballerina.toml b/openapi/cloudmersive.security/Ballerina.toml new file mode 100644 index 000000000..8cca4d723 --- /dev/null +++ b/openapi/cloudmersive.security/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +license = ["Apache-2.0"] +keywords = ["Cloudmersive", "security"] +org = "ballerinax" +name = "cloudmersive.security" +repository = "https://github.com/ballerina-platform/ballerinax-openapi-connectors" +version = "0.1.0-SNAPSHOT" +authors = ["Ballerina"] +[build-options] +observabilityIncluded = true diff --git a/openapi/cloudmersive.security/Dependencies.toml b/openapi/cloudmersive.security/Dependencies.toml new file mode 100644 index 000000000..1d6708b76 --- /dev/null +++ b/openapi/cloudmersive.security/Dependencies.toml @@ -0,0 +1,11 @@ +[[dependency]] +org = "ballerina" +name = "http" +version = "1.1.0-alpha8" + +[[dependency]] +org = "ballerina" +name = "url" +version = "1.1.0-alpha8" + + diff --git a/openapi/cloudmersive.security/Module.md b/openapi/cloudmersive.security/Module.md new file mode 100644 index 000000000..338f165d5 --- /dev/null +++ b/openapi/cloudmersive.security/Module.md @@ -0,0 +1,46 @@ +## Overview +Cloudmersive Security API provide capabilities to detect and block security threats. + +Ballerina connector for Cloudmersive Security allows easy integration with Cloudmersive Security REST API via Ballerina language. +It allows advanced high-performance scanning capabilities on files for SQL Injection attacks and threats, insecure deserialization attacks and threats, +XML External Entity attacks and threats, XSS attacks and threats, Server-Side Request Forgery (SSRF) threats and attacks, bots and other threats. + +This module supports Cloudmersive Security REST API `v1` version. +## Prerequisites +* Create a Cloudmersive Account +* Obtaining tokens + 1. [Login to the Cloudmersive account](https://account.cloudmersive.com/login) + 2. [Obtain API keys](https://account.cloudmersive.com/keys) + +## Quickstart +To use the Cloudmersive Security connector in your Ballerina application, update the .bal file as follows: + +### Step 1: Import cloudmersive.security module +First, import the ballerinax/cloudmersive.security module into the Ballerina project. +```ballerina +import ballerinax/cloudmersive.security; +``` +### Step 2: Configure the connection credentials. +You can now make the connection configuration using the access token. +```ballerina +security:ApiKeysConfig config = { + apiKeys : { + hapikey : "" + } +}; + +security:Client baseClient = check new Client(clientConfig); + +``` +### Step 3: Scan the query for SQL Injection +```ballerina +string query = "SELECT * FROM Users WHERE UserId = 105 OR 1=1;"; +security:StringSqlInjectionDetectionResult|error bEvent = baseClient->contentThreatDetectionCheckSqlInjectionString(query); + +if (bEvent is security:StringSqlInjectionDetectionResult) { + log:printInfo("Threat Report: " + bEvent.toString()); +} else { + test:assertFail(msg = bEvent.toString()); +} + +``` \ No newline at end of file diff --git a/openapi/cloudmersive.security/Package.md b/openapi/cloudmersive.security/Package.md new file mode 100644 index 000000000..beabb3ef1 --- /dev/null +++ b/openapi/cloudmersive.security/Package.md @@ -0,0 +1,18 @@ +Connects to Cloudmersive Security API from Ballerina + +## Package overview + +The `ballerinax/cloudmersive.security` is a [Ballerina](https://ballerina.io/) connector for connecting to Cloudmersive Security API. + +### Compatibility +| | Version | +|:------------------------:|:--------------------------:| +| Ballerina Language | Ballerina Swan Lake Beta2 | +| Cloudmersive API | v1 | + +## Report issues +To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina connector repository](https://github.com/ballerina-platform/ballerinax-openapi-connectors) +## Useful links +- Discuss code changes of the Ballerina project in [ballerina-dev@googlegroups.com](mailto:ballerina-dev@googlegroups.com). +- Chat live with us via our [Slack channel](https://ballerina.io/community/slack/). +- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag diff --git a/openapi/cloudmersive.security/client.bal b/openapi/cloudmersive.security/client.bal new file mode 100644 index 000000000..c5432e166 --- /dev/null +++ b/openapi/cloudmersive.security/client.bal @@ -0,0 +1,183 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; + +# Please visit [here](https://account.cloudmersive.com/keys) to get more information on obtaining API key +# +# + apiKeys - Provide your API Key as `Apikey`. Eg: `{"Apikey" : "}`" +public type ApiKeysConfig record { + map apiKeys; +}; + +# The security APIs help you detect and block security threats. +# +# + clientEp - Connector http endpoint +public client class Client { + http:Client clientEp; + map apiKeys; + # Client initialization. + # + # + apiKeyConfig - API key configuration detail + # + clientConfig - Client configuration details + # + serviceUrl - Connector server URL + # + return - Error at failure of client initialization + public isolated function init(ApiKeysConfig apiKeyConfig, http:ClientConfiguration clientConfig = {}, string serviceUrl = "https://testapi.cloudmersive.com/") returns error? { + http:Client httpEp = check new (serviceUrl, clientConfig); + self.clientEp = httpEp; + self.apiKeys = apiKeyConfig.apiKeys; + } + # Automatically detect threats in an input string + # + # + payload - User-facing text input. + # + return - OK + remote isolated function contentThreatDetectionAutomaticThreatDetectionString(string payload) returns StringAutomaticThreatDetection|error { + string path = string `/security/threat-detection/content/automatic/detect/string`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + StringAutomaticThreatDetection response = check self.clientEp->post(path, request, headers = accHeaders, targetType=StringAutomaticThreatDetection); + return response; + } + # Detect Insecure Deserialization JSON (JID) attacks in a string + # + # + payload - User-facing text input. + # + return - OK + remote isolated function contentThreatDetectionDetectInsecureDeserializationJsonString(string payload) returns StringInsecureDeserializationJsonDetection|error { + string path = string `/security/threat-detection/content/insecure-deserialization/json/detect/string`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + StringInsecureDeserializationJsonDetection response = check self.clientEp->post(path, request, headers = accHeaders, targetType=StringInsecureDeserializationJsonDetection); + return response; + } + # Check text input for SQL Injection (SQLI) attacks + # + # + payload - User-facing text input. + # + return - OK + remote isolated function contentThreatDetectionCheckSqlInjectionString(string payload) returns StringSqlInjectionDetectionResult|error { + string path = string `/security/threat-detection/content/sql-injection/detect/string`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + StringSqlInjectionDetectionResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=StringSqlInjectionDetectionResult); + return response; + } + # Protect text input from Cross-Site-Scripting (XSS) attacks through normalization + # + # + payload - User-facing text input. + # + return - OK + remote isolated function contentThreatDetectionProtectXss(string payload) returns StringXssProtectionResult|error { + string path = string `/security/threat-detection/content/xss/detect/string`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + StringXssProtectionResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=StringXssProtectionResult); + return response; + } + # Protect text input from XML External Entity (XXE) attacks + # + # + payload - User-facing text input. + # + return - OK + remote isolated function contentThreatDetectionCheckXxe(string payload) returns StringXxeDetectionResult|error { + string path = string `/security/threat-detection/content/xxe/detect/xml/string`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + StringXxeDetectionResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=StringXxeDetectionResult); + return response; + } + # Check a URL for Server-side Request Forgery (SSRF) threats + # + # + payload - Input URL request + # + return - OK + remote isolated function networkThreatDetectionDetectSsrfUrl(UrlSsrfThreatDetectionRequestFull payload) returns UrlSsrfThreatDetectionResponseFull|error { + string path = string `/security/threat-detection/network/url/ssrf/detect`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + UrlSsrfThreatDetectionResponseFull response = check self.clientEp->post(path, request, headers = accHeaders, targetType=UrlSsrfThreatDetectionResponseFull); + return response; + } + # Check if IP address is a known threat + # + # + payload - IP address to check, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function networkThreatDetectionIsThreat(string payload) returns IPThreatDetectionResponse|error { + string path = string `/security/threat-detection/network/ip/is-threat`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + IPThreatDetectionResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=IPThreatDetectionResponse); + return response; + } + # Check if IP address is a Bot client threat + # + # + payload - IP address to check, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function networkThreatDetectionIsBot(string payload) returns ThreatDetectionBotCheckResponse|error { + string path = string `/security/threat-detection/network/ip/is-bot`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ThreatDetectionBotCheckResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ThreatDetectionBotCheckResponse); + return response; + } + # Check if IP address is a Tor node server + # + # + payload - IP address to check, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function networkThreatDetectionIsTorNode(string payload) returns ThreatDetectionTorNodeResponse|error { + string path = string `/security/threat-detection/network/ip/is-tor-node`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ThreatDetectionTorNodeResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ThreatDetectionTorNodeResponse); + return response; + } +} + +# Generate header map for given header values. +# +# + headerParam - Headers map +# + return - Returns generated map or error at failure of client initialization +isolated function getMapForHeaders(map headerParam) returns map { + map headerMap = {}; + foreach var [key, value] in headerParam.entries() { + if value is string || value is string[] { + headerMap[key] = value; + } + } + return headerMap; +} diff --git a/openapi/cloudmersive.security/openapi.yaml b/openapi/cloudmersive.security/openapi.yaml new file mode 100644 index 000000000..9ec721557 --- /dev/null +++ b/openapi/cloudmersive.security/openapi.yaml @@ -0,0 +1,497 @@ +openapi: 3.0.1 +info: + title: securityapi + description: The security APIs help you detect and block security threats. + version: v1 +servers: +- url: https://testapi.cloudmersive.com/ +paths: + /security/threat-detection/content/automatic/detect/string: + post: + tags: + - ContentThreatDetection + summary: Automatically detect threats in an input string + description: Auto-detects a wide range of threat types in input string, including + Cross-Site Scripting (XSS), SQL Injection (SQLI), XML External Entitites (XXE), + Server-side Request Forgeries (SSRF), and JSON Insecure Deserialization (JID). + operationId: Content Threat Detection_Automatic Threat Detection String + requestBody: + description: User-facing text input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StringAutomaticThreatDetection' + text/json: + schema: + $ref: '#/components/schemas/StringAutomaticThreatDetection' + application/xml: + schema: + $ref: '#/components/schemas/StringAutomaticThreatDetection' + text/xml: + schema: + $ref: '#/components/schemas/StringAutomaticThreatDetection' + security: + - Apikey: [] + x-codegen-request-body-name: value + /security/threat-detection/content/insecure-deserialization/json/detect/string: + post: + tags: + - ContentThreatDetection + summary: Detect Insecure Deserialization JSON (JID) attacks in a string + description: Detects Insecure Deserialization JSON (JID) attacks from text input. + operationId: Content Threat Detection_Detect Insecure Deserialization Json String + requestBody: + description: User-facing text input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StringInsecureDeserializationJsonDetection' + text/json: + schema: + $ref: '#/components/schemas/StringInsecureDeserializationJsonDetection' + application/xml: + schema: + $ref: '#/components/schemas/StringInsecureDeserializationJsonDetection' + text/xml: + schema: + $ref: '#/components/schemas/StringInsecureDeserializationJsonDetection' + security: + - Apikey: [] + x-codegen-request-body-name: value + /security/threat-detection/content/sql-injection/detect/string: + post: + tags: + - ContentThreatDetection + summary: Check text input for SQL Injection (SQLI) attacks + description: Detects SQL Injection (SQLI) attacks from text input. + operationId: Content Threat Detection_Check Sql Injection String + requestBody: + description: User-facing text input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StringSqlInjectionDetectionResult' + text/json: + schema: + $ref: '#/components/schemas/StringSqlInjectionDetectionResult' + application/xml: + schema: + $ref: '#/components/schemas/StringSqlInjectionDetectionResult' + text/xml: + schema: + $ref: '#/components/schemas/StringSqlInjectionDetectionResult' + security: + - Apikey: [] + x-codegen-request-body-name: value + /security/threat-detection/content/xss/detect/string: + post: + tags: + - ContentThreatDetection + summary: Protect text input from Cross-Site-Scripting (XSS) attacks through + normalization + description: Detects and removes XSS (Cross-Site-Scripting) attacks from text + input through normalization. Returns the normalized result, as well as information + on whether the original input contained an XSS risk. + operationId: Content Threat Detection_Protect Xss + requestBody: + description: User-facing text input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StringXssProtectionResult' + text/json: + schema: + $ref: '#/components/schemas/StringXssProtectionResult' + application/xml: + schema: + $ref: '#/components/schemas/StringXssProtectionResult' + text/xml: + schema: + $ref: '#/components/schemas/StringXssProtectionResult' + security: + - Apikey: [] + x-codegen-request-body-name: value + /security/threat-detection/content/xxe/detect/xml/string: + post: + tags: + - ContentThreatDetection + summary: Protect text input from XML External Entity (XXE) attacks + description: Detects XXE (XML External Entity) attacks from XML text input. + operationId: Content Threat Detection_Check Xxe + requestBody: + description: User-facing text input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StringXxeDetectionResult' + text/json: + schema: + $ref: '#/components/schemas/StringXxeDetectionResult' + application/xml: + schema: + $ref: '#/components/schemas/StringXxeDetectionResult' + text/xml: + schema: + $ref: '#/components/schemas/StringXxeDetectionResult' + security: + - Apikey: [] + x-codegen-request-body-name: value + /security/threat-detection/network/url/ssrf/detect: + post: + tags: + - NetworkThreatDetection + summary: Check a URL for Server-side Request Forgery (SSRF) threats + description: Checks if an input URL is at risk of being an SSRF (Server-side + request forgery) threat or attack. + operationId: Network Threat Detection_Detect Ssrf Url + requestBody: + description: Input URL request + content: + application/json: + schema: + $ref: '#/components/schemas/UrlSsrfThreatDetectionRequestFull' + text/json: + schema: + $ref: '#/components/schemas/UrlSsrfThreatDetectionRequestFull' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UrlSsrfThreatDetectionResponseFull' + text/json: + schema: + $ref: '#/components/schemas/UrlSsrfThreatDetectionResponseFull' + application/xml: + schema: + $ref: '#/components/schemas/UrlSsrfThreatDetectionResponseFull' + text/xml: + schema: + $ref: '#/components/schemas/UrlSsrfThreatDetectionResponseFull' + security: + - Apikey: [] + x-codegen-request-body-name: request + /security/threat-detection/network/ip/is-threat: + post: + tags: + - NetworkThreatDetection + summary: Check if IP address is a known threat + description: Check if the input IP address is a known threat IP address. Checks + against known bad IPs, botnets, compromised servers, and other lists of threats. + operationId: Network Threat Detection_Is Threat + requestBody: + description: IP address to check, e.g. "55.55.55.55". The input is a string + so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IPThreatDetectionResponse' + text/json: + schema: + $ref: '#/components/schemas/IPThreatDetectionResponse' + application/xml: + schema: + $ref: '#/components/schemas/IPThreatDetectionResponse' + text/xml: + schema: + $ref: '#/components/schemas/IPThreatDetectionResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /security/threat-detection/network/ip/is-bot: + post: + tags: + - NetworkThreatDetection + summary: Check if IP address is a Bot client threat + description: Check if the input IP address is a Bot, robot, or otherwise a non-user + entity. Leverages real-time signals to check against known high-probability + bots.. + operationId: Network Threat Detection_Is Bot + requestBody: + description: IP address to check, e.g. "55.55.55.55". The input is a string + so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ThreatDetectionBotCheckResponse' + text/json: + schema: + $ref: '#/components/schemas/ThreatDetectionBotCheckResponse' + application/xml: + schema: + $ref: '#/components/schemas/ThreatDetectionBotCheckResponse' + text/xml: + schema: + $ref: '#/components/schemas/ThreatDetectionBotCheckResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /security/threat-detection/network/ip/is-tor-node: + post: + tags: + - NetworkThreatDetection + summary: Check if IP address is a Tor node server + description: Check if the input IP address is a Tor exit node server. Tor servers + are a type of privacy-preserving technology that can hide the original IP + address who makes a request. + operationId: Network Threat Detection_Is Tor Node + requestBody: + description: IP address to check, e.g. "55.55.55.55". The input is a string + so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ThreatDetectionTorNodeResponse' + text/json: + schema: + $ref: '#/components/schemas/ThreatDetectionTorNodeResponse' + application/xml: + schema: + $ref: '#/components/schemas/ThreatDetectionTorNodeResponse' + text/xml: + schema: + $ref: '#/components/schemas/ThreatDetectionTorNodeResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value +components: + schemas: + StringAutomaticThreatDetection: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + CleanResult: + type: boolean + ContainedJsonInsecureDeserializationAttack: + type: boolean + description: True if the input contained Insecure Deserialization JSON, + false otherwise + ContainedXssThreat: + type: boolean + description: True if the input contained XSS attack, false otherwise + ContainedXxeThreat: + type: boolean + description: True if the input contained XXE attack, false otherwise + ContainedSqlInjectionThreat: + type: boolean + description: True if the input contained SQL Injection attack, false otherwise + ContainedSsrfThreat: + type: boolean + description: True if the input contained an Server-Side Request Forgery + (SSRF) URL attack, false otherwise + IsXML: + type: boolean + description: True if the input string is XML, false otherwise + IsJSON: + type: boolean + description: True if the input string is JSON, false otherwise + IsURL: + type: boolean + description: True if the input string is a URL, false otherwise + OriginalInput: + type: string + description: Original input string + description: Result of performing an Insecure Deserialization JSON protection + operation + StringInsecureDeserializationJsonDetection: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + ContainedJsonInsecureDeserializationAttack: + type: boolean + description: True if the input contained Insecure Deserialization JSON, + false otherwise + OriginalInput: + type: string + description: Original input string + description: Result of performing an Insecure Deserialization JSON protection + operation + StringSqlInjectionDetectionResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + ContainedSqlInjectionAttack: + type: boolean + description: True if the input contained SQL Injection attacks, false otherwise + OriginalInput: + type: string + description: Original input string + description: Result of performing an SQL Injection protection operation + StringXssProtectionResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + ContainedXss: + type: boolean + description: True if the input contained XSS scripting, false otherwise + OriginalInput: + type: string + description: Original input string + NormalizedResult: + type: string + description: Normalized string result, with XSS removed + description: Result of performing an XSS protection operation + StringXxeDetectionResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + ContainedXxe: + type: boolean + description: True if the input contained XXE threats, false otherwise + description: Result of performing an XXE threat detection operation + UrlSsrfThreatDetectionRequestFull: + type: object + properties: + URL: + type: string + description: URL to validate + BlockedDomains: + type: array + description: Top level domains that you do not want to allow access to, + e.g. mydomain.com - will block all subdomains as well + items: + type: string + description: Request to determine if a URL is an SSRF threat check + UrlSsrfThreatDetectionResponseFull: + type: object + properties: + CleanURL: + type: boolean + description: True if the URL is clean, false if it is at risk of containing + an SSRF threat or attack + ThreatLevel: + type: string + description: Threat level of the URL; possible values are High, Medium, + Low and None + description: Result of checking a URL for SSRF threats + IPThreatDetectionResponse: + type: object + properties: + IsThreat: + type: boolean + description: True if the input IP address is a threat, false otherwise + ThreatType: + type: string + description: Specifies the type of IP threat; possible values include Blocklist, + Botnet, WebBot + description: Result of performing a IP threat check on an IP address + ThreatDetectionBotCheckResponse: + type: object + properties: + IsBot: + type: boolean + description: True if the input IP address is a Bot or Robot, false otherwise + description: Result of performing a Bot check on an IP address + ThreatDetectionTorNodeResponse: + type: object + properties: + IsTorNode: + type: boolean + description: True if the input IP address is a Tor exit node, false otherwise + description: Result of performing a Tor node check on an IP address + securitySchemes: + Apikey: + type: apiKey + description: API Key Authentication + name: Apikey + in: header diff --git a/openapi/cloudmersive.security/types.bal b/openapi/cloudmersive.security/types.bal new file mode 100644 index 000000000..a8b4b7558 --- /dev/null +++ b/openapi/cloudmersive.security/types.bal @@ -0,0 +1,117 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +# Request to determine if a URL is an SSRF threat check +public type UrlSsrfThreatDetectionRequestFull record { + # URL to validate + string URL?; + # Top level domains that you do not want to allow access to, e.g. mydomain.com - will block all subdomains as well + string[] BlockedDomains?; +}; + +# Result of performing a Bot check on an IP address +public type ThreatDetectionBotCheckResponse record { + # True if the input IP address is a Bot or Robot, false otherwise + boolean IsBot?; +}; + +# Result of performing an Insecure Deserialization JSON protection operation +public type StringInsecureDeserializationJsonDetection record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the input contained Insecure Deserialization JSON, false otherwise + boolean ContainedJsonInsecureDeserializationAttack?; + # Original input string + string OriginalInput?; +}; + +# Result of performing an Insecure Deserialization JSON protection operation +public type StringAutomaticThreatDetection record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the operation is safe, false otherwise + boolean CleanResult?; + # True if the input contained Insecure Deserialization JSON, false otherwise + boolean ContainedJsonInsecureDeserializationAttack?; + # True if the input contained XSS attack, false otherwise + boolean ContainedXssThreat?; + # True if the input contained XXE attack, false otherwise + boolean ContainedXxeThreat?; + # True if the input contained SQL Injection attack, false otherwise + boolean ContainedSqlInjectionThreat?; + # True if the input contained an Server-Side Request Forgery (SSRF) URL attack, false otherwise + boolean ContainedSsrfThreat?; + # True if the input string is XML, false otherwise + boolean IsXML?; + # True if the input string is JSON, false otherwise + boolean IsJSON?; + # True if the input string is a URL, false otherwise + boolean IsURL?; + # Original input string + string OriginalInput?; +}; + +# Result of performing an XXE threat detection operation +public type StringXxeDetectionResult record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the input contained XXE threats, false otherwise + boolean ContainedXxe?; +}; + +# Result of performing a Tor node check on an IP address +public type ThreatDetectionTorNodeResponse record { + # True if the input IP address is a Tor exit node, false otherwise + boolean IsTorNode?; +}; + +# Result of checking a URL for SSRF threats +public type UrlSsrfThreatDetectionResponseFull record { + # True if the URL is clean, false if it is at risk of containing an SSRF threat or attack + boolean CleanURL?; + # Threat level of the URL; possible values are High, Medium, Low and None + string ThreatLevel?; +}; + +# Result of performing a IP threat check on an IP address +public type IPThreatDetectionResponse record { + # True if the input IP address is a threat, false otherwise + boolean IsThreat?; + # Specifies the type of IP threat; possible values include Blocklist, Botnet, WebBot + string ThreatType?; +}; + +# Result of performing an XSS protection operation +public type StringXssProtectionResult record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the input contained XSS scripting, false otherwise + boolean ContainedXss?; + # Original input string + string OriginalInput?; + # Normalized string result, with XSS removed + string NormalizedResult?; +}; + +# Result of performing an SQL Injection protection operation +public type StringSqlInjectionDetectionResult record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the input contained SQL Injection attacks, false otherwise + boolean ContainedSqlInjectionAttack?; + # Original input string + string OriginalInput?; +}; diff --git a/openapi/cloudmersive.validate/.gitignore b/openapi/cloudmersive.validate/.gitignore new file mode 100644 index 000000000..1de565933 --- /dev/null +++ b/openapi/cloudmersive.validate/.gitignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/openapi/cloudmersive.validate/Ballerina.toml b/openapi/cloudmersive.validate/Ballerina.toml new file mode 100644 index 000000000..f3dbc2cc8 --- /dev/null +++ b/openapi/cloudmersive.validate/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +license = ["Apache-2.0"] +keywords = ["Cloudmersive", "validate"] +org = "ballerinax" +name = "cloudmersive.validate" +repository = "https://github.com/ballerina-platform/ballerinax-openapi-connectors" +version = "0.1.0-SNAPSHOT" +authors = ["Ballerina"] +[build-options] +observabilityIncluded = true diff --git a/openapi/cloudmersive.validate/Dependencies.toml b/openapi/cloudmersive.validate/Dependencies.toml new file mode 100644 index 000000000..1d6708b76 --- /dev/null +++ b/openapi/cloudmersive.validate/Dependencies.toml @@ -0,0 +1,11 @@ +[[dependency]] +org = "ballerina" +name = "http" +version = "1.1.0-alpha8" + +[[dependency]] +org = "ballerina" +name = "url" +version = "1.1.0-alpha8" + + diff --git a/openapi/cloudmersive.validate/Module.md b/openapi/cloudmersive.validate/Module.md new file mode 100644 index 000000000..f14bc0731 --- /dev/null +++ b/openapi/cloudmersive.validate/Module.md @@ -0,0 +1,51 @@ +## Overview +Cloudmersive Validate API provide capabilities for validation of data. + +Ballerina connector for Cloudmersive Validate allows easy integration with Cloudmersive Validate REST API via Ballerina language. +It supports functionalities to for email address, phone number, street address VAT number, Domain name and name validation + +This module supports Cloudmersive Validate REST API `v1` version. + +## Prerequisites +* Create a Cloudmersive Account +* Obtaining tokens + 1. [Login to the Cloudmersive account](https://account.cloudmersive.com/login) + 2. [Obtain API keys](https://account.cloudmersive.com/keys) + +## Quickstart +To use the Cloudmersive Validate connector in your Ballerina application, update the .bal file as follows: + +### Step 1: Import cloudmersive.validate module +First, import the ballerinax/cloudmersive.validate module into the Ballerina project. +```ballerina +import ballerinax/cloudmersive.validate; +``` +### Step 2: Configure the connection credentials. +You can now make the connection configuration using the access token. +```ballerina +validate:ApiKeysConfig config = { + apiKeys : { + hapikey : "" + } +}; + +validate:Client baseClient = check new Client(clientConfig); + +``` +### Step 3: Obtain the parsed address + +```ballerina +validate:ParseAddressRequest address = { + AddressString: "Cecilia Chapman 711-2880 Nulla St. Mankato Mississippi 96522 (257) 563-7401", + CapitalizationMode: "UpperCase" +}; + +validate:ParseAddressResponse|error bEvent = baseClient->addressParseString(address); + +if (bEvent is validate:ParseAddressResponse) { + log:printInfo("Parsed address: " + bEvent.toString()); +} else { + log:printError(msg = bEvent.toString()); +} + +``` \ No newline at end of file diff --git a/openapi/cloudmersive.validate/Package.md b/openapi/cloudmersive.validate/Package.md new file mode 100644 index 000000000..e5ef1317f --- /dev/null +++ b/openapi/cloudmersive.validate/Package.md @@ -0,0 +1,17 @@ +Connects to Cloudmersive Validate API from Ballerina + +## Package overview + +The `ballerinax/cloudmersive.validate` is a [Ballerina](https://ballerina.io/) connector for connecting to Cloudmersive Validate API. +### Compatibility +| | Version | +|:------------------------:|:--------------------------:| +| Ballerina Language | Ballerina Swan Lake Beta2 | +| Cloudmersive API | v1 | + +## Report issues +To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina connector repository](https://github.com/ballerina-platform/ballerinax-openapi-connectors) +## Useful links +- Discuss code changes of the Ballerina project in [ballerina-dev@googlegroups.com](mailto:ballerina-dev@googlegroups.com). +- Chat live with us via our [Slack channel](https://ballerina.io/community/slack/). +- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag diff --git a/openapi/cloudmersive.validate/client.bal b/openapi/cloudmersive.validate/client.bal new file mode 100644 index 000000000..9edbc14d1 --- /dev/null +++ b/openapi/cloudmersive.validate/client.bal @@ -0,0 +1,852 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; + +# Please visit [here](https://account.cloudmersive.com/keys) to get more information on obtaining API key +# +# + apiKeys - Provide your API Key as `Apikey`. Eg: `{"Apikey" : "}`" +public type ApiKeysConfig record { + map apiKeys; +}; + +# The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API. +# +# + clientEp - Connector http endpoint +public client class Client { + http:Client clientEp; + map apiKeys; + # Client initialization. + # + # + apiKeyConfig - API key configuration detail + # + clientConfig - Client configuration details + # + serviceUrl - Connector server URL + # + return - Error at failure of client initialization + public isolated function init(ApiKeysConfig apiKeyConfig, http:ClientConfiguration clientConfig = {}, string serviceUrl = "https://testapi.cloudmersive.com/") returns error? { + http:Client httpEp = check new (serviceUrl, clientConfig); + self.clientEp = httpEp; + self.apiKeys = apiKeyConfig.apiKeys; + } + # Parse an unstructured input text string into an international, formatted address + # + # + payload - Input parse request + # + return - OK + remote isolated function addressParseString(ParseAddressRequest payload) returns ParseAddressResponse|error { + string path = string `/validate/address/parse`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ParseAddressResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ParseAddressResponse); + return response; + } + # Validate a street address + # + # + payload - Input parse request + # + return - OK + remote isolated function addressValidateAddress(ValidateAddressRequest payload) returns ValidateAddressResponse|error { + string path = string `/validate/address/street-address`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateAddressResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateAddressResponse); + return response; + } + # Normalize a street address + # + # + payload - Input parse request + # + return - OK + remote isolated function addressNormalizeAddress(ValidateAddressRequest payload) returns NormalizeAddressResponse|error { + string path = string `/validate/address/street-address/normalize`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + NormalizeAddressResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=NormalizeAddressResponse); + return response; + } + # Validate a City and State/Province combination, get location information about it + # + # + payload - Input parse request + # + return - OK + remote isolated function addressValidateCity(ValidateCityRequest payload) returns ValidateCityResponse|error { + string path = string `/validate/address/city`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateCityResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateCityResponse); + return response; + } + # Validate a state or province, name or abbreviation, get location information about it + # + # + payload - Input parse request + # + return - OK + remote isolated function addressValidateState(ValidateStateRequest payload) returns ValidateStateResponse|error { + string path = string `/validate/address/state`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateStateResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateStateResponse); + return response; + } + # Validate a postal code, get location information about it + # + # + payload - Input parse request + # + return - OK + remote isolated function addressValidatePostalCode(ValidatePostalCodeRequest payload) returns ValidatePostalCodeResponse|error { + string path = string `/validate/address/postal-code`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidatePostalCodeResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidatePostalCodeResponse); + return response; + } + # Validate and normalize country information, return ISO 3166-1 country codes and country name + # + # + payload - Input request + # + return - OK + remote isolated function addressCountry(ValidateCountryRequest payload) returns ValidateCountryResponse|error { + string path = string `/validate/address/country`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateCountryResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateCountryResponse); + return response; + } + # Get a list of ISO 3166-1 countries + # + # + return - OK + remote isolated function addressCountryList() returns CountryListResult|error { + string path = string `/validate/address/country/list`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + //TODO: Update the request as needed; + CountryListResult response = check self.clientEp-> post(path, request, headers = accHeaders, targetType = CountryListResult); + return response; + } + # Check if a country is a member of the European Union (EU) + # + # + payload - Input request + # + return - OK + remote isolated function addressCheckEumembership(ValidateCountryRequest payload) returns ValidateCountryResponse|error { + string path = string `/validate/address/country/check-eu-membership`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateCountryResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateCountryResponse); + return response; + } + # Get the currency of the input country + # + # + payload - Input request + # + return - OK + remote isolated function addressGetCountryCurrency(ValidateCountryRequest payload) returns ValidateCountryResponse|error { + string path = string `/validate/address/country/get-currency`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateCountryResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateCountryResponse); + return response; + } + # Get the region, subregion and continent of the country + # + # + payload - Input request + # + return - OK + remote isolated function addressGetCountryRegion(ValidateCountryRequest payload) returns ValidateCountryResponse|error { + string path = string `/validate/address/country/get-region`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateCountryResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateCountryResponse); + return response; + } + # Gets IANA/Olsen time zones for a country + # + # + payload - Input request + # + return - OK + remote isolated function addressGetTimezone(GetTimezonesRequest payload) returns GetTimezonesResponse|error { + string path = string `/validate/address/country/get-timezones`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + GetTimezonesResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=GetTimezonesResponse); + return response; + } + # Geocode a street address into latitude and longitude + # + # + payload - Input parse request + # + return - OK + remote isolated function addressGeocode(ValidateAddressRequest payload) returns ValidateAddressResponse|error { + string path = string `/validate/address/geocode`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateAddressResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateAddressResponse); + return response; + } + # Reverse geocode a lattitude and longitude into an address + # + # + payload - Input reverse geocoding request + # + return - OK + remote isolated function addressReverseGeocodeAddress(ReverseGeocodeAddressRequest payload) returns ReverseGeocodeAddressResponse|error { + string path = string `/validate/address/geocode/reverse`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ReverseGeocodeAddressResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ReverseGeocodeAddressResponse); + return response; + } + # Get current date and time as of now + # + # + return - OK + remote isolated function dateTimeGetNowSimple() returns DateTimeNowResult|error { + string path = string `/validate/date-time/get/now`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + DateTimeNowResult response = check self.clientEp-> get(path, accHeaders, targetType = DateTimeNowResult); + return response; + } + # Get public holidays in the specified country and year + # + # + payload - Input request + # + return - OK + remote isolated function dateTimeGetPublicHolidays(GetPublicHolidaysRequest payload) returns PublicHolidaysResponse|error { + string path = string `/validate/date-time/get/holidays`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + PublicHolidaysResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=PublicHolidaysResponse); + return response; + } + # Parses a standardized date and time string into a date and time + # + # + payload - Input request + # + return - OK + remote isolated function dateTimeParseStandardDateTime(DateTimeStandardizedParseRequest payload) returns DateTimeStandardizedParseResponse|error { + string path = string `/validate/date-time/parse/date-time/structured`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + DateTimeStandardizedParseResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=DateTimeStandardizedParseResponse); + return response; + } + # Parses a free-form natural language date and time string into a date and time + # + # + payload - Input request + # + return - OK + remote isolated function dateTimeParseNaturalLanguageDateTime(DateTimeNaturalLanguageParseRequest payload) returns DateTimeStandardizedParseResponse|error { + string path = string `/validate/date-time/parse/date-time/natural-language`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + DateTimeStandardizedParseResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=DateTimeStandardizedParseResponse); + return response; + } + # Validate a domain name + # + # + payload - Domain name to check, for example "cloudmersive.com". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function domainCheck(string payload) returns CheckResponse|error { + string path = string `/validate/domain/check`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + CheckResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=CheckResponse); + return response; + } + # Validate a domain name's quality score + # + # + payload - Domain name to check, for example "cloudmersive.com". + # + return - OK + remote isolated function domainQualityScore(string payload) returns DomainQualityResponse|error { + string path = string `/validate/domain/quality-score`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + DomainQualityResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=DomainQualityResponse); + return response; + } + # Get WHOIS information for a domain + # + # + payload - Domain name to check, for example "cloudmersive.com". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function domainPost(string payload) returns WhoisResponse|error { + string path = string `/validate/domain/whois`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + WhoisResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=WhoisResponse); + return response; + } + # Validate a URL syntactically + # + # + payload - Input URL information + # + return - OK + remote isolated function domainUrlSyntaxOnly(ValidateUrlRequestSyntaxOnly payload) returns ValidateUrlResponseSyntaxOnly|error { + string path = string `/validate/domain/url/syntax-only`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateUrlResponseSyntaxOnly response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateUrlResponseSyntaxOnly); + return response; + } + # Validate a URL fully + # + # + payload - Input URL request + # + return - OK + remote isolated function domainUrlFull(ValidateUrlRequestFull payload) returns ValidateUrlResponseFull|error { + string path = string `/validate/domain/url/full`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateUrlResponseFull response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateUrlResponseFull); + return response; + } + # Get top-level domain name from URL + # + # + payload - Input URL information + # + return - OK + remote isolated function domainGetTopLevelDomainFromUrl(ValidateUrlRequestSyntaxOnly payload) returns ValidateUrlResponseSyntaxOnly|error { + string path = string `/validate/domain/url/get-top-level-domain`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateUrlResponseSyntaxOnly response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateUrlResponseSyntaxOnly); + return response; + } + # Check a URL for Phishing threats + # + # + payload - Input URL request + # + return - OK + remote isolated function domainPhishingCheck(PhishingCheckRequest payload) returns PhishingCheckResponse|error { + string path = string `/validate/domain/url/phishing-threat-check`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + PhishingCheckResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=PhishingCheckResponse); + return response; + } + # Check if path is a high-risk or vulnerable server administration path + # + # + payload - URL or relative path to check, e.g. "/admin/login". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function domainIsAdminPath(string payload) returns IsAdminPathResponse|error { + string path = string `/validate/domain/url/is-admin-path`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + IsAdminPathResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=IsAdminPathResponse); + return response; + } + # Check a URL for safety threats + # + # + payload - Input URL request + # + return - OK + remote isolated function domainSafetyCheck(UrlSafetyCheckRequestFull payload) returns UrlSafetyCheckResponseFull|error { + string path = string `/validate/domain/url/safety-threat-check`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + UrlSafetyCheckResponseFull response = check self.clientEp->post(path, request, headers = accHeaders, targetType=UrlSafetyCheckResponseFull); + return response; + } + # Check a URL for SSRF threats + # + # + payload - Input URL request + # + return - OK + remote isolated function domainSsrfCheck(UrlSsrfRequestFull payload) returns UrlSsrfResponseFull|error { + string path = string `/validate/domain/url/ssrf-threat-check`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + UrlSsrfResponseFull response = check self.clientEp->post(path, request, headers = accHeaders, targetType=UrlSsrfResponseFull); + return response; + } + # Check a URL for SSRF threats in batches + # + # + payload - Input URL request as a batch of multiple URLs + # + return - OK + remote isolated function domainSsrfCheckBatch(UrlSsrfRequestBatch payload) returns UrlSsrfResponseBatch|error { + string path = string `/validate/domain/url/ssrf-threat-check/batch`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + UrlSsrfResponseBatch response = check self.clientEp->post(path, request, headers = accHeaders, targetType=UrlSsrfResponseBatch); + return response; + } + # Check a URL for HTML embedded SSRF threats + # + # + payload - Input URL request + # + return - OK + remote isolated function domainUrlHtmlSsrfCheck(UrlHtmlSsrfRequestFull payload) returns UrlHtmlSsrfResponseFull|error { + string path = string `/validate/domain/url/ssrf-threat-check/html-embedded`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + UrlHtmlSsrfResponseFull response = check self.clientEp->post(path, request, headers = accHeaders, targetType=UrlHtmlSsrfResponseFull); + return response; + } + # Validate email adddress for syntactic correctness only + # + # + payload - Email address to validate, e.g. "support@cloudmersive.com". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function emailPost(string payload) returns AddressVerifySyntaxOnlyResponse|error { + string path = string `/validate/email/address/syntaxOnly`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + AddressVerifySyntaxOnlyResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=AddressVerifySyntaxOnlyResponse); + return response; + } + # Partially check whether an email address is valid + # + # + payload - Email address to validate, e.g. "support@cloudmersive.com". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function emailAddressGetServers(string payload) returns AddressGetServersResponse|error { + string path = string `/validate/email/address/servers`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + AddressGetServersResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=AddressGetServersResponse); + return response; + } + # Fully validate an email address + # + # + payload - Email address to validate, e.g. "support@cloudmersive.com". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function emailFullValidation(string payload) returns FullEmailValidationResponse|error { + string path = string `/validate/email/address/full`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + FullEmailValidationResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=FullEmailValidationResponse); + return response; + } + # Get intelligence on an IP address + # + # + payload - IP address to process, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function ipaddressIpIntelligence(string payload) returns IPIntelligenceResponse|error { + string path = string `/validate/ip/intelligence`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + IPIntelligenceResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=IPIntelligenceResponse); + return response; + } + # Geolocate an IP address + # + # + payload - IP address to geolocate, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function ipaddressPost(string payload) returns GeolocateResponse|error { + string path = string `/validate/ip/geolocate`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + GeolocateResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=GeolocateResponse); + return response; + } + # Geolocate an IP address to a street address + # + # + payload - IP address to geolocate, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function ipaddressGeolocateStreetAddress(string payload) returns GeolocateStreetAddressResponse|error { + string path = string `/validate/ip/geolocate/street-address`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + GeolocateStreetAddressResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=GeolocateStreetAddressResponse); + return response; + } + # Check if IP address is a known threat + # + # + payload - IP address to check, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function ipaddressIsThreat(string payload) returns IPThreatResponse|error { + string path = string `/validate/ip/is-threat`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + IPThreatResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=IPThreatResponse); + return response; + } + # Check if IP address is a Tor node server + # + # + payload - IP address to check, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function ipaddressIsTorNode(string payload) returns TorNodeResponse|error { + string path = string `/validate/ip/is-tor-node`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + TorNodeResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=TorNodeResponse); + return response; + } + # Check if IP address is a Bot client + # + # + payload - IP address to check, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function ipaddressIsBot(string payload) returns BotCheckResponse|error { + string path = string `/validate/ip/is-bot`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + BotCheckResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=BotCheckResponse); + return response; + } + # Perform a reverse domain name (DNS) lookup on an IP address + # + # + payload - IP address to check, e.g. "55.55.55.55". The input is a string so be sure to enclose it in double-quotes. + # + return - OK + remote isolated function ipaddressReverseDomainLookup(string payload) returns IPReverseDNSLookupResponse|error { + string path = string `/validate/ip/reverse-domain-lookup`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + IPReverseDNSLookupResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=IPReverseDNSLookupResponse); + return response; + } + # Enrich an input lead with additional fields of data + # + # + payload - Input lead with known fields set, and unknown fields left blank (null) + # + return - OK + remote isolated function leadEnrichmentEnrichLead(LeadEnrichmentRequest payload) returns LeadEnrichmentResponse|error { + string path = string `/validate/lead-enrichment/lead/enrich`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + LeadEnrichmentResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=LeadEnrichmentResponse); + return response; + } + # Parse and validate a full name + # + # + payload - Validation request information + # + return - OK + remote isolated function nameValidateFullName(FullNameValidationRequest payload) returns FullNameValidationResponse|error { + string path = string `/validate/name/full-name`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + FullNameValidationResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=FullNameValidationResponse); + return response; + } + # Validate a first name + # + # + payload - Validation request information + # + return - OK + remote isolated function nameValidateFirstName(FirstNameValidationRequest payload) returns FirstNameValidationResponse|error { + string path = string `/validate/name/first`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + FirstNameValidationResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=FirstNameValidationResponse); + return response; + } + # Validate a last name + # + # + payload - Validation request information + # + return - OK + remote isolated function nameValidateLastName(LastNameValidationRequest payload) returns LastNameValidationResponse|error { + string path = string `/validate/name/last`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + LastNameValidationResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=LastNameValidationResponse); + return response; + } + # Get the gender of a first name + # + # + payload - Gender request information + # + return - OK + remote isolated function nameGetGender(GetGenderRequest payload) returns GetGenderResponse|error { + string path = string `/validate/name/get-gender`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + GetGenderResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=GetGenderResponse); + return response; + } + # Validate a code identifier + # + # + payload - Identifier validation request information + # + return - OK + remote isolated function nameIdentifier(ValidateIdentifierRequest payload) returns ValidateIdentifierResponse|error { + string path = string `/validate/name/identifier`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + ValidateIdentifierResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ValidateIdentifierResponse); + return response; + } + # Validate phone number (basic) + # + # + payload - Phone number to validate in a PhoneNumberValidateRequest object. Try a phone number such as "1.800.463.3339", and either leave DefaultCountryCode blank or use "US". + # + return - OK + remote isolated function phoneNumberSyntaxOnly(PhoneNumberValidateRequest payload) returns PhoneNumberValidationResponse|error { + string path = string `/validate/phonenumber/basic`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + PhoneNumberValidationResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=PhoneNumberValidationResponse); + return response; + } + # Check text input for SQL Injection (SQLI) attacks + # + # + payload - User-facing text input. + # + detectionLevel - Set to Normal to target a high-security SQL Injection detection level with a very low false positive rate; select High to target a very-high security SQL Injection detection level with higher false positives. Default is Normal (recommended). + # + return - OK + remote isolated function textInputCheckSqlInjection(string payload, string? detectionLevel = ()) returns SqlInjectionDetectionResult|error { + string path = string `/validate/text-input/check/sql-injection`; + map headerValues = {"detectionLevel": detectionLevel, Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + SqlInjectionDetectionResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=SqlInjectionDetectionResult); + return response; + } + # Check and protect multiple text inputs for SQL Injection (SQLI) attacks in batch + # + # + payload - User-facing text input. + # + return - OK + remote isolated function textInputCheckSqlInjectionBatch(SqlInjectionCheckBatchRequest payload) returns SqlInjectionCheckBatchResponse|error { + string path = string `/validate/text-input/check/sql-injection/batch`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + SqlInjectionCheckBatchResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=SqlInjectionCheckBatchResponse); + return response; + } + # Check text input for Cross-Site-Scripting (XSS) attacks + # + # + payload - User-facing text input. + # + return - OK + remote isolated function textInputCheckXss(string payload) returns XssProtectionResult|error { + string path = string `/validate/text-input/check/xss`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + XssProtectionResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=XssProtectionResult); + return response; + } + # Protect text input from Cross-Site-Scripting (XSS) attacks through normalization + # + # + payload - User-facing text input. + # + return - OK + remote isolated function textInputProtectXss(string payload) returns XssProtectionResult|error { + string path = string `/validate/text-input/protect/xss`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + XssProtectionResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=XssProtectionResult); + return response; + } + # Check and protect multiple text inputs for Cross-Site-Scripting (XSS) attacks in batch + # + # + payload - User-facing text input. + # + return - OK + remote isolated function textInputCheckXssBatch(XssProtectionBatchRequest payload) returns XssProtectionBatchResponse|error { + string path = string `/validate/text-input/check-and-protect/xss/batch`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + XssProtectionBatchResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=XssProtectionBatchResponse); + return response; + } + # Protect html input from Server-side Request Forgery (SSRF) attacks + # + # + payload - User-facing HTML input. + # + return - OK + remote isolated function textInputCheckHtmlSsrf(string payload) returns HtmlSsrfDetectionResult|error { + string path = string `/validate/text-input/html/check/ssrf`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + HtmlSsrfDetectionResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=HtmlSsrfDetectionResult); + return response; + } + # Protect text input from XML External Entity (XXE) attacks + # + # + payload - User-facing text input. + # + allowInternetUrls - Optional: Set to true to allow Internet-based dependency URLs for DTDs and other XML External Entitites, set to false to block. Default is false. + # + knownSafeUrls - Optional: Comma separated list of fully-qualified URLs that will automatically be considered safe. + # + knownUnsafeUrls - Optional: Comma separated list of fully-qualified URLs that will automatically be considered unsafe. + # + return - OK + remote isolated function textInputCheckXxe(string payload, boolean? allowInternetUrls = (), string? knownSafeUrls = (), string? knownUnsafeUrls = ()) returns XxeDetectionResult|error { + string path = string `/validate/text-input/check/xxe`; + map headerValues = {"allowInternetUrls": allowInternetUrls, "knownSafeUrls": knownSafeUrls, "knownUnsafeUrls": knownUnsafeUrls, Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + XxeDetectionResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=XxeDetectionResult); + return response; + } + # Protect text input from XML External Entity (XXE) attacks + # + payload - Input to a batch XXE detection operation + # + return - OK + remote isolated function textInputCheckXxeBatch(XxeDetectionBatchRequest payload) returns XxeDetectionBatchResponse|error { + string path = string `/validate/text-input/check/xxe/batch`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + XxeDetectionBatchResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=XxeDetectionBatchResponse); + return response; + } + # Parse an HTTP User-Agent string, identify robots + # + # + payload - Input parse request + # + return - OK + remote isolated function userAgentParse(UserAgentValidateRequest payload) returns UserAgentValidateResponse|error { + string path = string `/validate/useragent/parse`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + UserAgentValidateResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=UserAgentValidateResponse); + return response; + } + # Validate a VAT number + # + # + payload - Input VAT code + # + return - OK + remote isolated function vatVatLookup(VatLookupRequest payload) returns VatLookupResponse|error { + string path = string `/validate/vat/lookup`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + VatLookupResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=VatLookupResponse); + return response; + } +} + +# Generate header map for given header values. +# +# + headerParam - Headers map +# + return - Returns generated map or error at failure of client initialization +isolated function getMapForHeaders(map headerParam) returns map { + map headerMap = {}; + foreach var [key, value] in headerParam.entries() { + if value is string || value is string[] { + headerMap[key] = value; + } + } + return headerMap; +} diff --git a/openapi/cloudmersive.validate/openapi.yaml b/openapi/cloudmersive.validate/openapi.yaml new file mode 100644 index 000000000..84f30de1e --- /dev/null +++ b/openapi/cloudmersive.validate/openapi.yaml @@ -0,0 +1,3793 @@ +openapi: 3.0.1 +info: + title: validateapi + description: The validation APIs help you validate data. Check if an E-mail address + is real. Check if a domain is real. Check up on an IP address, and even where + it is located. All this and much more is available in the validation API. + version: v1 +servers: +- url: https://testapi.cloudmersive.com/ +paths: + /validate/address/parse: + post: + tags: + - Address + summary: Parse an unstructured input text string into an international, formatted + address + description: Uses machine learning and Natural Language Processing (NLP) to + handle a wide array of cases, including non-standard and unstructured address + strings across a wide array of countries and address formatting norms. + operationId: Address_Parse String + requestBody: + description: Input parse request + content: + application/json: + schema: + $ref: '#/components/schemas/ParseAddressRequest' + text/json: + schema: + $ref: '#/components/schemas/ParseAddressRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ParseAddressResponse' + text/json: + schema: + $ref: '#/components/schemas/ParseAddressResponse' + application/xml: + schema: + $ref: '#/components/schemas/ParseAddressResponse' + text/xml: + schema: + $ref: '#/components/schemas/ParseAddressResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/street-address: + post: + tags: + - Address + summary: Validate a street address + description: Determines if an input structured street address is valid or invalid. If + the address is valid, also returns the latitude and longitude of the address. Supports + all major international addresses. + operationId: Address_Validate Address + requestBody: + description: Input parse request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateAddressRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateAddressRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateAddressResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidateAddressResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidateAddressResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidateAddressResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/street-address/normalize: + post: + tags: + - Address + summary: Normalize a street address + description: Normalizes an input structured street address is valid or invalid. If + the address is valid, also returns the latitude and longitude of the address. Supports + all major international addresses. + operationId: Address_Normalize Address + requestBody: + description: Input parse request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateAddressRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateAddressRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NormalizeAddressResponse' + text/json: + schema: + $ref: '#/components/schemas/NormalizeAddressResponse' + application/xml: + schema: + $ref: '#/components/schemas/NormalizeAddressResponse' + text/xml: + schema: + $ref: '#/components/schemas/NormalizeAddressResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/city: + post: + tags: + - Address + summary: Validate a City and State/Province combination, get location information + about it + description: Checks if the input city and state name or code is valid, and returns + information about it such as normalized City name, State name and more. Supports + all major international addresses. + operationId: Address_Validate City + requestBody: + description: Input parse request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCityRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateCityRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCityResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidateCityResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidateCityResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidateCityResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/state: + post: + tags: + - Address + summary: Validate a state or province, name or abbreviation, get location information + about it + description: Checks if the input state name or code is valid, and returns information + about it such as normalized State name and more. Supports all major countries. + operationId: Address_Validate State + requestBody: + description: Input parse request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateStateRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateStateRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateStateResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidateStateResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidateStateResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidateStateResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/postal-code: + post: + tags: + - Address + summary: Validate a postal code, get location information about it + description: Checks if the input postal code is valid, and returns information + about it such as City, State and more. Supports all major countries. + operationId: Address_Validate Postal Code + requestBody: + description: Input parse request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidatePostalCodeRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidatePostalCodeRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidatePostalCodeResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidatePostalCodeResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidatePostalCodeResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidatePostalCodeResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/country: + post: + tags: + - Address + summary: Validate and normalize country information, return ISO 3166-1 country + codes and country name + description: Validates and normalizes country information, and returns key information + about a country, as well as whether it is a member of the European Union. Also + returns distinct time zones in the country. + operationId: Address_Country + requestBody: + description: Input request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCountryRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateCountryRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/country/list: + post: + tags: + - Address + summary: Get a list of ISO 3166-1 countries + description: Enumerates the list of ISO 3166-1 countries, including name, country + codes, and more. + operationId: Address_Country List + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CountryListResult' + text/json: + schema: + $ref: '#/components/schemas/CountryListResult' + application/xml: + schema: + $ref: '#/components/schemas/CountryListResult' + text/xml: + schema: + $ref: '#/components/schemas/CountryListResult' + security: + - Apikey: [] + /validate/address/country/check-eu-membership: + post: + tags: + - Address + summary: Check if a country is a member of the European Union (EU) + description: Checks if the input country is a member of the European Union or + not. + operationId: Address_Check EUMembership + requestBody: + description: Input request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCountryRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateCountryRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/country/get-currency: + post: + tags: + - Address + summary: Get the currency of the input country + description: Gets the currency information for the input country, including + the ISO three-letter country code, currency symbol, and English currency name. + operationId: Address_Get Country Currency + requestBody: + description: Input request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCountryRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateCountryRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/country/get-region: + post: + tags: + - Address + summary: Get the region, subregion and continent of the country + description: Gets the continent information including region and subregion for + the input country. + operationId: Address_Get Country Region + requestBody: + description: Input request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCountryRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateCountryRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidateCountryResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/country/get-timezones: + post: + tags: + - Address + summary: Gets IANA/Olsen time zones for a country + description: Gets the IANA/Olsen time zones for a country. + operationId: Address_Get Timezone + requestBody: + description: Input request + content: + application/json: + schema: + $ref: '#/components/schemas/GetTimezonesRequest' + text/json: + schema: + $ref: '#/components/schemas/GetTimezonesRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetTimezonesResponse' + text/json: + schema: + $ref: '#/components/schemas/GetTimezonesResponse' + application/xml: + schema: + $ref: '#/components/schemas/GetTimezonesResponse' + text/xml: + schema: + $ref: '#/components/schemas/GetTimezonesResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/geocode: + post: + tags: + - Address + summary: Geocode a street address into latitude and longitude + description: Geocodes a street address into latitude and longitude. + operationId: Address_Geocode + requestBody: + description: Input parse request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateAddressRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateAddressRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateAddressResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidateAddressResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidateAddressResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidateAddressResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/address/geocode/reverse: + post: + tags: + - Address + summary: Reverse geocode a lattitude and longitude into an address + description: Converts lattitude and longitude coordinates into an address through + reverse-geocoding. + operationId: Address_Reverse Geocode Address + requestBody: + description: Input reverse geocoding request + content: + application/json: + schema: + $ref: '#/components/schemas/ReverseGeocodeAddressRequest' + text/json: + schema: + $ref: '#/components/schemas/ReverseGeocodeAddressRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ReverseGeocodeAddressResponse' + text/json: + schema: + $ref: '#/components/schemas/ReverseGeocodeAddressResponse' + application/xml: + schema: + $ref: '#/components/schemas/ReverseGeocodeAddressResponse' + text/xml: + schema: + $ref: '#/components/schemas/ReverseGeocodeAddressResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/date-time/get/now: + get: + tags: + - DateTime + summary: Get current date and time as of now + description: Gets the current date and time. Response time is syncronized with + atomic clocks, and represents a monotonic, centrally available, consistent + clock. + operationId: Date Time_Get Now Simple + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DateTimeNowResult' + text/json: + schema: + $ref: '#/components/schemas/DateTimeNowResult' + application/xml: + schema: + $ref: '#/components/schemas/DateTimeNowResult' + text/xml: + schema: + $ref: '#/components/schemas/DateTimeNowResult' + security: + - Apikey: [] + /validate/date-time/get/holidays: + post: + tags: + - DateTime + summary: Get public holidays in the specified country and year + description: Enumerates all public holidays in a given country for a given year. Supports + over 100 countries. + operationId: Date Time_Get Public Holidays + requestBody: + description: Input request + content: + application/json: + schema: + $ref: '#/components/schemas/GetPublicHolidaysRequest' + text/json: + schema: + $ref: '#/components/schemas/GetPublicHolidaysRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PublicHolidaysResponse' + text/json: + schema: + $ref: '#/components/schemas/PublicHolidaysResponse' + application/xml: + schema: + $ref: '#/components/schemas/PublicHolidaysResponse' + text/xml: + schema: + $ref: '#/components/schemas/PublicHolidaysResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/date-time/parse/date-time/structured: + post: + tags: + - DateTime + summary: Parses a standardized date and time string into a date and time + description: Parses a structured date and time string into a date time object. This + is intended for standardized date strings that adhere to formatting conventions, + rather than natural language input. + operationId: Date Time_Parse Standard Date Time + requestBody: + description: Input request + content: + application/json: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseRequest' + text/json: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseResponse' + text/json: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseResponse' + application/xml: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseResponse' + text/xml: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/date-time/parse/date-time/natural-language: + post: + tags: + - DateTime + summary: Parses a free-form natural language date and time string into a date + and time + description: Parses an unstructured, free-form, natural language date and time + string into a date time object. This is intended for lightweight human-entered + input, such as "tomorrow at 3pm" or "tuesday". + operationId: Date Time_Parse Natural Language Date Time + requestBody: + description: Input request + content: + application/json: + schema: + $ref: '#/components/schemas/DateTimeNaturalLanguageParseRequest' + text/json: + schema: + $ref: '#/components/schemas/DateTimeNaturalLanguageParseRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseResponse' + text/json: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseResponse' + application/xml: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseResponse' + text/xml: + schema: + $ref: '#/components/schemas/DateTimeStandardizedParseResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/domain/check: + post: + tags: + - Domain + summary: Validate a domain name + description: Check whether a domain name is valid or not. API performs a live + validation by contacting DNS services to validate the existence of the domain + name. + operationId: Domain_Check + requestBody: + description: Domain name to check, for example "cloudmersive.com". The input + is a string so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CheckResponse' + text/json: + schema: + $ref: '#/components/schemas/CheckResponse' + application/xml: + schema: + $ref: '#/components/schemas/CheckResponse' + text/xml: + schema: + $ref: '#/components/schemas/CheckResponse' + security: + - Apikey: [] + x-codegen-request-body-name: domain + /validate/domain/quality-score: + post: + tags: + - Domain + summary: Validate a domain name's quality score + description: Check the quality of a domain name. Supports over 9 million domain + names. Higher quality scores indicate more trust and authority in the domain + name, with values ranging from 0.0 (low quality) to 10.0 (maximum quality). + operationId: Domain_Quality Score + requestBody: + description: Domain name to check, for example "cloudmersive.com". + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DomainQualityResponse' + text/json: + schema: + $ref: '#/components/schemas/DomainQualityResponse' + application/xml: + schema: + $ref: '#/components/schemas/DomainQualityResponse' + text/xml: + schema: + $ref: '#/components/schemas/DomainQualityResponse' + security: + - Apikey: [] + x-codegen-request-body-name: domain + /validate/domain/whois: + post: + tags: + - Domain + summary: Get WHOIS information for a domain + description: Validate whether a domain name exists, and also return the full + WHOIS record for that domain name. WHOIS records include all the registration + details of the domain name, such as information about the domain's owners. + operationId: Domain_Post + requestBody: + description: Domain name to check, for example "cloudmersive.com". The input + is a string so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/WhoisResponse' + text/json: + schema: + $ref: '#/components/schemas/WhoisResponse' + application/xml: + schema: + $ref: '#/components/schemas/WhoisResponse' + text/xml: + schema: + $ref: '#/components/schemas/WhoisResponse' + security: + - Apikey: [] + x-codegen-request-body-name: domain + /validate/domain/url/syntax-only: + post: + tags: + - Domain + summary: Validate a URL syntactically + description: Validate whether a URL is syntactically valid (does not check endpoint + for validity). Accepts various types of input and produces a well-formed + URL as output. + operationId: Domain_Url Syntax Only + requestBody: + description: Input URL information + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateUrlRequestSyntaxOnly' + text/json: + schema: + $ref: '#/components/schemas/ValidateUrlRequestSyntaxOnly' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateUrlResponseSyntaxOnly' + text/json: + schema: + $ref: '#/components/schemas/ValidateUrlResponseSyntaxOnly' + application/xml: + schema: + $ref: '#/components/schemas/ValidateUrlResponseSyntaxOnly' + text/xml: + schema: + $ref: '#/components/schemas/ValidateUrlResponseSyntaxOnly' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/domain/url/full: + post: + tags: + - Domain + summary: Validate a URL fully + description: Validate whether a URL is syntactically valid (does not check endpoint + for validity), whether it exists, and whether the endpoint is up and passes + virus scan checks. Accepts various types of input and produces a well-formed + URL as output. + operationId: Domain_Url Full + requestBody: + description: Input URL request + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateUrlRequestFull' + text/json: + schema: + $ref: '#/components/schemas/ValidateUrlRequestFull' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateUrlResponseFull' + text/json: + schema: + $ref: '#/components/schemas/ValidateUrlResponseFull' + application/xml: + schema: + $ref: '#/components/schemas/ValidateUrlResponseFull' + text/xml: + schema: + $ref: '#/components/schemas/ValidateUrlResponseFull' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/domain/url/get-top-level-domain: + post: + tags: + - Domain + summary: Get top-level domain name from URL + description: Gets the top-level domain name from a URL, such as mydomain.com. + operationId: Domain_Get Top Level Domain From Url + requestBody: + description: Input URL information + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateUrlRequestSyntaxOnly' + text/json: + schema: + $ref: '#/components/schemas/ValidateUrlRequestSyntaxOnly' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateUrlResponseSyntaxOnly' + text/json: + schema: + $ref: '#/components/schemas/ValidateUrlResponseSyntaxOnly' + application/xml: + schema: + $ref: '#/components/schemas/ValidateUrlResponseSyntaxOnly' + text/xml: + schema: + $ref: '#/components/schemas/ValidateUrlResponseSyntaxOnly' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/domain/url/phishing-threat-check: + post: + tags: + - Domain + summary: Check a URL for Phishing threats + description: Checks if an input URL is at risk of being an Phishing (fake login + page, or other page designed to collect information via social engineering) + threat or attack. + operationId: Domain_Phishing Check + requestBody: + description: Input URL request + content: + application/json: + schema: + $ref: '#/components/schemas/PhishingCheckRequest' + text/json: + schema: + $ref: '#/components/schemas/PhishingCheckRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PhishingCheckResponse' + text/json: + schema: + $ref: '#/components/schemas/PhishingCheckResponse' + application/xml: + schema: + $ref: '#/components/schemas/PhishingCheckResponse' + text/xml: + schema: + $ref: '#/components/schemas/PhishingCheckResponse' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/domain/url/is-admin-path: + post: + tags: + - Domain + summary: Check if path is a high-risk or vulnerable server administration path + description: Check if the input URL or relative path is a server Administration + Path, and therefore a risk or vulnerability for remote access. + operationId: Domain_Is Admin Path + requestBody: + description: URL or relative path to check, e.g. "/admin/login". The input + is a string so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IsAdminPathResponse' + text/json: + schema: + $ref: '#/components/schemas/IsAdminPathResponse' + application/xml: + schema: + $ref: '#/components/schemas/IsAdminPathResponse' + text/xml: + schema: + $ref: '#/components/schemas/IsAdminPathResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/domain/url/safety-threat-check: + post: + tags: + - Domain + summary: Check a URL for safety threats + description: Checks if an input URL is at risk of being a safety threat through + malware, unwanted software, or social engineering threats. + operationId: Domain_Safety Check + requestBody: + description: Input URL request + content: + application/json: + schema: + $ref: '#/components/schemas/UrlSafetyCheckRequestFull' + text/json: + schema: + $ref: '#/components/schemas/UrlSafetyCheckRequestFull' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UrlSafetyCheckResponseFull' + text/json: + schema: + $ref: '#/components/schemas/UrlSafetyCheckResponseFull' + application/xml: + schema: + $ref: '#/components/schemas/UrlSafetyCheckResponseFull' + text/xml: + schema: + $ref: '#/components/schemas/UrlSafetyCheckResponseFull' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/domain/url/ssrf-threat-check: + post: + tags: + - Domain + summary: Check a URL for SSRF threats + description: Checks if an input URL is at risk of being an SSRF (Server-side + request forgery) threat or attack. + operationId: Domain_Ssrf Check + requestBody: + description: Input URL request + content: + application/json: + schema: + $ref: '#/components/schemas/UrlSsrfRequestFull' + text/json: + schema: + $ref: '#/components/schemas/UrlSsrfRequestFull' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UrlSsrfResponseFull' + text/json: + schema: + $ref: '#/components/schemas/UrlSsrfResponseFull' + application/xml: + schema: + $ref: '#/components/schemas/UrlSsrfResponseFull' + text/xml: + schema: + $ref: '#/components/schemas/UrlSsrfResponseFull' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/domain/url/ssrf-threat-check/batch: + post: + tags: + - Domain + summary: Check a URL for SSRF threats in batches + description: Batch-checks if input URLs are at risk of being an SSRF (Server-side + request forgery) threat or attack. + operationId: Domain_Ssrf Check Batch + requestBody: + description: Input URL request as a batch of multiple URLs + content: + application/json: + schema: + $ref: '#/components/schemas/UrlSsrfRequestBatch' + text/json: + schema: + $ref: '#/components/schemas/UrlSsrfRequestBatch' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UrlSsrfResponseBatch' + text/json: + schema: + $ref: '#/components/schemas/UrlSsrfResponseBatch' + application/xml: + schema: + $ref: '#/components/schemas/UrlSsrfResponseBatch' + text/xml: + schema: + $ref: '#/components/schemas/UrlSsrfResponseBatch' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/domain/url/ssrf-threat-check/html-embedded: + post: + tags: + - Domain + summary: Check a URL for HTML embedded SSRF threats + description: Checks if an input URL HTML is at risk of containing one or more + embedded SSRF (Server-side request forgery) threats or attacks. + operationId: Domain_Url Html Ssrf Check + requestBody: + description: Input URL request + content: + application/json: + schema: + $ref: '#/components/schemas/UrlHtmlSsrfRequestFull' + text/json: + schema: + $ref: '#/components/schemas/UrlHtmlSsrfRequestFull' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UrlHtmlSsrfResponseFull' + text/json: + schema: + $ref: '#/components/schemas/UrlHtmlSsrfResponseFull' + application/xml: + schema: + $ref: '#/components/schemas/UrlHtmlSsrfResponseFull' + text/xml: + schema: + $ref: '#/components/schemas/UrlHtmlSsrfResponseFull' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/email/address/syntaxOnly: + post: + tags: + - Email + summary: Validate email adddress for syntactic correctness only + description: Validate whether a given email address is syntactically correct + via a limited local-only check. Use the address/full API to do a full validation. + operationId: Email_Post + requestBody: + description: Email address to validate, e.g. "support@cloudmersive.com". The + input is a string so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AddressVerifySyntaxOnlyResponse' + text/json: + schema: + $ref: '#/components/schemas/AddressVerifySyntaxOnlyResponse' + application/xml: + schema: + $ref: '#/components/schemas/AddressVerifySyntaxOnlyResponse' + text/xml: + schema: + $ref: '#/components/schemas/AddressVerifySyntaxOnlyResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/email/address/servers: + post: + tags: + - Email + summary: Partially check whether an email address is valid + description: Validate an email address by identifying whether its parent domain + has email servers defined. This call is less limited than syntaxOnly but + not as comprehensive as address/full. + operationId: Email_Address Get Servers + requestBody: + description: Email address to validate, e.g. "support@cloudmersive.com". The + input is a string so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AddressGetServersResponse' + text/json: + schema: + $ref: '#/components/schemas/AddressGetServersResponse' + application/xml: + schema: + $ref: '#/components/schemas/AddressGetServersResponse' + text/xml: + schema: + $ref: '#/components/schemas/AddressGetServersResponse' + security: + - Apikey: [] + x-codegen-request-body-name: email + /validate/email/address/full: + post: + tags: + - Email + summary: Fully validate an email address + description: Performs a full validation of the email address. Checks for syntactic + correctness, identifies the mail server in question if any, and then contacts + the email server to validate the existence of the account - without sending + any emails. + operationId: Email_Full Validation + requestBody: + description: Email address to validate, e.g. "support@cloudmersive.com". The + input is a string so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FullEmailValidationResponse' + text/json: + schema: + $ref: '#/components/schemas/FullEmailValidationResponse' + application/xml: + schema: + $ref: '#/components/schemas/FullEmailValidationResponse' + text/xml: + schema: + $ref: '#/components/schemas/FullEmailValidationResponse' + security: + - Apikey: [] + x-codegen-request-body-name: email + /validate/ip/intelligence: + post: + tags: + - IPAddress + summary: Get intelligence on an IP address + description: Identify key intelligence about an IP address, including if it + is a known threat IP, known bot, Tor exit node, as well as the location of + the IP address. + operationId: IPAddress_Ip Intelligence + requestBody: + description: IP address to process, e.g. "55.55.55.55". The input is a string + so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IPIntelligenceResponse' + text/json: + schema: + $ref: '#/components/schemas/IPIntelligenceResponse' + application/xml: + schema: + $ref: '#/components/schemas/IPIntelligenceResponse' + text/xml: + schema: + $ref: '#/components/schemas/IPIntelligenceResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/ip/geolocate: + post: + tags: + - IPAddress + summary: Geolocate an IP address + description: Identify an IP address Country, State/Provence, City, Zip/Postal + Code, etc. Useful for security and UX applications. + operationId: IPAddress_Post + requestBody: + description: IP address to geolocate, e.g. "55.55.55.55". The input is a + string so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GeolocateResponse' + text/json: + schema: + $ref: '#/components/schemas/GeolocateResponse' + application/xml: + schema: + $ref: '#/components/schemas/GeolocateResponse' + text/xml: + schema: + $ref: '#/components/schemas/GeolocateResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/ip/geolocate/street-address: + post: + tags: + - IPAddress + summary: Geolocate an IP address to a street address + description: Identify an IP address's street address. Useful for security and + UX applications. + operationId: IPAddress_Geolocate Street Address + requestBody: + description: IP address to geolocate, e.g. "55.55.55.55". The input is a + string so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GeolocateStreetAddressResponse' + text/json: + schema: + $ref: '#/components/schemas/GeolocateStreetAddressResponse' + application/xml: + schema: + $ref: '#/components/schemas/GeolocateStreetAddressResponse' + text/xml: + schema: + $ref: '#/components/schemas/GeolocateStreetAddressResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/ip/is-threat: + post: + tags: + - IPAddress + summary: Check if IP address is a known threat + description: Check if the input IP address is a known threat IP address. Checks + against known bad IPs, botnets, compromised servers, and other lists of threats. + operationId: IPAddress_Is Threat + requestBody: + description: IP address to check, e.g. "55.55.55.55". The input is a string + so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IPThreatResponse' + text/json: + schema: + $ref: '#/components/schemas/IPThreatResponse' + application/xml: + schema: + $ref: '#/components/schemas/IPThreatResponse' + text/xml: + schema: + $ref: '#/components/schemas/IPThreatResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/ip/is-tor-node: + post: + tags: + - IPAddress + summary: Check if IP address is a Tor node server + description: Check if the input IP address is a Tor exit node server. Tor servers + are a type of privacy-preserving technology that can hide the original IP + address who makes a request. + operationId: IPAddress_Is Tor Node + requestBody: + description: IP address to check, e.g. "55.55.55.55". The input is a string + so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TorNodeResponse' + text/json: + schema: + $ref: '#/components/schemas/TorNodeResponse' + application/xml: + schema: + $ref: '#/components/schemas/TorNodeResponse' + text/xml: + schema: + $ref: '#/components/schemas/TorNodeResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/ip/is-bot: + post: + tags: + - IPAddress + summary: Check if IP address is a Bot client + description: Check if the input IP address is a Bot, robot, or otherwise a non-user + entity. Leverages real-time signals to check against known high-probability + bots.. + operationId: IPAddress_Is Bot + requestBody: + description: IP address to check, e.g. "55.55.55.55". The input is a string + so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BotCheckResponse' + text/json: + schema: + $ref: '#/components/schemas/BotCheckResponse' + application/xml: + schema: + $ref: '#/components/schemas/BotCheckResponse' + text/xml: + schema: + $ref: '#/components/schemas/BotCheckResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/ip/reverse-domain-lookup: + post: + tags: + - IPAddress + summary: Perform a reverse domain name (DNS) lookup on an IP address + description: Gets the domain name, if any, associated with the IP address. + operationId: IPAddress_Reverse Domain Lookup + requestBody: + description: IP address to check, e.g. "55.55.55.55". The input is a string + so be sure to enclose it in double-quotes. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IPReverseDNSLookupResponse' + text/json: + schema: + $ref: '#/components/schemas/IPReverseDNSLookupResponse' + application/xml: + schema: + $ref: '#/components/schemas/IPReverseDNSLookupResponse' + text/xml: + schema: + $ref: '#/components/schemas/IPReverseDNSLookupResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/lead-enrichment/lead/enrich: + post: + tags: + - LeadEnrichment + summary: Enrich an input lead with additional fields of data + operationId: Lead Enrichment_Enrich Lead + requestBody: + description: Input lead with known fields set, and unknown fields left blank + (null) + content: + application/json: + schema: + $ref: '#/components/schemas/LeadEnrichmentRequest' + text/json: + schema: + $ref: '#/components/schemas/LeadEnrichmentRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/LeadEnrichmentResponse' + text/json: + schema: + $ref: '#/components/schemas/LeadEnrichmentResponse' + application/xml: + schema: + $ref: '#/components/schemas/LeadEnrichmentResponse' + text/xml: + schema: + $ref: '#/components/schemas/LeadEnrichmentResponse' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/name/full-name: + post: + tags: + - Name + summary: Parse and validate a full name + description: Parses a full name string (e.g. "Mr. Jon van der Waal Jr.") into + its component parts (and returns these component parts), and then validates + whether it is a valid name string or not + operationId: Name_Validate Full Name + requestBody: + description: Validation request information + content: + application/json: + schema: + $ref: '#/components/schemas/FullNameValidationRequest' + text/json: + schema: + $ref: '#/components/schemas/FullNameValidationRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FullNameValidationResponse' + text/json: + schema: + $ref: '#/components/schemas/FullNameValidationResponse' + application/xml: + schema: + $ref: '#/components/schemas/FullNameValidationResponse' + text/xml: + schema: + $ref: '#/components/schemas/FullNameValidationResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/name/first: + post: + tags: + - Name + summary: Validate a first name + description: Determines if a string is a valid first name (given name) + operationId: Name_Validate First Name + requestBody: + description: Validation request information + content: + application/json: + schema: + $ref: '#/components/schemas/FirstNameValidationRequest' + text/json: + schema: + $ref: '#/components/schemas/FirstNameValidationRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FirstNameValidationResponse' + text/json: + schema: + $ref: '#/components/schemas/FirstNameValidationResponse' + application/xml: + schema: + $ref: '#/components/schemas/FirstNameValidationResponse' + text/xml: + schema: + $ref: '#/components/schemas/FirstNameValidationResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/name/last: + post: + tags: + - Name + summary: Validate a last name + description: Determines if a string is a valid last name (surname) + operationId: Name_Validate Last Name + requestBody: + description: Validation request information + content: + application/json: + schema: + $ref: '#/components/schemas/LastNameValidationRequest' + text/json: + schema: + $ref: '#/components/schemas/LastNameValidationRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/LastNameValidationResponse' + text/json: + schema: + $ref: '#/components/schemas/LastNameValidationResponse' + application/xml: + schema: + $ref: '#/components/schemas/LastNameValidationResponse' + text/xml: + schema: + $ref: '#/components/schemas/LastNameValidationResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/name/get-gender: + post: + tags: + - Name + summary: Get the gender of a first name + description: Determines the gender of a first name (given name) + operationId: Name_Get Gender + requestBody: + description: Gender request information + content: + application/json: + schema: + $ref: '#/components/schemas/GetGenderRequest' + text/json: + schema: + $ref: '#/components/schemas/GetGenderRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetGenderResponse' + text/json: + schema: + $ref: '#/components/schemas/GetGenderResponse' + application/xml: + schema: + $ref: '#/components/schemas/GetGenderResponse' + text/xml: + schema: + $ref: '#/components/schemas/GetGenderResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/name/identifier: + post: + tags: + - Name + summary: Validate a code identifier + description: Determines if the input name is a valid technical / code identifier. Configure + input rules such as whether whitespace, hyphens, underscores, etc. are allowed. For + example, a valid identifier might be "helloWorld" but not "hello*World". + operationId: Name_Identifier + requestBody: + description: Identifier validation request information + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateIdentifierRequest' + text/json: + schema: + $ref: '#/components/schemas/ValidateIdentifierRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateIdentifierResponse' + text/json: + schema: + $ref: '#/components/schemas/ValidateIdentifierResponse' + application/xml: + schema: + $ref: '#/components/schemas/ValidateIdentifierResponse' + text/xml: + schema: + $ref: '#/components/schemas/ValidateIdentifierResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input + /validate/phonenumber/basic: + post: + tags: + - PhoneNumber + summary: Validate phone number (basic) + description: Validate a phone number by analyzing the syntax + operationId: Phone Number_Syntax Only + requestBody: + description: Phone number to validate in a PhoneNumberValidateRequest object. Try + a phone number such as "1.800.463.3339", and either leave DefaultCountryCode + blank or use "US". + content: + application/json: + schema: + $ref: '#/components/schemas/PhoneNumberValidateRequest' + text/json: + schema: + $ref: '#/components/schemas/PhoneNumberValidateRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PhoneNumberValidationResponse' + text/json: + schema: + $ref: '#/components/schemas/PhoneNumberValidationResponse' + application/xml: + schema: + $ref: '#/components/schemas/PhoneNumberValidationResponse' + text/xml: + schema: + $ref: '#/components/schemas/PhoneNumberValidationResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/text-input/check/sql-injection: + post: + tags: + - TextInput + summary: Check text input for SQL Injection (SQLI) attacks + description: Detects SQL Injection (SQLI) attacks from text input. + operationId: Text Input_Check Sql Injection + parameters: + - name: detectionLevel + in: header + description: Set to Normal to target a high-security SQL Injection detection + level with a very low false positive rate; select High to target a very-high + security SQL Injection detection level with higher false positives. Default + is Normal (recommended). + schema: + type: string + requestBody: + description: User-facing text input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SqlInjectionDetectionResult' + text/json: + schema: + $ref: '#/components/schemas/SqlInjectionDetectionResult' + application/xml: + schema: + $ref: '#/components/schemas/SqlInjectionDetectionResult' + text/xml: + schema: + $ref: '#/components/schemas/SqlInjectionDetectionResult' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/text-input/check/sql-injection/batch: + post: + tags: + - TextInput + summary: Check and protect multiple text inputs for SQL Injection (SQLI) attacks + in batch + description: Detects SQL Injection (SQLI) attacks from multiple text inputs. Output + preverses order of input items. + operationId: Text Input_Check Sql Injection Batch + requestBody: + description: User-facing text input. + content: + application/json: + schema: + $ref: '#/components/schemas/SqlInjectionCheckBatchRequest' + text/json: + schema: + $ref: '#/components/schemas/SqlInjectionCheckBatchRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SqlInjectionCheckBatchResponse' + text/json: + schema: + $ref: '#/components/schemas/SqlInjectionCheckBatchResponse' + application/xml: + schema: + $ref: '#/components/schemas/SqlInjectionCheckBatchResponse' + text/xml: + schema: + $ref: '#/components/schemas/SqlInjectionCheckBatchResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/text-input/check/xss: + post: + tags: + - TextInput + summary: Check text input for Cross-Site-Scripting (XSS) attacks + description: Detects XSS (Cross-Site-Scripting) attacks from text input. + operationId: Text Input_Check Xss + requestBody: + description: User-facing text input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/XssProtectionResult' + text/json: + schema: + $ref: '#/components/schemas/XssProtectionResult' + application/xml: + schema: + $ref: '#/components/schemas/XssProtectionResult' + text/xml: + schema: + $ref: '#/components/schemas/XssProtectionResult' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/text-input/protect/xss: + post: + tags: + - TextInput + summary: Protect text input from Cross-Site-Scripting (XSS) attacks through + normalization + description: Detects and removes XSS (Cross-Site-Scripting) attacks from text + input through normalization. Returns the normalized result, as well as information + on whether the original input contained an XSS risk. + operationId: Text Input_Protect Xss + requestBody: + description: User-facing text input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/XssProtectionResult' + text/json: + schema: + $ref: '#/components/schemas/XssProtectionResult' + application/xml: + schema: + $ref: '#/components/schemas/XssProtectionResult' + text/xml: + schema: + $ref: '#/components/schemas/XssProtectionResult' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/text-input/check-and-protect/xss/batch: + post: + tags: + - TextInput + summary: Check and protect multiple text inputs for Cross-Site-Scripting (XSS) + attacks in batch + description: Detects XSS (Cross-Site-Scripting) attacks from multiple text inputs. Output + preverses order of input items. + operationId: Text Input_Check Xss Batch + requestBody: + description: User-facing text input. + content: + application/json: + schema: + $ref: '#/components/schemas/XssProtectionBatchRequest' + text/json: + schema: + $ref: '#/components/schemas/XssProtectionBatchRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/XssProtectionBatchResponse' + text/json: + schema: + $ref: '#/components/schemas/XssProtectionBatchResponse' + application/xml: + schema: + $ref: '#/components/schemas/XssProtectionBatchResponse' + text/xml: + schema: + $ref: '#/components/schemas/XssProtectionBatchResponse' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/text-input/html/check/ssrf: + post: + tags: + - TextInput + summary: Protect html input from Server-side Request Forgery (SSRF) attacks + description: Detects SSRF (Server-side request forgery) attacks and unsafe URL + attacks from HTML text input, where attackers can attempt to access unsafe + local or network paths in the server environment by injecting them into HTML. + operationId: Text Input_Check Html Ssrf + requestBody: + description: User-facing HTML input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/HtmlSsrfDetectionResult' + text/json: + schema: + $ref: '#/components/schemas/HtmlSsrfDetectionResult' + application/xml: + schema: + $ref: '#/components/schemas/HtmlSsrfDetectionResult' + text/xml: + schema: + $ref: '#/components/schemas/HtmlSsrfDetectionResult' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/text-input/check/xxe: + post: + tags: + - TextInput + summary: Protect text input from XML External Entity (XXE) attacks + description: Detects XXE (XML External Entity) attacks from text input. + operationId: Text Input_Check Xxe + parameters: + - name: allowInternetUrls + in: header + description: 'Optional: Set to true to allow Internet-based dependency URLs + for DTDs and other XML External Entitites, set to false to block. Default + is false.' + schema: + type: boolean + - name: knownSafeUrls + in: header + description: 'Optional: Comma separated list of fully-qualified URLs that + will automatically be considered safe.' + schema: + type: string + - name: knownUnsafeUrls + in: header + description: 'Optional: Comma separated list of fully-qualified URLs that + will automatically be considered unsafe.' + schema: + type: string + requestBody: + description: User-facing text input. + content: + application/json: + schema: + type: string + text/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/XxeDetectionResult' + text/json: + schema: + $ref: '#/components/schemas/XxeDetectionResult' + application/xml: + schema: + $ref: '#/components/schemas/XxeDetectionResult' + text/xml: + schema: + $ref: '#/components/schemas/XxeDetectionResult' + security: + - Apikey: [] + x-codegen-request-body-name: value + /validate/text-input/check/xxe/batch: + post: + tags: + - TextInput + summary: Protect text input from XML External Entity (XXE) attacks + description: Detects XXE (XML External Entity) attacks from text input. + operationId: Text Input_Check Xxe Batch + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/XxeDetectionBatchRequest' + text/json: + schema: + $ref: '#/components/schemas/XxeDetectionBatchRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/XxeDetectionBatchResponse' + text/json: + schema: + $ref: '#/components/schemas/XxeDetectionBatchResponse' + application/xml: + schema: + $ref: '#/components/schemas/XxeDetectionBatchResponse' + text/xml: + schema: + $ref: '#/components/schemas/XxeDetectionBatchResponse' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/useragent/parse: + post: + tags: + - UserAgent + summary: Parse an HTTP User-Agent string, identify robots + description: Uses a parsing system and database to parse the User-Agent into + its structured component parts, such as Browser, Browser Version, Browser + Engine, Operating System, and importantly, Robot identification. + operationId: User Agent_Parse + requestBody: + description: Input parse request + content: + application/json: + schema: + $ref: '#/components/schemas/UserAgentValidateRequest' + text/json: + schema: + $ref: '#/components/schemas/UserAgentValidateRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserAgentValidateResponse' + text/json: + schema: + $ref: '#/components/schemas/UserAgentValidateResponse' + application/xml: + schema: + $ref: '#/components/schemas/UserAgentValidateResponse' + text/xml: + schema: + $ref: '#/components/schemas/UserAgentValidateResponse' + security: + - Apikey: [] + x-codegen-request-body-name: request + /validate/vat/lookup: + post: + tags: + - Vat + summary: Validate a VAT number + description: Checks if a VAT code is valid, and if it is, returns more information + about it. The first two letters of the VAT number must be letters that indicate + the country, such as LU20260743. Possible country codes include Austria (AT), + Belgium (BE), Bulgaria (BG), Cyprus (CY), Czech Republic (CZ), Germany (DE), + Denmark (DK), Estonia (EE), Greece (EL), Spain (ES), Finland (FI), France + (FR), United Kingdom (GB), Croatia (HR), Hungary (HU), Ireland (IE), Italy + (IT), Lithuania (LT), Luxembourg (LU), Latvia (LV), Malta (MT), The Netherlands + (NL), Poland (PL), Portugal (PT), Romania (RO), Sweden (SE), Slovenia (SI), + Slovakia (SK). + operationId: Vat_Vat Lookup + requestBody: + description: Input VAT code + content: + application/json: + schema: + $ref: '#/components/schemas/VatLookupRequest' + text/json: + schema: + $ref: '#/components/schemas/VatLookupRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/VatLookupResponse' + text/json: + schema: + $ref: '#/components/schemas/VatLookupResponse' + application/xml: + schema: + $ref: '#/components/schemas/VatLookupResponse' + text/xml: + schema: + $ref: '#/components/schemas/VatLookupResponse' + security: + - Apikey: [] + x-codegen-request-body-name: input +components: + schemas: + ParseAddressRequest: + type: object + properties: + AddressString: + type: string + description: A mailing address or street address formatted as a single text + string; this will be parsed into its components + CapitalizationMode: + type: string + description: 'Optional; indicates how the parsed output should be capitalized; + default is Title Case; possible values are: "Uppercase" will set the capitalization + to UPPER CASE; "Lowercase" will set the capitalization to lower case; + "Titlecase" will set the capitalization to Title Case; and "Originalcase" + will preserve the original casing as much as possible' + description: Request to parse an address formatted as a string/free text into + a structured address + ParseAddressResponse: + type: object + properties: + Successful: + type: boolean + description: True if the parsing operation was successful, false otherwise + Building: + type: string + description: The name of the building, house or structure if applicable, + such as "Cloudmersive Building 2". This will often by null. + nullable: true + StreetNumber: + type: string + description: The street number or house number of the address. For example, + in the address "1600 Pennsylvania Avenue NW" the street number would be + "1600". This value will typically be populated for most addresses. + Street: + type: string + description: The name of the street or road of the address. For example, + in the address "1600 Pennsylvania Avenue NW" the street number would be + "Pennsylvania Avenue NW". + City: + type: string + description: The city of the address. + StateOrProvince: + type: string + description: The state or province of the address. + PostalCode: + type: string + description: The postal code or zip code of the address. + CountryFullName: + type: string + description: Country of the address, if present in the address. If not + included in the address it will be null. + nullable: true + ISOTwoLetterCode: + type: string + description: Two-letter ISO 3166-1 country code + nullable: true + description: Result of parsing an address into its component parts + ValidateAddressRequest: + type: object + properties: + StreetAddress: + type: string + description: Required; Street address to validate, such as '2950 Buskirk + Ave.' + City: + type: string + description: Required; City part of the addrerss to validate, such as 'Walnut + Creek' + StateOrProvince: + type: string + description: Required; State or province of the address to validate, such + as 'CA' or 'California' + PostalCode: + type: string + description: Optional (recommended); Zip code or postal code of the address + to validate, such as '94597' + CountryFullName: + type: string + description: Optional (recommended); Name of the country, such as 'United + States'. If left blank, and CountryCode is also left blank, will default + to United States. Global countries are supported. + CountryCode: + type: string + description: Optional; two-letter country code (Two-letter ISO 3166-1 country + code) of the country. If left blank, and CountryFullName is also left + blank, will default to United States. Global countries are supported. + description: Request to Validate a Street Address + ValidateAddressResponse: + type: object + properties: + ValidAddress: + type: boolean + description: True if the address is valid, false otherwise + Latitude: + type: number + description: If the address is valid, the degrees latitude of the validated + address, null otherwise + format: double + nullable: true + Longitude: + type: number + description: If the address is valid, the degrees longitude of the validated + address, null otherwise + format: double + nullable: true + description: Result of validating a street address + NormalizeAddressResponse: + type: object + properties: + ValidAddress: + type: boolean + description: True if the address is valid, false otherwise + Building: + type: string + description: The name of the building, house or structure if applicable, + such as "Cloudmersive Building 2". This will often by null. + nullable: true + StreetNumber: + type: string + description: The street number or house number of the address. For example, + in the address "1600 Pennsylvania Avenue NW" the street number would be + "1600". This value will typically be populated for most addresses. + Street: + type: string + description: The name of the street or road of the address. For example, + in the address "1600 Pennsylvania Avenue NW" the street number would be + "Pennsylvania Avenue NW". + City: + type: string + description: The city of the address. + StateOrProvince: + type: string + description: The state or province of the address. + PostalCode: + type: string + description: The postal code or zip code of the address. + CountryFullName: + type: string + description: Country of the address, if present in the address. If not + included in the address it will be null. + nullable: true + ISOTwoLetterCode: + type: string + description: Two-letter ISO 3166-1 country code + Latitude: + type: number + description: If the address is valid, the degrees latitude of the validated + address, null otherwise + format: double + nullable: true + Longitude: + type: number + description: If the address is valid, the degrees longitude of the validated + address, null otherwise + format: double + nullable: true + description: Result of validating a street address + ValidateCityRequest: + type: object + properties: + City: + type: string + description: 'Required: City of the address to validate, such as ''San Francisco'' + or ''London''' + StateOrProvince: + type: string + description: 'Required: State or province of the address to validate, such + as ''California'' or ''CA''' + CountryFullName: + type: string + description: Optional (recommended); Name of the country, such as 'United + States'. If left blank, and CountryCode is also left blank, will default + to United States. Global countries are supported. + CountryCode: + type: string + description: Optional; two-letter country code (Two-letter ISO 3166-1 country + code) of the country. If left blank, and CountryFullName is also left + blank, will default to United States. Global countries are supported. + description: Request to Validate a City and State or Province in a country + ValidateCityResponse: + type: object + properties: + ValidCity: + type: boolean + description: True if the city is valid, false otherwise + City: + type: string + description: If valid, City corresponding to the input postal code, such + as 'Walnut Creek' + StateOrProvince: + type: string + description: If valid; State or province corresponding to the input state + name, such as 'CA' or 'California' + Latitude: + type: number + description: If the postal code is valid, the degrees latitude of the centroid + of the state, null otherwise + format: double + nullable: true + Longitude: + type: number + description: If the postal code is valid, the degrees longitude of the centroid + of the state, null otherwise + format: double + nullable: true + description: Result of validating a city + ValidateStateRequest: + type: object + properties: + StateOrProvince: + type: string + description: 'Required: State or province of the address to validate, such + as ''California'' or ''CA''' + CountryFullName: + type: string + description: Optional (recommended); Name of the country, such as 'United + States'. If left blank, and CountryCode is also left blank, will default + to United States. Global countries are supported. + CountryCode: + type: string + description: Optional; two-letter country code (Two-letter ISO 3166-1 country + code) of the country. If left blank, and CountryFullName is also left + blank, will default to United States. Global countries are supported. + description: Request to Validate a State or Province in a country + ValidateStateResponse: + type: object + properties: + ValidState: + type: boolean + description: True if the address is valid, false otherwise + StateOrProvince: + type: string + description: If valid; State or province corresponding to the input state + name, such as 'CA' or 'California' + Latitude: + type: number + description: If the postal code is valid, the degrees latitude of the centroid + of the state, null otherwise + format: double + nullable: true + Longitude: + type: number + description: If the postal code is valid, the degrees longitude of the centroid + of the state, null otherwise + format: double + nullable: true + description: Result of validating a state + ValidatePostalCodeRequest: + type: object + properties: + PostalCode: + type: string + description: 'Required: Zip code or postal code of the address to validate, + such as ''94597''' + CountryFullName: + type: string + description: Optional (recommended); Name of the country, such as 'United + States'. If left blank, and CountryCode is also left blank, will default + to United States. Global countries are supported. + CountryCode: + type: string + description: Optional; two-letter country code (Two-letter ISO 3166-1 country + code) of the country. If left blank, and CountryFullName is also left + blank, will default to United States. Global countries are supported. + description: Request to Validate a Postal Code + ValidatePostalCodeResponse: + type: object + properties: + ValidPostalCode: + type: boolean + description: True if the Postal Code is valid, false otherwise + City: + type: string + description: If valid, City corresponding to the input postal code, such + as 'Walnut Creek' + StateOrProvince: + type: string + description: If valid; State or province corresponding to the input postal + code, such as 'CA' or 'California' + Latitude: + type: number + description: If the postal code is valid, the degrees latitude of the centroid + of the postal code, null otherwise + format: double + nullable: true + Longitude: + type: number + description: If the postal code is valid, the degrees longitude of the centroid + of the postal code, null otherwise + format: double + nullable: true + description: Result of validating a postal code + ValidateCountryRequest: + type: object + properties: + RawCountryInput: + type: string + description: Raw country input - can be a two-letter code (FIPS 10-4 or + ISO 3166-1), three-letter code (ISO 3166-1) or country name + description: Input parameter to a country validation request + ValidateCountryResponse: + type: object + properties: + Successful: + type: boolean + description: True if successful, false otherwise + CountryFullName: + type: string + description: Full name of the country + ISOTwoLetterCode: + type: string + description: Two-letter ISO 3166-1 country code + FIPSTwoLetterCode: + type: string + description: Two-letter FIPS 10-4 country code + ThreeLetterCode: + type: string + description: Three-letter ISO 3166-1 country code + IsEuropeanUnionMember: + type: boolean + description: True if this country is currently a member of the European + Union (EU), false otherwise + Timezones: + type: array + description: Time zones (IANA/Olsen) in the country + items: + $ref: '#/components/schemas/Timezone' + ISOCurrencyCode: + type: string + description: ISO 4217 currency three-letter code associated with the country + CurrencySymbol: + type: string + description: Symbol associated with the currency + CurrencyEnglishName: + type: string + description: Full name of the currency + Region: + type: string + description: Region (continent) in which the country is located; possible + values are None, Europe, Americas, Asia, Africa, Oceania + Subregion: + type: string + description: Subregion in which the country is located; possible values + are None, NorthernEurope, WesternEurope, SouthernEurope, EasternEurope, + CentralAmerica, NorthernAmerica, SouthAmerica, EasternAfrica, MiddleAfrica, + NorthernAfrica , SouthernAfrica , WesternAfrica , CentralAsia , EasternAsia + , SouthernAsia , SouthEasternAsia , WesternAsia , Southern , Middle , + AustraliaandNewZealand , Melanesia , Polynesia , Micronesia , Caribbean, + description: Result of performing a country validation operation + Timezone: + type: object + properties: + Name: + type: string + description: Name of the Time Zone + BaseUTCOffset: + type: string + description: UTC offset for this time zone + Now: + type: string + description: The current time (Now) in this time zone + format: date-time + description: IANA/Olsen time zone + CountryListResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + Countries: + type: array + description: List of current ISO 3166-1 countries in the world + items: + $ref: '#/components/schemas/CountryDetails' + description: Result of enumerating available countries + CountryDetails: + type: object + properties: + CountryName: + type: string + description: Name of the country + ThreeLetterCode: + type: string + description: Three-letter ISO 3166-1 country code + ISOTwoLetterCode: + type: string + description: Two-letter ISO 3166-1 country code + IsEuropeanUnionMember: + type: boolean + description: True if this country is currently a member of the European + Union (EU), false otherwise + ISOCurrencyCode: + type: string + description: ISO 4217 currency three-letter code associated with the country + CurrencySymbol: + type: string + description: Symbol associated with the currency + CurrencyEnglishName: + type: string + description: Full name of the currency + Region: + type: string + description: Region (continent) in which the country is located; possible + values are None, Europe, Americas, Asia, Africa, Oceania + Subregion: + type: string + description: Subregion in which the country is located; possible values + are None, NorthernEurope, WesternEurope, SouthernEurope, EasternEurope, + CentralAmerica, NorthernAmerica, SouthAmerica, EasternAfrica, MiddleAfrica, + NorthernAfrica , SouthernAfrica , WesternAfrica , CentralAsia , EasternAsia + , SouthernAsia , SouthEasternAsia , WesternAsia , Southern , Middle , + AustraliaandNewZealand , Melanesia , Polynesia , Micronesia , Caribbean, + description: Details of one country + GetTimezonesRequest: + type: object + properties: + CountryCodeOrName: + type: string + description: Can be the two-letter, three-letter country codes or country + name + description: Request to get time zones for a country + GetTimezonesResponse: + type: object + properties: + Successful: + type: boolean + description: True if successful, false otherwise + CountryFullName: + type: string + description: Full name of the country + ISOTwoLetterCode: + type: string + description: Two-letter ISO 3166-1 country code + FIPSTwoLetterCode: + type: string + description: Two-letter FIPS 10-4 country code + ThreeLetterCode: + type: string + description: Three-letter ISO 3166-1 country code + Timezones: + type: array + description: Time zones (IANA/Olsen) in the country + items: + $ref: '#/components/schemas/Timezone' + description: Result of performing a get time zones operation + ReverseGeocodeAddressRequest: + type: object + properties: + Latitude: + type: number + description: Latitude coordinate in WGS84 format + format: double + Longitude: + type: number + description: Longitude coordinate in WGS84 format + format: double + description: Request to reverse geocode a Street Address + ReverseGeocodeAddressResponse: + type: object + properties: + Successful: + type: boolean + description: True if the address operation was successful, false otherwise + StreetAddress: + type: string + description: Street address to validate, such as '2950 Buskirk Ave.' + City: + type: string + description: City part of the addrerss to validate, such as 'Walnut Creek' + StateOrProvince: + type: string + description: State or province of the address to validate, such as 'CA' + or 'California' + PostalCode: + type: string + description: Zip code or postal code of the address to validate, such as + '94597' + CountryFullName: + type: string + description: Name of the country, such as 'United States'. Global countries + are supported. + CountryCode: + type: string + description: Three-letter ISO 3166-1 country code + description: Result of reverse geocoding a street address + DateTimeNowResult: + type: object + properties: + Successful: + type: boolean + description: True if successful, false otherwise + Now: + type: string + description: Current date, time, and time zone in standard JSON date format + format: date-time + NowGmt: + type: string + description: Current GMT-time-zone date, time, and time zone in standard + JSON date format + format: date-time + description: Current date and time response + GetPublicHolidaysRequest: + type: object + properties: + RawCountryInput: + type: string + description: Two-letter code (FIPS 10-4 or ISO 3166-1) of the country; if + not specified, defaults to United States + Year: + type: integer + description: Optional - the year in which to retrieve the holidays; if left + blank (0) it will default to the current year + format: int32 + description: Input parameter to a country validation request + PublicHolidaysResponse: + type: object + properties: + Successful: + type: boolean + description: True if successful, false otherwise + PublicHolidays: + type: array + description: Public holidays in the requested country and year + items: + $ref: '#/components/schemas/PublicHolidayOccurrence' + description: Result of performing a get public holidays request operation + PublicHolidayOccurrence: + type: object + properties: + EnglishName: + type: string + description: Name of the holiday in English + LocalName: + type: string + description: Local name of the holiday + OccurrenceDate: + type: string + description: Date of the holiday (start time) + format: date-time + HolidayType: + type: string + description: 'Type of the holiday; possible values are: Public, Bank, School, + Authorities, Optional, Observance' + Nationwaide: + type: boolean + description: True if the holiday is celebrated in all locales in the country, + false otherwise + description: Public holiday occurrence + DateTimeStandardizedParseRequest: + type: object + properties: + RawDateTimeInput: + type: string + description: Raw string input of a standard-formatted date and time for + parsing + CountryCode: + type: string + description: 'Optional: specify the two-letter country code to optimzie + date formatting; default is US' + description: Input parameter to a date time parsing request + DateTimeStandardizedParseResponse: + type: object + properties: + Successful: + type: boolean + description: True if successful, false otherwise + ParsedDateResult: + type: string + description: Result of performing a date time parsing + format: date-time + Year: + type: integer + description: Year of the parsed date time result + format: int32 + Month: + type: integer + description: Month of the parsed date time result + format: int32 + Day: + type: integer + description: Day of the parsed date time result + format: int32 + Hour: + type: integer + description: Hour of the parsed date time result (24-hour) + format: int32 + Minute: + type: integer + description: Minute of the parsed date time result + format: int32 + Second: + type: integer + description: Second of the parsed date time result + format: int32 + DayOfWeek: + type: string + description: Day of week + description: Result of performing a date time parsing + DateTimeNaturalLanguageParseRequest: + type: object + properties: + RawDateTimeInput: + type: string + description: Raw string input of a natural language-formatted date and time + for parsing + description: Input parameter to a date time parsing request + CheckResponse: + type: object + properties: + ValidDomain: + type: boolean + description: True if the domain name was valid, false if it is not + description: Result of a validation operation + DomainQualityResponse: + type: object + properties: + DomainQualityScore: + type: number + description: The quality score of the domain name; possible values are 0.0 + to 10.0 with 10.0 being the highest and 0.0 being the lowest quality. + format: double + description: Result of performing a domain quality score operation + WhoisResponse: + type: object + properties: + ValidDomain: + type: boolean + description: True if the domain is valid, false if it is not + RegistrantName: + type: string + description: Name of the domain registrant + RegistrantOrganization: + type: string + description: Organization name of the domain registrant + RegistrantEmail: + type: string + description: Email address of the domain registrant + RegistrantStreetNumber: + type: string + description: Street number of the address of the domain registrant, if available + RegistrantStreet: + type: string + description: Street name of the address of the domain registrant, if available + RegistrantCity: + type: string + description: City of the domain registrant, if available + RegistrantStateOrProvince: + type: string + description: State or Province of the address of the domain registrant, + if available + RegistrantPostalCode: + type: string + description: Postal code of the address of the domain registrant, if available + RegistrantCountry: + type: string + description: Country of the address of the domain registrant, if available + RegistrantRawAddress: + type: string + description: Raw address string of the domain registrant, if available + RegistrantTelephone: + type: string + description: Telephone number of the address of the domain registrant + WhoisServer: + type: string + description: Server used to lookup WHOIS information (may change based on + lookup). + RawTextRecord: + type: string + description: WHOIS raw text record + CreatedDt: + type: string + description: Creation date for the record + format: date-time + description: Result of a WHOIS operation + ValidateUrlRequestSyntaxOnly: + type: object + properties: + URL: + type: string + description: URL to validate + description: Request to determine if a URL is valid + ValidateUrlResponseSyntaxOnly: + type: object + properties: + ValidURL: + type: boolean + description: True if the URL is valid, false otherwise + WellFormedURL: + type: string + description: Well-formed version of the URL + TopLevelDomainName: + type: string + description: The top-level domain name of the URL, e.g. mydomain.com + description: Result of validating a URL with syntax only + ValidateUrlRequestFull: + type: object + properties: + URL: + type: string + description: URL to validate + description: Request to determine if a URL is valid + ValidateUrlResponseFull: + type: object + properties: + ValidURL: + type: boolean + description: True if the URL has valid syntax, a valid domain, a valid endpoint, + and passes virus scan checks; false otherwise + Valid_Syntax: + type: boolean + description: True if the URL has valid syntax, false otherwise + Valid_Domain: + type: boolean + description: True if the domain name is valid and exists, false otherwise + Valid_Endpoint: + type: boolean + description: True if the endpoint is up and responsive and passes a virus + scan check, false otherwise + WellFormedURL: + type: string + description: Well-formed version of the URL + description: Result of validating a URL with full validation + PhishingCheckRequest: + type: object + properties: + URL: + type: string + description: URL to validate + description: Request to determine if a URL is a Phishing threat + PhishingCheckResponse: + type: object + properties: + CleanURL: + type: boolean + description: True if the URL is clean, false if it is at risk of containing + a Phishing threat or attack + ThreatType: + type: string + description: Threat type of the Phishing threat; possible values are VerifiedPhishingURL, + UnverifiedPhishingURL, or VerifiedPhishingDomain + description: Result of checking a URL for Phishing threats + IsAdminPathResponse: + type: object + properties: + IsAdminPathNode: + type: boolean + description: True if the input IP address is an Admin Path, and false otherwise + Successful: + type: boolean + description: True if the operation was successful, false otherwise + description: Result of performing an Admin Path operation + UrlSafetyCheckRequestFull: + type: object + properties: + URL: + type: string + description: URL to validate + description: Request to determine if a URL is a safety threat check + UrlSafetyCheckResponseFull: + type: object + properties: + CleanURL: + type: boolean + description: True if the URL is clean, false if it is at risk of containing + a safety threat or attack + ThreatType: + type: string + description: Threat type identified, if any; possible values are "ForcedDownload", + "VirusesAndMalware", "Phishing" + description: Result of checking a URL for safety threats + UrlSsrfRequestFull: + type: object + properties: + URL: + type: string + description: URL to validate + BlockedDomains: + type: array + description: Top level domains that you do not want to allow access to, + e.g. mydomain.com - will block all subdomains as well + items: + type: string + description: Request to determine if a URL is an SSRF threat check + UrlSsrfResponseFull: + type: object + properties: + CleanURL: + type: boolean + description: True if the URL is clean, false if it is at risk of containing + an SSRF threat or attack + ThreatLevel: + type: string + description: Threat level of the URL; possible values are High, Medium, + Low and None + description: Result of checking a URL for SSRF threats + UrlSsrfRequestBatch: + type: object + properties: + InputItems: + type: array + description: Input URLs to check for SSRF threats + items: + $ref: '#/components/schemas/UrlSsrfRequestFull' + description: Batch operation to perform SSRF threat checks on multiple URLs + UrlSsrfResponseBatch: + type: object + properties: + OutputItems: + type: array + description: Results of the operation, with indexes matched to input values + items: + $ref: '#/components/schemas/UrlSsrfResponseFull' + description: Result of performing SSRF threat checks on multiple URLs + UrlHtmlSsrfRequestFull: + type: object + properties: + URL: + type: string + description: URL to validate + description: Request to determine if a URL contains HTML-embedded SSRF threats + UrlHtmlSsrfResponseFull: + type: object + properties: + CleanURL: + type: boolean + description: True if the URL is clean, false if it is at risk of containing + an SSRF threat or attack + HttpResponseCode: + type: integer + description: HTTP response code from the URL + format: int32 + description: Result of checking a URL for HTML-embedded SSRF threats + AddressVerifySyntaxOnlyResponse: + type: object + properties: + ValidAddress: + type: boolean + description: True if the email address is syntactically valid, false if + it is not + Domain: + type: string + description: Domain name of the email address + IsFreeEmailProvider: + type: boolean + description: True if the email domain name is a free provider (typically + a free to sign up web email provider for consumers / personal use), false + otherwise. + IsDisposable: + type: boolean + description: True if the email address is a disposable email address, false + otherwise; these disposable providers are not typically used to receive + email and so will have a low likelihood of opening mail sent there. + description: Syntactic validity of email address + AddressGetServersResponse: + type: object + properties: + Success: + type: boolean + description: True if partial address validation was successufl, false otherwise + Servers: + type: array + description: Email servers for this email address + items: + type: string + description: Result of a partial email address validation + FullEmailValidationResponse: + type: object + properties: + ValidAddress: + type: boolean + description: True if the email address is valid overall, false otherwise + MailServerUsedForValidation: + type: string + description: Email server connected to for verification + Valid_Syntax: + type: boolean + description: True if the syntax of the email address is valid, false otherwise. This + is one component of ValidAddress, but not the only one. + Valid_Domain: + type: boolean + description: True if the domain name of the email address is valid, false + otherwise. This is one component of ValidAddress, but not the only one. + Valid_SMTP: + type: boolean + description: True if the email address was verified by the remote server, + false otherwise. This is one component of ValidAddress, but not the only + one. + IsCatchallDomain: + type: boolean + description: True if the domain is a catch-all domain name, false otherwise. Catch-all + domain names, while rare, always accept inbound email to ensure they do + not lose any potentially useful emails. Catch-all domain names can occassionally + be configured to first accept and store all inbound email, but then later + send a bounce email back to the sender after a delayed period of time. + Domain: + type: string + description: Domain name of the email address + IsFreeEmailProvider: + type: boolean + description: True if the email domain name is a free provider (typically + a free to sign up web email provider for consumers / personal use), false + otherwise. + IsDisposable: + type: boolean + description: True if the email address is a disposable email address, false + otherwise; these disposable providers are not typically used to receive + email and so will have a low likelihood of opening mail sent there. + description: Full email addresss validation result + IPIntelligenceResponse: + type: object + properties: + IsBot: + type: boolean + description: True if the IP address is a known bot, otherwise false + IsTorNode: + type: boolean + description: True if the IP address is a known Tor exit node, otherwise + false + IsThreat: + type: boolean + description: True if the IP address is a known threat IP, otherwise false + IsEU: + type: boolean + description: True if the IP address is in the European Union, otherwise + false + Location: + $ref: '#/components/schemas/GeolocateResponse' + CurrencyCode: + type: string + description: ISO 4217 currency code for the IP address location + CurrencyName: + type: string + description: Name of the currency in English + RegionArea: + type: string + description: Region (continent) in which the country is located; possible + values are None, Europe, Americas, Asia, Africa, Oceania + SubregionArea: + type: string + description: Subregion in which the country is located; possible values + are None, NorthernEurope, WesternEurope, SouthernEurope, EasternEurope, + CentralAmerica, NorthernAmerica, SouthAmerica, EasternAfrica, MiddleAfrica, + NorthernAfrica , SouthernAfrica , WesternAfrica , CentralAsia , EasternAsia + , SouthernAsia , SouthEasternAsia , WesternAsia , Southern , Middle , + AustraliaandNewZealand , Melanesia , Polynesia , Micronesia , Caribbean, + description: IP address intelligence result + GeolocateResponse: + type: object + properties: + CountryCode: + type: string + description: Two-letter country code of IP address + CountryName: + type: string + description: Country name of IP address + City: + type: string + description: City of IP address + RegionCode: + type: string + description: State/region code of IP address + RegionName: + type: string + description: State/region of IP address + ZipCode: + type: string + description: Zip or postal code of IP address + TimezoneStandardName: + type: string + description: Timezone of IP address + Latitude: + type: number + description: Latitude of IP address + format: double + Longitude: + type: number + description: Longitude of IP address + format: double + description: Geolocation result of performing an IP address geolocation operation. This + product includes GeoLite2 data created by MaxMind, available from www.maxmind.com. + GeolocateStreetAddressResponse: + type: object + properties: + CountryCode: + type: string + description: Two-letter country code of IP address + CountryName: + type: string + description: Country name of IP address + StreetAddress: + type: string + description: Street address of IP address + City: + type: string + description: City of IP address + RegionName: + type: string + description: State/region of IP address + ZipCode: + type: string + description: Zip or postal code of IP address + description: Geolocation street address result + IPThreatResponse: + type: object + properties: + IsThreat: + type: boolean + description: True if the input IP address is a threat, false otherwise + ThreatType: + type: string + description: Specifies the type of IP threat; possible values include Blocklist, + Botnet, WebBot + description: Result of performing a IP threat check on an IP address + TorNodeResponse: + type: object + properties: + IsTorNode: + type: boolean + description: True if the input IP address is a Tor exit node, false otherwise + description: Result of performing a Tor node check on an IP address + BotCheckResponse: + type: object + properties: + IsBot: + type: boolean + description: True if the input IP address is a Bot or Robot, false otherwise + description: Result of performing a Bot check on an IP address + IPReverseDNSLookupResponse: + type: object + properties: + Successful: + type: boolean + description: True if a domain was found, false otherwise + HostName: + type: string + description: Host name (fully-qualified) associated with the IP address, + if any + description: Result of performing a Reverse Domain (DNS) lookup on an IP address + LeadEnrichmentRequest: + type: object + properties: + ContactBusinessEmail: + type: string + description: The person's business email address for the lead + ContactFirstName: + type: string + description: The person's first name for the lead + ContactLastName: + type: string + description: The person's last name for the lead + CompanyName: + type: string + description: Name of the company for the lead + CompanyDomainName: + type: string + description: Domain name / website for the lead + CompanyHouseNumber: + type: string + description: House number of the address of the company for the lead + CompanyStreet: + type: string + description: Street name of the address of the company for the lead + CompanyCity: + type: string + description: City of the address of the company for the lead + CompanyStateOrProvince: + type: string + description: State or Province of the address of the company for the lead + CompanyPostalCode: + type: string + description: Postal Code of the address of the company for the lead + CompanyCountry: + type: string + description: Country of the address of the company for the lead + CompanyCountryCode: + type: string + description: Country Code (2-letter ISO 3166-1) of the address of the company + for the lead + CompanyTelephone: + type: string + description: Telephone of the company office for the lead + CompanyVATNumber: + type: string + description: VAT number of the company for the lead + description: Input lead contact; fill in known fields to extend them with matched + field values + LeadEnrichmentResponse: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + LeadType: + type: string + description: The type of the lead; possible types are Junk (a single individual + using a disposable/throwaway email address); Individual (a single individual, + typically a consumer, not purchasing on behalf of a business); SmallBusiness + (a small business, typically with fewer than 100 employees); MediumBusiness + (a medium business, larger than 100 employees but fewer than 1000 employees); + Enterprise (a large business with greater than 1000 employees); Business + (a business customer of unknown size) + ContactBusinessEmail: + type: string + description: The person's business email address for the lead + ContactFirstName: + type: string + description: The person's first name for the lead + ContactLastName: + type: string + description: The person's last name for the lead + ContactGender: + type: string + description: Gender for contact name; possible values are Male, Female, + and Neutral (can be applied to Male or Female). Requires ContactFirstName. + CompanyName: + type: string + description: Name of the company for the lead + CompanyDomainName: + type: string + description: Domain name / website for the lead + CompanyHouseNumber: + type: string + description: House number of the address of the company for the lead + CompanyStreet: + type: string + description: Street name of the address of the company for the lead + CompanyCity: + type: string + description: City of the address of the company for the lead + CompanyStateOrProvince: + type: string + description: State or Province of the address of the company for the lead + CompanyPostalCode: + type: string + description: Postal Code of the address of the company for the lead + CompanyCountry: + type: string + description: Country Name of the address of the company for the lead + CompanyCountryCode: + type: string + description: Country Code (2-letter ISO 3166-1) of the address of the company + for the lead + CompanyTelephone: + type: string + description: Telephone of the company office for the lead + CompanyVATNumber: + type: string + description: VAT number of the company for the lead + EmployeeCount: + type: integer + description: Count of employees at the company (estimated), if available + format: int32 + description: Result of the lead enrichment process + FullNameValidationRequest: + type: object + properties: + FullNameString: + type: string + description: Full name to process as a free-form string; supports many components + such as First Name, Middle Name, Last Name, Title, Nickname, Suffix, and + Display Name + description: Request to validate a full name string + FullNameValidationResponse: + type: object + properties: + Successful: + type: boolean + description: True if the validation operation was successful, false otherwise + ValidationResult_FirstName: + type: string + description: 'Possible values are: ValidFirstName, ValidUnknownFirstName, + InvalidSpamInput, InvalidCharacters, InvalidEmpty' + ValidationResult_LastName: + type: string + description: 'Possible values are: ValidLastName, ValidUnknownLastName, + InvalidSpamInput, InvalidCharacters, InvalidEmpty' + Title: + type: string + description: The person's title (if supplied), e.g. "Mr." or "Ms." + FirstName: + type: string + description: The first name (given name) + MiddleName: + type: string + description: The middle name(s); if there are multiple names they will be + separated by spaces + LastName: + type: string + description: The last name (surname) + NickName: + type: string + description: Nickname (if supplied) + Suffix: + type: string + description: Suffix to the name, e.g. "Jr." or "Sr." + DisplayName: + type: string + description: The full display name of the name + description: Result of a full name validation operation + FirstNameValidationRequest: + type: object + properties: + FirstName: + type: string + description: First name to process + description: Request to validate a first name + FirstNameValidationResponse: + type: object + properties: + Successful: + type: boolean + description: True if the validation operation was successful, false otherwise + ValidationResult: + type: string + description: 'Possible values are: ValidFirstName, ValidUnknownFirstName, + InvalidSpamInput, InvalidCharacters, InvalidEmpty' + description: Result of a first name validation operation + LastNameValidationRequest: + type: object + properties: + LastName: + type: string + description: Last name to process + description: Request to validate a last name + LastNameValidationResponse: + type: object + properties: + Successful: + type: boolean + description: True if the validation operation was successful, false otherwise + ValidationResult: + type: string + description: 'Possible values are: ValidLastName, ValidUnknownLastName, + InvalidSpamInput, InvalidCharacters, InvalidEmpty' + description: Result of a last name validation operation + GetGenderRequest: + type: object + properties: + FirstName: + type: string + description: Input first name (given name) to get the gender of + CountryCode: + type: string + description: Optional; the country for this name, possible values are "US", + "LY", "NI", "TT", "MK", "KZ", "BO", "UG", "TZ", "CL", "SI", "MA", "RW", + "VN", "AW", "CY", "BH", "SG", "ZA", "MU", "BR", "TN", "KH", "US", "TH", + "TW", "UY", "DO", "CO", "UA", "QA", "BY", "SN", "SD", "FJ", "LB", "BE", + "ML", "LV", "FR", "TM", "NG", "EC", "NO", "SL", "CR", "PA", "GE", "CH", + "KR", "RS", "ZM", "FI", "BF", "MC", "AU", "GA", "LS", "RU", "IN", "SE", + "LK", "BZ", "MX", "GH", "AF", "TJ", "BN", "DZ", "CM", "GR", "MD", "HN", + "AT", "NZ", "SV", "GW", "NA", "AR", "MZ", "PK", "MN", "IQ", "BW", "VE", + "PT", "BS", "AL", "TG", "ID", "ET", "CF", "JP", "BB", "PH", "CU", "BD", + "AO", "SM", "LC", "ME", "RO", "DA" "NI", "LO", "ES", "EE", "IL", "ZW", + "MW", "LU", "IR", "SC", "NL", "JO", "AM", "DE", "GL", "OM", "DK", "HR", + "LI", "TD", "KM", "BA", "GM", "GD", "CA", "CZ", "MR", "ST", "IS", "LR", + "IE", "VC", "AE", "KG", "DJ", "TR", "KE", "NE", "UZ", "CN", "GQ", "SK", + "BJ", "MG", "BT", "EG", "PL", "IT", "SA", "MY", "CI", "AG", "AD", "KS", + "HU", "CG", "KP", "DM", "GN", "GT", "NP", "JM", "LA", "GB", "BG", "HT", + "PE", "AZ", "LT", "SZ", "PY", "MT", "VA", "SY" + description: Request to get the gender from a first name + GetGenderResponse: + type: object + properties: + Successful: + type: boolean + description: True if successful, false otherwise + Gender: + type: string + description: Gender for this name; possible values are Male, Female, and + Neutral (can be applied to Male or Female) + description: Result of the GetGender operation + ValidateIdentifierRequest: + type: object + properties: + Input: + type: string + description: Text string identifier input + AllowWhitespace: + type: boolean + description: True if whitespace is allowed in the identifier, false otherwise + AllowHyphens: + type: boolean + description: True if hyphens are allowd in the identifier, false otherwise + AllowUnderscore: + type: boolean + description: True if underscores are allowed in the identifier, false otherwise + AllowNumbers: + type: boolean + description: True if numbers are allowed in the identifier, false otherwise + AllowPeriods: + type: boolean + description: True if periods are allowed in the identifier, false otherwise + MaxLength: + type: integer + description: Optional; maximum length, if any, of the identifier + format: int32 + MinLength: + type: integer + description: Optional; minimum length, if any, of the identifier + format: int32 + description: Identifier validation request, including the input identifier as + well as various identifier rules + ValidateIdentifierResponse: + type: object + properties: + ValidIdentifier: + type: boolean + description: True if the input identifier is valid, false otherwise + Error: + type: string + description: 'Resulting error from the identifier validation; possible errors + are: "InputIsEmpty", "ContainsWhitespace", "ContainsNumbers", "ContainsHyphen", + "ContainsUnderscore", "ContainsPeriod", "TooShort", "TooLong", "ContainsSpecialCharacters"' + description: Result of performing an identifier validation operation + PhoneNumberValidateRequest: + type: object + properties: + PhoneNumber: + type: string + description: Raw phone number string to parse as input for validation + DefaultCountryCode: + type: string + description: Optional, default country code. If left blank, will default + to "US". + description: Request to validate a phone number + PhoneNumberValidationResponse: + type: object + properties: + IsValid: + type: boolean + description: True if the phone number is valid, false otherwise + Successful: + type: boolean + description: True if the operation was successful, false if there was an + error during validation. See IsValid for validation result. + PhoneNumberType: + type: string + description: "Type of phone number; possible values are: FixedLine, Mobile,\ + \ FixedLineOrMobile, TollFree, PremiumRate, \r\nSharedCost, Voip, PersonalNumber,\ + \ Pager, Uan, Voicemail, Unknown" + E164Format: + type: string + description: E.164 format of the phone number + InternationalFormat: + type: string + description: Internaltional format of the phone number + NationalFormat: + type: string + description: National format of the phone number + CountryCode: + type: string + description: Two digit country code of the phone number + CountryName: + type: string + description: User-friendly long name of the country for the phone number + description: Result from validating a phone number + SqlInjectionDetectionResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + ContainedSqlInjectionAttack: + type: boolean + description: True if the input contained SQL Injection attacks, false otherwise + OriginalInput: + type: string + description: Original input string + description: Result of performing an SQL Injection protection operation + SqlInjectionCheckBatchRequest: + type: object + properties: + RequestItems: + type: array + description: Multiple items to detect for SQL Injection + items: + $ref: '#/components/schemas/SqlInjectionCheckRequestItem' + DetectionLevel: + type: string + description: Set to Normal to target a high-security SQL Injection detection + level with a very low false positive rate; select High to target a very-high + security SQL Injection detection level with higher false positives. Default + is Normal (recommended). + description: Input to a batch SQL Injection detection operation + SqlInjectionCheckRequestItem: + type: object + properties: + InputText: + type: string + description: Individual input text item to check for SQL Injection + description: Individual item to protect for SQL Injection + SqlInjectionCheckBatchResponse: + type: object + properties: + ResultItems: + type: array + description: Results from performing a batch SQL Injection detection operation; + order is preserved from input data + items: + $ref: '#/components/schemas/SqlInjectionDetectionResult' + description: Result of performing a batch XSS protection operation + XssProtectionResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + ContainedXss: + type: boolean + description: True if the input contained XSS scripting, false otherwise + OriginalInput: + type: string + description: Original input string + NormalizedResult: + type: string + description: Normalized string result, with XSS removed + description: Result of performing an XSS protection operation + XssProtectionBatchRequest: + type: object + properties: + RequestItems: + type: array + description: Multiple items to protect for XSS + items: + $ref: '#/components/schemas/XssProtectionRequestItem' + description: Input to a batch XSS protection operation + XssProtectionRequestItem: + type: object + properties: + InputText: + type: string + description: Individual input text item to protect from XSS + description: Individual item to protect for XSS + XssProtectionBatchResponse: + type: object + properties: + ResultItems: + type: array + description: Results from performing a batch XSS protection operation + items: + $ref: '#/components/schemas/XssProtectionResult' + description: Result of performing a batch XSS protection operation + HtmlSsrfDetectionResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + ContainedThreats: + type: boolean + description: True if the input contained SSRF threats, false otherwise + description: Result of performing an XXE threat detection operation + XxeDetectionResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + ContainedXxe: + type: boolean + description: True if the input contained XXE threats, false otherwise + description: Result of performing an XXE threat detection operation + XxeDetectionBatchRequest: + type: object + properties: + RequestItems: + type: array + description: Multiple items to protect for XXE + items: + $ref: '#/components/schemas/XxeDetectionRequestItem' + description: Input to a batch XXE detection operation + XxeDetectionRequestItem: + type: object + properties: + InputText: + type: string + description: Individual input text item to protect from XXE + AllowInternetUrls: + type: boolean + description: 'Optional: Set to true to allow Internet-based dependency URLs + for DTDs and other XML External Entitites, set to false to block. Default + is false.' + KnownSafeUrls: + type: array + description: 'Optional: Comma separated list of fully-qualified URLs that + will automatically be considered safe.' + items: + type: string + KnownUnsafeUrls: + type: array + description: 'Optional: Comma separated list of fully-qualified URLs that + will automatically be considered unsafe.' + items: + type: string + description: Individual item to detect for XXE + XxeDetectionBatchResponse: + type: object + properties: + ResultItems: + type: array + description: Results from performing a batch XSS protection operation + items: + $ref: '#/components/schemas/XxeDetectionResult' + description: Result of performing a batch XXE detection operation + UserAgentValidateRequest: + type: object + properties: + UserAgentString: + type: string + description: The user agent string you wish to parse and validate + description: User-Agent parse and validation request + UserAgentValidateResponse: + type: object + properties: + Successful: + type: boolean + description: True if the operation was successful, false otherwise + IsBot: + type: boolean + description: True if the request is a known robot, false otherwise + BotName: + type: string + description: Optional; name of the robot if the request was from a known + robot, otherwise null + nullable: true + BotURL: + type: string + description: Optional; if available, the URL to the robot + OperatingSystem: + type: string + description: Operating System of the User-Agent (e.g. Windows) + OperatingSystemCPUPlatform: + type: string + description: The CPU platform of the User-Agent (e.g. x64) + OperatingSystemVersion: + type: string + description: The version of the operating system of the User-Agent (e.g. + "10" for Windows 10) + DeviceType: + type: string + description: Device type of the User-Agent; possible values are "DESKTOP", + "SMARTPHONE", "TABLET" + DeviceBrandName: + type: string + description: Brand name of the User-Agent + DeviceModel: + type: string + description: Model name or number of the User-Agent + BrowserName: + type: string + description: Name of the Browser + BrowserVersion: + type: string + description: Version of the Browser + BrowserEngineName: + type: string + description: Name of the Browser Engine + BrowserEngineVersion: + type: string + description: Version of the Browser Engine + description: The result of a User-Agent validation request + VatLookupRequest: + type: object + properties: + VatCode: + type: string + description: VAT code to lookup; example "CZ25123891" + description: Input to a VAT lookup request + VatLookupResponse: + type: object + properties: + CountryCode: + type: string + description: Two-letter country code + VatNumber: + type: string + description: VAT number + IsValid: + type: boolean + description: True if the VAT code is valid, false otherwise + BusinessName: + type: string + description: Name of the business + BusinessAddress: + type: string + description: Business address as a single string + BusinessBuilding: + type: string + description: For the business address, the name of the building, house or + structure if applicable, such as "Cloudmersive Building 2". This will + often by null. + nullable: true + BusinessStreetNumber: + type: string + description: For the business address, the street number or house number + of the address. For example, in the address "1600 Pennsylvania Avenue + NW" the street number would be "1600". This value will typically be populated + for most addresses. + BusinessStreet: + type: string + description: For the business address, the name of the street or road of + the address. For example, in the address "1600 Pennsylvania Avenue NW" + the street number would be "Pennsylvania Avenue NW". + BusinessCity: + type: string + description: For the business address, the city of the address. + BusinessStateOrProvince: + type: string + description: For the business address, the state or province of the address. + BusinessPostalCode: + type: string + description: For the business address, the postal code or zip code of the + address. + BusinessCountry: + type: string + description: For the business address, country of the address, if present + in the address. If not included in the address it will be null. + nullable: true + securitySchemes: + Apikey: + type: apiKey + description: API Key Authentication + name: Apikey + in: header diff --git a/openapi/cloudmersive.validate/types.bal b/openapi/cloudmersive.validate/types.bal new file mode 100644 index 000000000..7e1dd330c --- /dev/null +++ b/openapi/cloudmersive.validate/types.bal @@ -0,0 +1,1030 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +# IANA/Olsen time zone +public type Timezone record { + # Name of the Time Zone + string Name?; + # UTC offset for this time zone + string BaseUTCOffset?; + # The current time (Now) in this time zone + string Now?; +}; + +# Result of the GetGender operation +public type GetGenderResponse record { + # True if successful, false otherwise + boolean Successful?; + # Gender for this name; possible values are Male, Female, and Neutral (can be applied to Male or Female) + string Gender?; +}; + +# Result of performing a Bot check on an IP address +public type BotCheckResponse record { + # True if the input IP address is a Bot or Robot, false otherwise + boolean IsBot?; +}; + +# Result of performing a domain quality score operation +public type DomainQualityResponse record { + # The quality score of the domain name; possible values are 0.0 to 10.0 with 10.0 being the highest and 0.0 being the lowest quality. + float DomainQualityScore?; +}; + +# Result of checking a URL for SSRF threats +public type UrlSsrfResponseFull record { + # True if the URL is clean, false if it is at risk of containing an SSRF threat or attack + boolean CleanURL?; + # Threat level of the URL; possible values are High, Medium, Low and None + string ThreatLevel?; +}; + +# Input lead contact; fill in known fields to extend them with matched field values +public type LeadEnrichmentRequest record { + # The person's business email address for the lead + string ContactBusinessEmail?; + # The person's first name for the lead + string ContactFirstName?; + # The person's last name for the lead + string ContactLastName?; + # Name of the company for the lead + string CompanyName?; + # Domain name / website for the lead + string CompanyDomainName?; + # House number of the address of the company for the lead + string CompanyHouseNumber?; + # Street name of the address of the company for the lead + string CompanyStreet?; + # City of the address of the company for the lead + string CompanyCity?; + # State or Province of the address of the company for the lead + string CompanyStateOrProvince?; + # Postal Code of the address of the company for the lead + string CompanyPostalCode?; + # Country of the address of the company for the lead + string CompanyCountry?; + # Country Code (2-letter ISO 3166-1) of the address of the company for the lead + string CompanyCountryCode?; + # Telephone of the company office for the lead + string CompanyTelephone?; + # VAT number of the company for the lead + string CompanyVATNumber?; +}; + +# Result of a validation operation +public type CheckResponse record { + # True if the domain name was valid, false if it is not + boolean ValidDomain?; +}; + +# Request to determine if a URL is a safety threat check +public type UrlSafetyCheckRequestFull record { + # URL to validate + string URL?; +}; + +# Request to parse an address formatted as a string/free text into a structured address +public type ParseAddressRequest record { + # A mailing address or street address formatted as a single text string; this will be parsed into its components + string AddressString?; + # Optional; indicates how the parsed output should be capitalized; default is Title Case; possible values are: "Uppercase" will set the capitalization to UPPER CASE; "Lowercase" will set the capitalization to lower case; "Titlecase" will set the capitalization to Title Case; and "Originalcase" will preserve the original casing as much as possible + string CapitalizationMode?; +}; + +# Public holiday occurrence +public type PublicHolidayOccurrence record { + # Name of the holiday in English + string EnglishName?; + # Local name of the holiday + string LocalName?; + # Date of the holiday (start time) + string OccurrenceDate?; + # Type of the holiday; possible values are: Public, Bank, School, Authorities, Optional, Observance + string HolidayType?; + # True if the holiday is celebrated in all locales in the country, false otherwise + boolean Nationwaide?; +}; + +# Input to a VAT lookup request +public type VatLookupRequest record { + # VAT code to lookup; example "CZ25123891" + string VatCode?; +}; + +# Request to determine if a URL contains HTML-embedded SSRF threats +public type UrlHtmlSsrfRequestFull record { + # URL to validate + string URL?; +}; + +# Request to validate a last name +public type LastNameValidationRequest record { + # Last name to process + string LastName?; +}; + +# Result of enumerating available countries +public type CountryListResult record { + # True if the operation was successful, false otherwise + boolean Successful?; + # List of current ISO 3166-1 countries in the world + CountryDetails[] Countries?; +}; + +# Input parameter to a date time parsing request +public type DateTimeStandardizedParseRequest record { + # Raw string input of a standard-formatted date and time for parsing + string RawDateTimeInput?; + # Optional: specify the two-letter country code to optimzie date formatting; default is US + string CountryCode?; +}; + +# Input to a batch XSS protection operation +public type XssProtectionBatchRequest record { + # Multiple items to protect for XSS + XssProtectionRequestItem[] RequestItems?; +}; + +# Result of validating a URL with syntax only +public type ValidateUrlResponseSyntaxOnly record { + # True if the URL is valid, false otherwise + boolean ValidURL?; + # Well-formed version of the URL + string WellFormedURL?; + # The top-level domain name of the URL, e.g. mydomain.com + string TopLevelDomainName?; +}; + +# Result of checking a URL for Phishing threats +public type PhishingCheckResponse record { + # True if the URL is clean, false if it is at risk of containing a Phishing threat or attack + boolean CleanURL?; + # Threat type of the Phishing threat; possible values are VerifiedPhishingURL, UnverifiedPhishingURL, or VerifiedPhishingDomain + string ThreatType?; +}; + +# Input to a batch SQL Injection detection operation +public type SqlInjectionCheckBatchRequest record { + # Multiple items to detect for SQL Injection + SqlInjectionCheckRequestItem[] RequestItems?; + # Set to Normal to target a high-security SQL Injection detection level with a very low false positive rate; select High to target a very-high security SQL Injection detection level with higher false positives. Default is Normal (recommended). + string DetectionLevel?; +}; + +# Current date and time response +public type DateTimeNowResult record { + # True if successful, false otherwise + boolean Successful?; + # Current date, time, and time zone in standard JSON date format + string Now?; + # Current GMT-time-zone date, time, and time zone in standard JSON date format + string NowGmt?; +}; + +# Result of performing a batch XSS protection operation +public type SqlInjectionCheckBatchResponse record { + # Results from performing a batch SQL Injection detection operation; order is preserved from input data + SqlInjectionDetectionResult[] ResultItems?; +}; + +# Request to Validate a City and State or Province in a country +public type ValidateCityRequest record { + # Required: City of the address to validate, such as 'San Francisco' or 'London' + string City?; + # Required: State or province of the address to validate, such as 'California' or 'CA' + string StateOrProvince?; + # Optional (recommended); Name of the country, such as 'United States'. If left blank, and CountryCode is also left blank, will default to United States. Global countries are supported. + string CountryFullName?; + # Optional; two-letter country code (Two-letter ISO 3166-1 country code) of the country. If left blank, and CountryFullName is also left blank, will default to United States. Global countries are supported. + string CountryCode?; +}; + +# Result of validating a state +public type ValidateStateResponse record { + # True if the address is valid, false otherwise + boolean ValidState?; + # If valid; State or province corresponding to the input state name, such as 'CA' or 'California' + string StateOrProvince?; + # If the postal code is valid, the degrees latitude of the centroid of the state, null otherwise + float? Latitude?; + # If the postal code is valid, the degrees longitude of the centroid of the state, null otherwise + float? Longitude?; +}; + +# Individual item to detect for XXE +public type XxeDetectionRequestItem record { + # Individual input text item to protect from XXE + string InputText?; + # Optional: Set to true to allow Internet-based dependency URLs for DTDs and other XML External Entitites, set to false to block. Default is false. + boolean AllowInternetUrls?; + # Optional: Comma separated list of fully-qualified URLs that will automatically be considered safe. + string[] KnownSafeUrls?; + # Optional: Comma separated list of fully-qualified URLs that will automatically be considered unsafe. + string[] KnownUnsafeUrls?; +}; + +# Result of checking a URL for HTML-embedded SSRF threats +public type UrlHtmlSsrfResponseFull record { + # True if the URL is clean, false if it is at risk of containing an SSRF threat or attack + boolean CleanURL?; + # HTTP response code from the URL + int HttpResponseCode?; +}; + +# Result of performing a date time parsing +public type DateTimeStandardizedParseResponse record { + # True if successful, false otherwise + boolean Successful?; + # Result of performing a date time parsing + string ParsedDateResult?; + # Year of the parsed date time result + int Year?; + # Month of the parsed date time result + int Month?; + # Day of the parsed date time result + int Day?; + # Hour of the parsed date time result (24-hour) + int Hour?; + # Minute of the parsed date time result + int Minute?; + # Second of the parsed date time result + int Second?; + # Day of week + string DayOfWeek?; +}; + +# Request to Validate a Postal Code +public type ValidatePostalCodeRequest record { + # Required: Zip code or postal code of the address to validate, such as '94597' + string PostalCode?; + # Optional (recommended); Name of the country, such as 'United States'. If left blank, and CountryCode is also left blank, will default to United States. Global countries are supported. + string CountryFullName?; + # Optional; two-letter country code (Two-letter ISO 3166-1 country code) of the country. If left blank, and CountryFullName is also left blank, will default to United States. Global countries are supported. + string CountryCode?; +}; + +# Result of performing an SQL Injection protection operation +public type SqlInjectionDetectionResult record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the input contained SQL Injection attacks, false otherwise + boolean ContainedSqlInjectionAttack?; + # Original input string + string OriginalInput?; +}; + +# Result of performing a Tor node check on an IP address +public type TorNodeResponse record { + # True if the input IP address is a Tor exit node, false otherwise + boolean IsTorNode?; +}; + +# Request to get time zones for a country +public type GetTimezonesRequest record { + # Can be the two-letter, three-letter country codes or country name + string CountryCodeOrName?; +}; + +# Result of a last name validation operation +public type LastNameValidationResponse record { + # True if the validation operation was successful, false otherwise + boolean Successful?; + # Possible values are: ValidLastName, ValidUnknownLastName, InvalidSpamInput, InvalidCharacters, InvalidEmpty + string ValidationResult?; +}; + +# Input parameter to a date time parsing request +public type DateTimeNaturalLanguageParseRequest record { + # Raw string input of a natural language-formatted date and time for parsing + string RawDateTimeInput?; +}; + +# Result of performing a get public holidays request operation +public type PublicHolidaysResponse record { + # True if successful, false otherwise + boolean Successful?; + # Public holidays in the requested country and year + PublicHolidayOccurrence[] PublicHolidays?; +}; + +# Result of a partial email address validation +public type AddressGetServersResponse record { + # True if partial address validation was successufl, false otherwise + boolean Success?; + # Email servers for this email address + string[] Servers?; +}; + +# Result of performing a Reverse Domain (DNS) lookup on an IP address +public type IPReverseDNSLookupResponse record { + # True if a domain was found, false otherwise + boolean Successful?; + # Host name (fully-qualified) associated with the IP address, if any + string HostName?; +}; + +# Request to validate a first name +public type FirstNameValidationRequest record { + # First name to process + string FirstName?; +}; + +# User-Agent parse and validation request +public type UserAgentValidateRequest record { + # The user agent string you wish to parse and validate + string UserAgentString?; +}; + +# Full email addresss validation result +public type FullEmailValidationResponse record { + # True if the email address is valid overall, false otherwise + boolean ValidAddress?; + # Email server connected to for verification + string MailServerUsedForValidation?; + # True if the syntax of the email address is valid, false otherwise. This is one component of ValidAddress, but not the only one. + boolean Valid_Syntax?; + # True if the domain name of the email address is valid, false otherwise. This is one component of ValidAddress, but not the only one. + boolean Valid_Domain?; + # True if the email address was verified by the remote server, false otherwise. This is one component of ValidAddress, but not the only one. + boolean Valid_SMTP?; + # True if the domain is a catch-all domain name, false otherwise. Catch-all domain names, while rare, always accept inbound email to ensure they do not lose any potentially useful emails. Catch-all domain names can occassionally be configured to first accept and store all inbound email, but then later send a bounce email back to the sender after a delayed period of time. + boolean IsCatchallDomain?; + # Domain name of the email address + string Domain?; + # True if the email domain name is a free provider (typically a free to sign up web email provider for consumers / personal use), false otherwise. + boolean IsFreeEmailProvider?; + # True if the email address is a disposable email address, false otherwise; these disposable providers are not typically used to receive email and so will have a low likelihood of opening mail sent there. + boolean IsDisposable?; +}; + +# Result of performing a batch XSS protection operation +public type XssProtectionBatchResponse record { + # Results from performing a batch XSS protection operation + XssProtectionResult[] ResultItems?; +}; + +# Result of performing a country validation operation +public type ValidateCountryResponse record { + # True if successful, false otherwise + boolean Successful?; + # Full name of the country + string CountryFullName?; + # Two-letter ISO 3166-1 country code + string ISOTwoLetterCode?; + # Two-letter FIPS 10-4 country code + string FIPSTwoLetterCode?; + # Three-letter ISO 3166-1 country code + string ThreeLetterCode?; + # True if this country is currently a member of the European Union (EU), false otherwise + boolean IsEuropeanUnionMember?; + # Time zones (IANA/Olsen) in the country + Timezone[] Timezones?; + # ISO 4217 currency three-letter code associated with the country + string ISOCurrencyCode?; + # Symbol associated with the currency + string CurrencySymbol?; + # Full name of the currency + string CurrencyEnglishName?; + # Region (continent) in which the country is located; possible values are None, Europe, Americas, Asia, Africa, Oceania + string Region?; + # Subregion in which the country is located; possible values are None, NorthernEurope, WesternEurope, SouthernEurope, EasternEurope, CentralAmerica, NorthernAmerica, SouthAmerica, EasternAfrica, MiddleAfrica, NorthernAfrica , SouthernAfrica , WesternAfrica , CentralAsia , EasternAsia , SouthernAsia , SouthEasternAsia , WesternAsia , Southern , Middle , AustraliaandNewZealand , Melanesia , Polynesia , Micronesia , Caribbean, + string Subregion?; +}; + +# Geolocation result of performing an IP address geolocation operation. This product includes GeoLite2 data created by MaxMind, available from www.maxmind.com. +public type GeolocateResponse record { + # Two-letter country code of IP address + string CountryCode?; + # Country name of IP address + string CountryName?; + # City of IP address + string City?; + # State/region code of IP address + string RegionCode?; + # State/region of IP address + string RegionName?; + # Zip or postal code of IP address + string ZipCode?; + # Timezone of IP address + string TimezoneStandardName?; + # Latitude of IP address + float Latitude?; + # Longitude of IP address + float Longitude?; +}; + +# Result of performing an XXE threat detection operation +public type HtmlSsrfDetectionResult record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the input contained SSRF threats, false otherwise + boolean ContainedThreats?; +}; + +# Request to validate a phone number +public type PhoneNumberValidateRequest record { + # Raw phone number string to parse as input for validation + string PhoneNumber?; + # Optional, default country code. If left blank, will default to "US". + string DefaultCountryCode?; +}; + +# Request to validate a full name string +public type FullNameValidationRequest record { + # Full name to process as a free-form string; supports many components such as First Name, Middle Name, Last Name, Title, Nickname, Suffix, and Display Name + string FullNameString?; +}; + +# Individual item to protect for SQL Injection +public type SqlInjectionCheckRequestItem record { + # Individual input text item to check for SQL Injection + string InputText?; +}; + +# Request to determine if a URL is valid +public type ValidateUrlRequestFull record { + # URL to validate + string URL?; +}; + +# Request to get the gender from a first name +public type GetGenderRequest record { + # Input first name (given name) to get the gender of + string FirstName?; + # Optional; the country for this name, possible values are "US", "LY", "NI", "TT", "MK", "KZ", "BO", "UG", "TZ", "CL", "SI", "MA", "RW", "VN", "AW", "CY", "BH", "SG", "ZA", "MU", "BR", "TN", "KH", "US", "TH", "TW", "UY", "DO", "CO", "UA", "QA", "BY", "SN", "SD", "FJ", "LB", "BE", "ML", "LV", "FR", "TM", "NG", "EC", "NO", "SL", "CR", "PA", "GE", "CH", "KR", "RS", "ZM", "FI", "BF", "MC", "AU", "GA", "LS", "RU", "IN", "SE", "LK", "BZ", "MX", "GH", "AF", "TJ", "BN", "DZ", "CM", "GR", "MD", "HN", "AT", "NZ", "SV", "GW", "NA", "AR", "MZ", "PK", "MN", "IQ", "BW", "VE", "PT", "BS", "AL", "TG", "ID", "ET", "CF", "JP", "BB", "PH", "CU", "BD", "AO", "SM", "LC", "ME", "RO", "DA" "NI", "LO", "ES", "EE", "IL", "ZW", "MW", "LU", "IR", "SC", "NL", "JO", "AM", "DE", "GL", "OM", "DK", "HR", "LI", "TD", "KM", "BA", "GM", "GD", "CA", "CZ", "MR", "ST", "IS", "LR", "IE", "VC", "AE", "KG", "DJ", "TR", "KE", "NE", "UZ", "CN", "GQ", "SK", "BJ", "MG", "BT", "EG", "PL", "IT", "SA", "MY", "CI", "AG", "AD", "KS", "HU", "CG", "KP", "DM", "GN", "GT", "NP", "JM", "LA", "GB", "BG", "HT", "PE", "AZ", "LT", "SZ", "PY", "MT", "VA", "SY" + string CountryCode?; +}; + +# Result of performing a batch XXE detection operation +public type XxeDetectionBatchResponse record { + # Results from performing a batch XSS protection operation + XxeDetectionResult[] ResultItems?; +}; + +# Result of performing an identifier validation operation +public type ValidateIdentifierResponse record { + # True if the input identifier is valid, false otherwise + boolean ValidIdentifier?; + # Resulting error from the identifier validation; possible errors are: "InputIsEmpty", "ContainsWhitespace", "ContainsNumbers", "ContainsHyphen", "ContainsUnderscore", "ContainsPeriod", "TooShort", "TooLong", "ContainsSpecialCharacters" + string Error?; +}; + +# Request to determine if a URL is an SSRF threat check +public type UrlSsrfRequestFull record { + # URL to validate + string URL?; + # Top level domains that you do not want to allow access to, e.g. mydomain.com - will block all subdomains as well + string[] BlockedDomains?; +}; + +# Result of the lead enrichment process +public type LeadEnrichmentResponse record { + # True if the operation was successful, false otherwise + boolean Successful?; + # The type of the lead; possible types are Junk (a single individual using a disposable/throwaway email address); Individual (a single individual, typically a consumer, not purchasing on behalf of a business); SmallBusiness (a small business, typically with fewer than 100 employees); MediumBusiness (a medium business, larger than 100 employees but fewer than 1000 employees); Enterprise (a large business with greater than 1000 employees); Business (a business customer of unknown size) + string LeadType?; + # The person's business email address for the lead + string ContactBusinessEmail?; + # The person's first name for the lead + string ContactFirstName?; + # The person's last name for the lead + string ContactLastName?; + # Gender for contact name; possible values are Male, Female, and Neutral (can be applied to Male or Female). Requires ContactFirstName. + string ContactGender?; + # Name of the company for the lead + string CompanyName?; + # Domain name / website for the lead + string CompanyDomainName?; + # House number of the address of the company for the lead + string CompanyHouseNumber?; + # Street name of the address of the company for the lead + string CompanyStreet?; + # City of the address of the company for the lead + string CompanyCity?; + # State or Province of the address of the company for the lead + string CompanyStateOrProvince?; + # Postal Code of the address of the company for the lead + string CompanyPostalCode?; + # Country Name of the address of the company for the lead + string CompanyCountry?; + # Country Code (2-letter ISO 3166-1) of the address of the company for the lead + string CompanyCountryCode?; + # Telephone of the company office for the lead + string CompanyTelephone?; + # VAT number of the company for the lead + string CompanyVATNumber?; + # Count of employees at the company (estimated), if available + int EmployeeCount?; +}; + +# Result from validating a phone number +public type PhoneNumberValidationResponse record { + # True if the phone number is valid, false otherwise + boolean IsValid?; + # True if the operation was successful, false if there was an error during validation. See IsValid for validation result. + boolean Successful?; + # Type of phone number; possible values are: FixedLine, Mobile, FixedLineOrMobile, TollFree, PremiumRate, + string PhoneNumberType?; + # E.164 format of the phone number + string E164Format?; + # Internaltional format of the phone number + string InternationalFormat?; + # National format of the phone number + string NationalFormat?; + # Two digit country code of the phone number + string CountryCode?; + # User-friendly long name of the country for the phone number + string CountryName?; +}; + +# Batch operation to perform SSRF threat checks on multiple URLs +public type UrlSsrfRequestBatch record { + # Input URLs to check for SSRF threats + UrlSsrfRequestFull[] InputItems?; +}; + +# Result of validating a city +public type ValidateCityResponse record { + # True if the city is valid, false otherwise + boolean ValidCity?; + # If valid, City corresponding to the input postal code, such as 'Walnut Creek' + string City?; + # If valid; State or province corresponding to the input state name, such as 'CA' or 'California' + string StateOrProvince?; + # If the postal code is valid, the degrees latitude of the centroid of the state, null otherwise + float? Latitude?; + # If the postal code is valid, the degrees longitude of the centroid of the state, null otherwise + float? Longitude?; +}; + +# Geolocation street address result +public type GeolocateStreetAddressResponse record { + # Two-letter country code of IP address + string CountryCode?; + # Country name of IP address + string CountryName?; + # Street address of IP address + string StreetAddress?; + # City of IP address + string City?; + # State/region of IP address + string RegionName?; + # Zip or postal code of IP address + string ZipCode?; +}; + +# Result of reverse geocoding a street address +public type ReverseGeocodeAddressResponse record { + # True if the address operation was successful, false otherwise + boolean Successful?; + # Street address to validate, such as '2950 Buskirk Ave.' + string StreetAddress?; + # City part of the addrerss to validate, such as 'Walnut Creek' + string City?; + # State or province of the address to validate, such as 'CA' or 'California' + string StateOrProvince?; + # Zip code or postal code of the address to validate, such as '94597' + string PostalCode?; + # Name of the country, such as 'United States'. Global countries are supported. + string CountryFullName?; + # Three-letter ISO 3166-1 country code + string CountryCode?; +}; + +# Result of parsing an address into its component parts +public type ParseAddressResponse record { + # True if the parsing operation was successful, false otherwise + boolean Successful?; + # The name of the building, house or structure if applicable, such as "Cloudmersive Building 2". This will often by null. + string? Building?; + # The street number or house number of the address. For example, in the address "1600 Pennsylvania Avenue NW" the street number would be "1600". This value will typically be populated for most addresses. + string StreetNumber?; + # The name of the street or road of the address. For example, in the address "1600 Pennsylvania Avenue NW" the street number would be "Pennsylvania Avenue NW". + string Street?; + # The city of the address. + string City?; + # The state or province of the address. + string StateOrProvince?; + # The postal code or zip code of the address. + string PostalCode?; + # Country of the address, if present in the address. If not included in the address it will be null. + string? CountryFullName?; + # Two-letter ISO 3166-1 country code + string? ISOTwoLetterCode?; +}; + +# Result of performing a get time zones operation +public type GetTimezonesResponse record { + # True if successful, false otherwise + boolean Successful?; + # Full name of the country + string CountryFullName?; + # Two-letter ISO 3166-1 country code + string ISOTwoLetterCode?; + # Two-letter FIPS 10-4 country code + string FIPSTwoLetterCode?; + # Three-letter ISO 3166-1 country code + string ThreeLetterCode?; + # Time zones (IANA/Olsen) in the country + Timezone[] Timezones?; +}; + +public type VatLookupResponse record { + # Two-letter country code + string CountryCode?; + # VAT number + string VatNumber?; + # True if the VAT code is valid, false otherwise + boolean IsValid?; + # Name of the business + string BusinessName?; + # Business address as a single string + string BusinessAddress?; + # For the business address, the name of the building, house or structure if applicable, such as "Cloudmersive Building 2". This will often by null. + string? BusinessBuilding?; + # For the business address, the street number or house number of the address. For example, in the address "1600 Pennsylvania Avenue NW" the street number would be "1600". This value will typically be populated for most addresses. + string BusinessStreetNumber?; + # For the business address, the name of the street or road of the address. For example, in the address "1600 Pennsylvania Avenue NW" the street number would be "Pennsylvania Avenue NW". + string BusinessStreet?; + # For the business address, the city of the address. + string BusinessCity?; + # For the business address, the state or province of the address. + string BusinessStateOrProvince?; + # For the business address, the postal code or zip code of the address. + string BusinessPostalCode?; + # For the business address, country of the address, if present in the address. If not included in the address it will be null. + string? BusinessCountry?; +}; + +# Input parameter to a country validation request +public type GetPublicHolidaysRequest record { + # Two-letter code (FIPS 10-4 or ISO 3166-1) of the country; if not specified, defaults to United States + string RawCountryInput?; + # Optional - the year in which to retrieve the holidays; if left blank (0) it will default to the current year + int Year?; +}; + +# IP address intelligence result +public type IPIntelligenceResponse record { + # True if the IP address is a known bot, otherwise false + boolean IsBot?; + # True if the IP address is a known Tor exit node, otherwise false + boolean IsTorNode?; + # True if the IP address is a known threat IP, otherwise false + boolean IsThreat?; + # True if the IP address is in the European Union, otherwise false + boolean IsEU?; + # Geolocation result of performing an IP address geolocation operation. This product includes GeoLite2 data created by MaxMind, available from www.maxmind.com. + GeolocateResponse Location?; + # ISO 4217 currency code for the IP address location + string CurrencyCode?; + # Name of the currency in English + string CurrencyName?; + # Region (continent) in which the country is located; possible values are None, Europe, Americas, Asia, Africa, Oceania + string RegionArea?; + # Subregion in which the country is located; possible values are None, NorthernEurope, WesternEurope, SouthernEurope, EasternEurope, CentralAmerica, NorthernAmerica, SouthAmerica, EasternAfrica, MiddleAfrica, NorthernAfrica , SouthernAfrica , WesternAfrica , CentralAsia , EasternAsia , SouthernAsia , SouthEasternAsia , WesternAsia , Southern , Middle , AustraliaandNewZealand , Melanesia , Polynesia , Micronesia , Caribbean, + string SubregionArea?; +}; + +# Result of performing an XXE threat detection operation +public type XxeDetectionResult record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the input contained XXE threats, false otherwise + boolean ContainedXxe?; +}; + +# Result of a full name validation operation +public type FullNameValidationResponse record { + # True if the validation operation was successful, false otherwise + boolean Successful?; + # Possible values are: ValidFirstName, ValidUnknownFirstName, InvalidSpamInput, InvalidCharacters, InvalidEmpty + string ValidationResult_FirstName?; + # Possible values are: ValidLastName, ValidUnknownLastName, InvalidSpamInput, InvalidCharacters, InvalidEmpty + string ValidationResult_LastName?; + # The person's title (if supplied), e.g. "Mr." or "Ms." + string Title?; + # The first name (given name) + string FirstName?; + # The middle name(s); if there are multiple names they will be separated by spaces + string MiddleName?; + # The last name (surname) + string LastName?; + # Nickname (if supplied) + string NickName?; + # Suffix to the name, e.g. "Jr." or "Sr." + string Suffix?; + # The full display name of the name + string DisplayName?; +}; + +# Result of a WHOIS operation +public type WhoisResponse record { + # True if the domain is valid, false if it is not + boolean ValidDomain?; + # Name of the domain registrant + string RegistrantName?; + # Organization name of the domain registrant + string RegistrantOrganization?; + # Email address of the domain registrant + string RegistrantEmail?; + # Street number of the address of the domain registrant, if available + string RegistrantStreetNumber?; + # Street name of the address of the domain registrant, if available + string RegistrantStreet?; + # City of the domain registrant, if available + string RegistrantCity?; + # State or Province of the address of the domain registrant, if available + string RegistrantStateOrProvince?; + # Postal code of the address of the domain registrant, if available + string RegistrantPostalCode?; + # Country of the address of the domain registrant, if available + string RegistrantCountry?; + # Raw address string of the domain registrant, if available + string RegistrantRawAddress?; + # Telephone number of the address of the domain registrant + string RegistrantTelephone?; + # Server used to lookup WHOIS information (may change based on lookup). + string WhoisServer?; + # WHOIS raw text record + string RawTextRecord?; + # Creation date for the record + string CreatedDt?; +}; + +# Result of validating a URL with full validation +public type ValidateUrlResponseFull record { + # True if the URL has valid syntax, a valid domain, a valid endpoint, and passes virus scan checks; false otherwise + boolean ValidURL?; + # True if the URL has valid syntax, false otherwise + boolean Valid_Syntax?; + # True if the domain name is valid and exists, false otherwise + boolean Valid_Domain?; + # True if the endpoint is up and responsive and passes a virus scan check, false otherwise + boolean Valid_Endpoint?; + # Well-formed version of the URL + string WellFormedURL?; +}; + +# Input to a batch XXE detection operation +public type XxeDetectionBatchRequest record { + # Multiple items to protect for XXE + XxeDetectionRequestItem[] RequestItems?; +}; + +# Result of performing a IP threat check on an IP address +public type IPThreatResponse record { + # True if the input IP address is a threat, false otherwise + boolean IsThreat?; + # Specifies the type of IP threat; possible values include Blocklist, Botnet, WebBot + string ThreatType?; +}; + +# Result of a first name validation operation +public type FirstNameValidationResponse record { + # True if the validation operation was successful, false otherwise + boolean Successful?; + # Possible values are: ValidFirstName, ValidUnknownFirstName, InvalidSpamInput, InvalidCharacters, InvalidEmpty + string ValidationResult?; +}; + +# Identifier validation request, including the input identifier as well as various identifier rules +public type ValidateIdentifierRequest record { + # Text string identifier input + string Input?; + # True if whitespace is allowed in the identifier, false otherwise + boolean AllowWhitespace?; + # True if hyphens are allowd in the identifier, false otherwise + boolean AllowHyphens?; + # True if underscores are allowed in the identifier, false otherwise + boolean AllowUnderscore?; + # True if numbers are allowed in the identifier, false otherwise + boolean AllowNumbers?; + # True if periods are allowed in the identifier, false otherwise + boolean AllowPeriods?; + # Optional; maximum length, if any, of the identifier + int MaxLength?; + # Optional; minimum length, if any, of the identifier + int MinLength?; +}; + +# Syntactic validity of email address +public type AddressVerifySyntaxOnlyResponse record { + # True if the email address is syntactically valid, false if it is not + boolean ValidAddress?; + # Domain name of the email address + string Domain?; + # True if the email domain name is a free provider (typically a free to sign up web email provider for consumers / personal use), false otherwise. + boolean IsFreeEmailProvider?; + # True if the email address is a disposable email address, false otherwise; these disposable providers are not typically used to receive email and so will have a low likelihood of opening mail sent there. + boolean IsDisposable?; +}; + +# Result of performing an XSS protection operation +public type XssProtectionResult record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the input contained XSS scripting, false otherwise + boolean ContainedXss?; + # Original input string + string OriginalInput?; + # Normalized string result, with XSS removed + string NormalizedResult?; +}; + +# Result of checking a URL for safety threats +public type UrlSafetyCheckResponseFull record { + # True if the URL is clean, false if it is at risk of containing a safety threat or attack + boolean CleanURL?; + # Threat type identified, if any; possible values are "ForcedDownload", "VirusesAndMalware", "Phishing" + string ThreatType?; +}; + +# Request to determine if a URL is a Phishing threat +public type PhishingCheckRequest record { + # URL to validate + string URL?; +}; + +# Result of validating a street address +public type NormalizeAddressResponse record { + # True if the address is valid, false otherwise + boolean ValidAddress?; + # The name of the building, house or structure if applicable, such as "Cloudmersive Building 2". This will often by null. + string? Building?; + # The street number or house number of the address. For example, in the address "1600 Pennsylvania Avenue NW" the street number would be "1600". This value will typically be populated for most addresses. + string StreetNumber?; + # The name of the street or road of the address. For example, in the address "1600 Pennsylvania Avenue NW" the street number would be "Pennsylvania Avenue NW". + string Street?; + # The city of the address. + string City?; + # The state or province of the address. + string StateOrProvince?; + # The postal code or zip code of the address. + string PostalCode?; + # Country of the address, if present in the address. If not included in the address it will be null. + string? CountryFullName?; + # Two-letter ISO 3166-1 country code + string ISOTwoLetterCode?; + # If the address is valid, the degrees latitude of the validated address, null otherwise + float? Latitude?; + # If the address is valid, the degrees longitude of the validated address, null otherwise + float? Longitude?; +}; + +# Request to Validate a State or Province in a country +public type ValidateStateRequest record { + # Required: State or province of the address to validate, such as 'California' or 'CA' + string StateOrProvince?; + # Optional (recommended); Name of the country, such as 'United States'. If left blank, and CountryCode is also left blank, will default to United States. Global countries are supported. + string CountryFullName?; + # Optional; two-letter country code (Two-letter ISO 3166-1 country code) of the country. If left blank, and CountryFullName is also left blank, will default to United States. Global countries are supported. + string CountryCode?; +}; + +# Result of performing SSRF threat checks on multiple URLs +public type UrlSsrfResponseBatch record { + # Results of the operation, with indexes matched to input values + UrlSsrfResponseFull[] OutputItems?; +}; + +# Individual item to protect for XSS +public type XssProtectionRequestItem record { + # Individual input text item to protect from XSS + string InputText?; +}; + +# Result of validating a postal code +public type ValidatePostalCodeResponse record { + # True if the Postal Code is valid, false otherwise + boolean ValidPostalCode?; + # If valid, City corresponding to the input postal code, such as 'Walnut Creek' + string City?; + # If valid; State or province corresponding to the input postal code, such as 'CA' or 'California' + string StateOrProvince?; + # If the postal code is valid, the degrees latitude of the centroid of the postal code, null otherwise + float? Latitude?; + # If the postal code is valid, the degrees longitude of the centroid of the postal code, null otherwise + float? Longitude?; +}; + +# Result of performing an Admin Path operation +public type IsAdminPathResponse record { + # True if the input IP address is an Admin Path, and false otherwise + boolean IsAdminPathNode?; + # True if the operation was successful, false otherwise + boolean Successful?; +}; + +# The result of a User-Agent validation request +public type UserAgentValidateResponse record { + # True if the operation was successful, false otherwise + boolean Successful?; + # True if the request is a known robot, false otherwise + boolean IsBot?; + # Optional; name of the robot if the request was from a known robot, otherwise null + string? BotName?; + # Optional; if available, the URL to the robot + string BotURL?; + # Operating System of the User-Agent (e.g. Windows) + string OperatingSystem?; + # The CPU platform of the User-Agent (e.g. x64) + string OperatingSystemCPUPlatform?; + # The version of the operating system of the User-Agent (e.g. "10" for Windows 10) + string OperatingSystemVersion?; + # Device type of the User-Agent; possible values are "DESKTOP", "SMARTPHONE", "TABLET" + string DeviceType?; + # Brand name of the User-Agent + string DeviceBrandName?; + # Model name or number of the User-Agent + string DeviceModel?; + # Name of the Browser + string BrowserName?; + # Version of the Browser + string BrowserVersion?; + # Name of the Browser Engine + string BrowserEngineName?; + # Version of the Browser Engine + string BrowserEngineVersion?; +}; + +# Request to determine if a URL is valid +public type ValidateUrlRequestSyntaxOnly record { + # URL to validate + string URL?; +}; + +# Input parameter to a country validation request +public type ValidateCountryRequest record { + # Raw country input - can be a two-letter code (FIPS 10-4 or ISO 3166-1), three-letter code (ISO 3166-1) or country name + string RawCountryInput?; +}; + +# Request to reverse geocode a Street Address +public type ReverseGeocodeAddressRequest record { + # Latitude coordinate in WGS84 format + float Latitude?; + # Longitude coordinate in WGS84 format + float Longitude?; +}; + +# Result of validating a street address +public type ValidateAddressResponse record { + # True if the address is valid, false otherwise + boolean ValidAddress?; + # If the address is valid, the degrees latitude of the validated address, null otherwise + float? Latitude?; + # If the address is valid, the degrees longitude of the validated address, null otherwise + float? Longitude?; +}; + +# Details of one country +public type CountryDetails record { + # Name of the country + string CountryName?; + # Three-letter ISO 3166-1 country code + string ThreeLetterCode?; + # Two-letter ISO 3166-1 country code + string ISOTwoLetterCode?; + # True if this country is currently a member of the European Union (EU), false otherwise + boolean IsEuropeanUnionMember?; + # ISO 4217 currency three-letter code associated with the country + string ISOCurrencyCode?; + # Symbol associated with the currency + string CurrencySymbol?; + # Full name of the currency + string CurrencyEnglishName?; + # Region (continent) in which the country is located; possible values are None, Europe, Americas, Asia, Africa, Oceania + string Region?; + # Subregion in which the country is located; possible values are None, NorthernEurope, WesternEurope, SouthernEurope, EasternEurope, CentralAmerica, NorthernAmerica, SouthAmerica, EasternAfrica, MiddleAfrica, NorthernAfrica , SouthernAfrica , WesternAfrica , CentralAsia , EasternAsia , SouthernAsia , SouthEasternAsia , WesternAsia , Southern , Middle , AustraliaandNewZealand , Melanesia , Polynesia , Micronesia , Caribbean, + string Subregion?; +}; + +# Request to Validate a Street Address +public type ValidateAddressRequest record { + # Required; Street address to validate, such as '2950 Buskirk Ave.' + string StreetAddress?; + # Required; City part of the addrerss to validate, such as 'Walnut Creek' + string City?; + # Required; State or province of the address to validate, such as 'CA' or 'California' + string StateOrProvince?; + # Optional (recommended); Zip code or postal code of the address to validate, such as '94597' + string PostalCode?; + # Optional (recommended); Name of the country, such as 'United States'. If left blank, and CountryCode is also left blank, will default to United States. Global countries are supported. + string CountryFullName?; + # Optional; two-letter country code (Two-letter ISO 3166-1 country code) of the country. If left blank, and CountryFullName is also left blank, will default to United States. Global countries are supported. + string CountryCode?; +}; diff --git a/openapi/cloudmersive.virusscan/.gitignore b/openapi/cloudmersive.virusscan/.gitignore new file mode 100644 index 000000000..1de565933 --- /dev/null +++ b/openapi/cloudmersive.virusscan/.gitignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/openapi/cloudmersive.virusscan/Ballerina.toml b/openapi/cloudmersive.virusscan/Ballerina.toml new file mode 100644 index 000000000..ae511b331 --- /dev/null +++ b/openapi/cloudmersive.virusscan/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +license = ["Apache-2.0"] +keywords = ["Cloudmersive", "virusscan"] +org = "ballerinax" +name = "cloudmersive.virusscan" +repository = "https://github.com/ballerina-platform/ballerinax-openapi-connectors" +version = "0.1.0-SNAPSHOT" +authors = ["Ballerina"] +[build-options] +observabilityIncluded = true diff --git a/openapi/cloudmersive.virusscan/Dependencies.toml b/openapi/cloudmersive.virusscan/Dependencies.toml new file mode 100644 index 000000000..1d6708b76 --- /dev/null +++ b/openapi/cloudmersive.virusscan/Dependencies.toml @@ -0,0 +1,11 @@ +[[dependency]] +org = "ballerina" +name = "http" +version = "1.1.0-alpha8" + +[[dependency]] +org = "ballerina" +name = "url" +version = "1.1.0-alpha8" + + diff --git a/openapi/cloudmersive.virusscan/Module.md b/openapi/cloudmersive.virusscan/Module.md new file mode 100644 index 000000000..f9af79823 --- /dev/null +++ b/openapi/cloudmersive.virusscan/Module.md @@ -0,0 +1,51 @@ +## Overview +Cloudmersive Virus Scan API provide capabilities to scan files and content for viruses and security threats. This platform +leverage continuously updated signatures for millions of threats. + +Ballerina connector for Cloudmersive Virus Scan allows easy integration with Cloudmersive Virus Scan REST API via Ballerina language. +It allows advanced high-performance scanning capabilities on files, websites and resources in other cloud providers such as Azure, +AWS and Google Cloud. + +This module supports Cloudmersive Virus Scan REST API `v1` version. + +## Prerequisites +* Create a Cloudmersive Account +* Obtaining tokens + 1. [Login to the Cloudmersive account] (https://account.cloudmersive.com/login) + 2. [Obtain API keys] (https://account.cloudmersive.com/keys) + +## Quickstart +To use the Cloudmersive Virus Scan connector in your Ballerina application, update the .bal file as follows: + +### Step 1: Import cloudmersive.validate module +First, import the ballerinax/cloudmersive.virusscan module into the Ballerina project. +```ballerina +import ballerinax/cloudmersive.virusscan; +``` +### Step 2: Configure the connection credentials. +You can now make the connection configuration using the access token. +```ballerina +virusscan:ApiKeysConfig config = { + apiKeys : { + hapikey : "" + } +}; + +virusscan:Client baseClient = check new Client(clientConfig); + +``` +### Step 3: Get the scan result +```ballerina +virusscan:WebsiteScanRequest address = { + Url: "https://www.yahoo.com/" +}; + +virusscan:WebsiteScanResult|error bEvent = baseClient->scanWebsite(address); + +if (bEvent is virusscan:WebsiteScanResult) { + log:printInfo("Result: " + bEvent.toString()); +} else { + log:printError(msg = bEvent.toString()); +} + +``` \ No newline at end of file diff --git a/openapi/cloudmersive.virusscan/Package.md b/openapi/cloudmersive.virusscan/Package.md new file mode 100644 index 000000000..5cb449b9d --- /dev/null +++ b/openapi/cloudmersive.virusscan/Package.md @@ -0,0 +1,18 @@ +Connects to Cloudmersive Virus Scan API from Ballerina + +## Package overview + +The `ballerinax/cloudmersive.virusscan` is a [Ballerina](https://ballerina.io/) connector for connecting to Cloudmersive Virus Scan API. + +### Compatibility +| | Version | +|:------------------------:|:--------------------------:| +| Ballerina Language | Ballerina Swan Lake Beta2 | +| Cloudmersive API | v1 | + +## Report issues +To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina connector repository](https://github.com/ballerina-platform/ballerinax-openapi-connectors) +## Useful links +- Discuss code changes of the Ballerina project in [ballerina-dev@googlegroups.com](mailto:ballerina-dev@googlegroups.com). +- Chat live with us via our [Slack channel](https://ballerina.io/community/slack/). +- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag diff --git a/openapi/cloudmersive.virusscan/client.bal b/openapi/cloudmersive.virusscan/client.bal new file mode 100644 index 000000000..e61599961 --- /dev/null +++ b/openapi/cloudmersive.virusscan/client.bal @@ -0,0 +1,212 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; + +# Please visit [here](https://account.cloudmersive.com/keys) to get more information on obtaining API key +# +# + apiKeys - Provide your API Key as `Apikey`. Eg: `{"Apikey" : "}`" +public type ApiKeysConfig record { + map apiKeys; +}; + +# The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content. +# +# + clientEp - Connector http endpoint +public client class Client { + http:Client clientEp; + map apiKeys; + # Client initialization. + # + # + apiKeyConfig - API key configuration detail + # + clientConfig - Client configuration details + # + serviceUrl - Connector server URL + # + return - Error at failure of client initialization + public isolated function init(ApiKeysConfig apiKeyConfig, http:ClientConfiguration clientConfig = {}, string serviceUrl = "https://testapi.cloudmersive.com/") returns error? { + http:Client httpEp = check new (serviceUrl, clientConfig); + self.clientEp = httpEp; + self.apiKeys = apiKeyConfig.apiKeys; + } + # Scan a file for viruses + # + # + payload - File content as multipart/form-data + # + return - OK + remote isolated function scanFile(Body payload) returns VirusScanResult|error { + string path = string `/virus/scan/file`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + VirusScanResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=VirusScanResult); + return response; + } + # Advanced Scan a file for viruses + # + # + payload - File content as multipart/form-data + # + allowExecutables - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended). + # + allowInvalidFiles - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended). + # + allowScripts - Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended). + # + allowPasswordProtectedFiles - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended). + # + allowMacros - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended). + # + allowXmlExternalEntities - Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended). + # + restrictFileTypes - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled. + # + return - OK + remote isolated function scanFileAdvanced(Body1 payload, boolean? allowExecutables = (), boolean? allowInvalidFiles = (), boolean? allowScripts = (), boolean? allowPasswordProtectedFiles = (), boolean? allowMacros = (), boolean? allowXmlExternalEntities = (), string? restrictFileTypes = ()) returns VirusScanAdvancedResult|error { + string path = string `/virus/scan/file/advanced`; + map headerValues = {"allowExecutables": allowExecutables, "allowInvalidFiles": allowInvalidFiles, "allowScripts": allowScripts, "allowPasswordProtectedFiles": allowPasswordProtectedFiles, "allowMacros": allowMacros, "allowXmlExternalEntities": allowXmlExternalEntities, "restrictFileTypes": restrictFileTypes, Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + VirusScanAdvancedResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=VirusScanAdvancedResult); + return response; + } + # Scan a website for malicious content and threats + # + # + payload - Request to scan a website for malicious content + # + return - OK + remote isolated function scanWebsite(WebsiteScanRequest payload) returns WebsiteScanResult|error { + string path = string `/virus/scan/website`; + map headerValues = {Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + json jsonBody = check payload.cloneWithType(json); + request.setPayload(jsonBody); + WebsiteScanResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=WebsiteScanResult); + return response; + } + # Scan an Azure Blob for viruses + # + # + connectionString - Connection string for the Azure Blob Storage Account; you can get this connection string from the Access Keys tab of the Storage Account blade in the Azure Portal. + # + containerName - Name of the Blob container within the Azure Blob Storage account + # + blobPath - Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf' + # + return - OK + remote isolated function scanCloudStorageScanAzureBlob(string connectionString, string containerName, string blobPath) returns CloudStorageVirusScanResult|error { + string path = string `/virus/scan/cloud-storage/azure-blob/single`; + map headerValues = {"connectionString": connectionString, "containerName": containerName, "blobPath": blobPath, Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + //TODO: Update the request as needed; + CloudStorageVirusScanResult response = check self.clientEp-> post(path, request, headers = accHeaders, targetType = CloudStorageVirusScanResult); + return response; + } + # Advanced Scan an Azure Blob for viruses + # + # + connectionString - Connection string for the Azure Blob Storage Account; you can get this connection string from the Access Keys tab of the Storage Account blade in the Azure Portal. + # + containerName - Name of the Blob container within the Azure Blob Storage account + # + blobPath - Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf' + # + allowExecutables - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended). + # + allowInvalidFiles - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended). + # + allowScripts - Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended). + # + allowPasswordProtectedFiles - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended). + # + allowMacros - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended). + # + restrictFileTypes - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled. + # + return - OK + remote isolated function scanCloudStorageScanAzureBlobAdvanced(string connectionString, string containerName, string blobPath, boolean? allowExecutables = (), boolean? allowInvalidFiles = (), boolean? allowScripts = (), boolean? allowPasswordProtectedFiles = (), boolean? allowMacros = (), string? restrictFileTypes = ()) returns CloudStorageAdvancedVirusScanResult|error { + string path = string `/virus/scan/cloud-storage/azure-blob/single/advanced`; + map headerValues = {"connectionString": connectionString, "containerName": containerName, "blobPath": blobPath, "allowExecutables": allowExecutables, "allowInvalidFiles": allowInvalidFiles, "allowScripts": allowScripts, "allowPasswordProtectedFiles": allowPasswordProtectedFiles, "allowMacros": allowMacros, "restrictFileTypes": restrictFileTypes, Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + //TODO: Update the request as needed; + CloudStorageAdvancedVirusScanResult response = check self.clientEp-> post(path, request, headers = accHeaders, targetType = CloudStorageAdvancedVirusScanResult); + return response; + } + # Scan an AWS S3 file for viruses + # + # + accessKey - AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console + # + secretKey - AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console + # + bucketRegion - Name of the region of the S3 bucket, such as 'US-East-1' + # + bucketName - Name of the S3 bucket + # + keyName - Key name (also called file name) of the file in S3 that you wish to scan for viruses + # + return - OK + remote isolated function scanCloudStorageScanAwsS3file(string accessKey, string secretKey, string bucketRegion, string bucketName, string keyName) returns CloudStorageVirusScanResult|error { + string path = string `/virus/scan/cloud-storage/aws-s3/single`; + map headerValues = {"accessKey": accessKey, "secretKey": secretKey, "bucketRegion": bucketRegion, "bucketName": bucketName, "keyName": keyName, Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + //TODO: Update the request as needed; + CloudStorageVirusScanResult response = check self.clientEp-> post(path, request, headers = accHeaders, targetType = CloudStorageVirusScanResult); + return response; + } + # Advanced Scan an AWS S3 file for viruses + # + # + accessKey - AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console + # + secretKey - AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console + # + bucketRegion - Name of the region of the S3 bucket, such as 'US-East-1' + # + bucketName - Name of the S3 bucket + # + keyName - Key name (also called file name) of the file in S3 that you wish to scan for viruses + # + allowExecutables - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended). + # + allowInvalidFiles - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended). + # + allowScripts - Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended). + # + allowPasswordProtectedFiles - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended). + # + allowMacros - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended). + # + restrictFileTypes - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled. + # + return - OK + remote isolated function scanCloudStorageScanAwsS3fileAdvanced(string accessKey, string secretKey, string bucketRegion, string bucketName, string keyName, boolean? allowExecutables = (), boolean? allowInvalidFiles = (), boolean? allowScripts = (), boolean? allowPasswordProtectedFiles = (), boolean? allowMacros = (), string? restrictFileTypes = ()) returns CloudStorageAdvancedVirusScanResult|error { + string path = string `/virus/scan/cloud-storage/aws-s3/single/advanced`; + map headerValues = {"accessKey": accessKey, "secretKey": secretKey, "bucketRegion": bucketRegion, "bucketName": bucketName, "keyName": keyName, "allowExecutables": allowExecutables, "allowInvalidFiles": allowInvalidFiles, "allowScripts": allowScripts, "allowPasswordProtectedFiles": allowPasswordProtectedFiles, "allowMacros": allowMacros, "restrictFileTypes": restrictFileTypes, Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + //TODO: Update the request as needed; + CloudStorageAdvancedVirusScanResult response = check self.clientEp-> post(path, request, headers = accHeaders, targetType = CloudStorageAdvancedVirusScanResult); + return response; + } + # Scan an Google Cloud Platform (GCP) Storage file for viruses + # + # + bucketName - Name of the bucket in Google Cloud Storage + # + objectName - Name of the object or file in Google Cloud Storage + # + payload - Service Account credential for Google Cloud + # + return - OK + remote isolated function scanCloudStorageScanGcpStorageFile(string bucketName, string objectName, Body2 payload) returns CloudStorageVirusScanResult|error { + string path = string `/virus/scan/cloud-storage/gcp-storage/single`; + map headerValues = {"bucketName": bucketName, "objectName": objectName, Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + CloudStorageVirusScanResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=CloudStorageVirusScanResult); + return response; + } + # Advanced Scan an Google Cloud Platform (GCP) Storage file for viruses + # + # + bucketName - Name of the bucket in Google Cloud Storage + # + objectName - Name of the object or file in Google Cloud Storage + # + payload - Service Account credential for Google Cloud + # + allowExecutables - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended). + # + allowInvalidFiles - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended). + # + allowScripts - Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended). + # + allowPasswordProtectedFiles - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended). + # + allowMacros - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended). + # + restrictFileTypes - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled. + # + return - OK + remote isolated function scanCloudStorageScanGcpStorageFileAdvanced(string bucketName, string objectName, Body3 payload, boolean? allowExecutables = (), boolean? allowInvalidFiles = (), boolean? allowScripts = (), boolean? allowPasswordProtectedFiles = (), boolean? allowMacros = (), string? restrictFileTypes = ()) returns CloudStorageAdvancedVirusScanResult|error { + string path = string `/virus/scan/cloud-storage/gcp-storage/single/advanced`; + map headerValues = {"bucketName": bucketName, "objectName": objectName, "allowExecutables": allowExecutables, "allowInvalidFiles": allowInvalidFiles, "allowScripts": allowScripts, "allowPasswordProtectedFiles": allowPasswordProtectedFiles, "allowMacros": allowMacros, "restrictFileTypes": restrictFileTypes, Apikey: self.apiKeys["Apikey"]}; + map accHeaders = getMapForHeaders(headerValues); + http:Request request = new; + CloudStorageAdvancedVirusScanResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=CloudStorageAdvancedVirusScanResult); + return response; + } +} + +# Generate header map for given header values. +# +# + headerParam - Headers map +# + return - Returns generated map or error at failure of client initialization +isolated function getMapForHeaders(map headerParam) returns map { + map headerMap = {}; + foreach var [key, value] in headerParam.entries() { + if value is string || value is string[] { + headerMap[key] = value; + } + } + return headerMap; +} diff --git a/openapi/cloudmersive.virusscan/openapi.yaml b/openapi/cloudmersive.virusscan/openapi.yaml new file mode 100644 index 000000000..c06546e95 --- /dev/null +++ b/openapi/cloudmersive.virusscan/openapi.yaml @@ -0,0 +1,925 @@ +openapi: 3.0.1 +info: + title: virusapi + description: The Cloudmersive Virus Scan API lets you scan files and content for + viruses and identify security issues with content. + version: v1 +servers: +- url: https://testapi.cloudmersive.com/ +paths: + /virus/scan/file: + post: + tags: + - Scan + summary: Scan a file for viruses + description: Scan files and content for viruses. Leverage continuously updated + signatures for millions of threats, and advanced high-performance scanning + capabilities. Over 17 million virus and malware signatures. Continuous cloud-based + updates. Wide file format support including Office, PDF, HTML, Flash. Zip + support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat + scanning across viruses, malware, trojans, ransomware, and spyware. High-speed + in-memory scanning delivers subsecond typical response time. + operationId: Scan_File + requestBody: + content: + multipart/form-data: + schema: + required: + - inputFile + properties: + inputFile: + type: string + description: Input file to perform the operation on. + format: binary + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/VirusScanResult' + text/json: + schema: + $ref: '#/components/schemas/VirusScanResult' + application/xml: + schema: + $ref: '#/components/schemas/VirusScanResult' + text/xml: + schema: + $ref: '#/components/schemas/VirusScanResult' + security: + - Apikey: [] + /virus/scan/file/advanced: + post: + tags: + - Scan + summary: Advanced Scan a file for viruses + description: Advanced Scan files with 360-degree Content Protection across Viruses + and Malware, executables, invalid files, scripts, and even restrictions on + accepted file types with complete content verification. Customize threat rules + to your needs. Leverage continuously updated signatures for millions of threats, + and advanced high-performance scanning capabilities. Over 17 million virus + and malware signatures. Continuous cloud-based updates. Block threats beyond + viruses including executables, scripts, invalid files, and more. Optionally + limit input files to a specific set of file types (e.g. PDF and Word Documents + only). Wide file format support including Office, PDF, HTML, Flash. Zip + support including .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat + scanning across viruses, malware, trojans, ransomware, and spyware. High-speed + in-memory scanning delivers subsecond typical response time. + operationId: Scan_File Advanced + parameters: + - name: allowExecutables + in: header + description: Set to false to block executable files (program code) from being + allowed in the input file. Default is false (recommended). + schema: + type: boolean + - name: allowInvalidFiles + in: header + description: Set to false to block invalid files, such as a PDF file that + is not really a valid PDF file, or a Word Document that is not a valid Word + Document. Default is false (recommended). + schema: + type: boolean + - name: allowScripts + in: header + description: Set to false to block script files, such as a PHP files, Python + scripts, and other malicious content or security threats that can be embedded + in the file. Set to true to allow these file types. Default is false (recommended). + schema: + type: boolean + - name: allowPasswordProtectedFiles + in: header + description: Set to false to block password protected and encrypted files, + such as encrypted zip and rar files, and other files that seek to circumvent + scanning through passwords. Set to true to allow these file types. Default + is false (recommended). + schema: + type: boolean + - name: allowMacros + in: header + description: Set to false to block macros and other threats embedded in document + files, such as Word, Excel and PowerPoint embedded Macros, and other files + that contain embedded content threats. Set to true to allow these file + types. Default is false (recommended). + schema: + type: boolean + - name: allowXmlExternalEntities + in: header + description: Set to false to block XML External Entities and other threats + embedded in XML files, and other files that contain embedded content threats. Set + to true to allow these file types. Default is false (recommended). + schema: + type: boolean + - name: restrictFileTypes + in: header + description: Specify a restricted set of file formats to allow as clean as + a comma-separated list of file formats, such as .pdf,.docx,.png would allow + only PDF, PNG and Word document files. All files must pass content verification + against this list of file formats, if they do not, then the result will + be returned as CleanResult=false. Set restrictFileTypes parameter to null + or empty string to disable; default is disabled. + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + required: + - inputFile + properties: + inputFile: + type: string + description: Input file to perform the operation on. + format: binary + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/VirusScanAdvancedResult' + text/json: + schema: + $ref: '#/components/schemas/VirusScanAdvancedResult' + application/xml: + schema: + $ref: '#/components/schemas/VirusScanAdvancedResult' + text/xml: + schema: + $ref: '#/components/schemas/VirusScanAdvancedResult' + security: + - Apikey: [] + /virus/scan/website: + post: + tags: + - Scan + summary: Scan a website for malicious content and threats + description: Operation includes scanning the content of the URL for various + types of malicious content and threats, including viruses and threats (including + Phishing). + operationId: Scan_Website + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebsiteScanRequest' + text/json: + schema: + $ref: '#/components/schemas/WebsiteScanRequest' + application/xml: + schema: + $ref: '#/components/schemas/WebsiteScanRequest' + text/xml: + schema: + $ref: '#/components/schemas/WebsiteScanRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/WebsiteScanRequest' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/WebsiteScanResult' + text/json: + schema: + $ref: '#/components/schemas/WebsiteScanResult' + application/xml: + schema: + $ref: '#/components/schemas/WebsiteScanResult' + text/xml: + schema: + $ref: '#/components/schemas/WebsiteScanResult' + security: + - Apikey: [] + x-codegen-request-body-name: input + /virus/scan/cloud-storage/azure-blob/single: + post: + tags: + - ScanCloudStorage + summary: Scan an Azure Blob for viruses + description: Scan the contents of a single Azure Blob and its content for viruses. + Leverage continuously updated signatures for millions of threats, and advanced + high-performance scanning capabilities. Over 17 million virus and malware + signatures. Continuous cloud-based updates. Wide file format support including + Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and + other archive formats. Multi-threat scanning across viruses, malware, trojans, + ransomware, and spyware. High-speed in-memory scanning delivers subsecond + typical response time. + operationId: Scan Cloud Storage_Scan Azure Blob + parameters: + - name: connectionString + in: header + description: Connection string for the Azure Blob Storage Account; you can + get this connection string from the Access Keys tab of the Storage Account + blade in the Azure Portal. + required: true + schema: + type: string + - name: containerName + in: header + description: Name of the Blob container within the Azure Blob Storage account + required: true + schema: + type: string + - name: blobPath + in: header + description: Path to the blob within the container, such as 'hello.pdf' or + '/folder/subfolder/world.pdf' + required: true + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + text/json: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + application/xml: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + text/xml: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + security: + - Apikey: [] + /virus/scan/cloud-storage/azure-blob/single/advanced: + post: + tags: + - ScanCloudStorage + summary: Advanced Scan an Azure Blob for viruses + description: Advanced Scan the contents of a single Azure Blob and its content + for viruses and threats. Advanced Scan files with 360-degree Content Protection + across Viruses and Malware, executables, invalid files, scripts, and even + restrictions on accepted file types with complete content verification. Customize + threat rules to your needs. Leverage continuously updated signatures for millions + of threats, and advanced high-performance scanning capabilities. Over 17 + million virus and malware signatures. Continuous cloud-based updates. Block + threats beyond viruses including executables, scripts, invalid files, and + more. Optionally limit input files to a specific set of file types (e.g. + PDF and Word Documents only). Wide file format support including Office, + PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other + archive formats. Multi-threat scanning across viruses, malware, trojans, + ransomware, and spyware. High-speed in-memory scanning delivers subsecond + typical response time. + operationId: Scan Cloud Storage_Scan Azure Blob Advanced + parameters: + - name: connectionString + in: header + description: Connection string for the Azure Blob Storage Account; you can + get this connection string from the Access Keys tab of the Storage Account + blade in the Azure Portal. + required: true + schema: + type: string + - name: containerName + in: header + description: Name of the Blob container within the Azure Blob Storage account + required: true + schema: + type: string + - name: blobPath + in: header + description: Path to the blob within the container, such as 'hello.pdf' or + '/folder/subfolder/world.pdf' + required: true + schema: + type: string + - name: allowExecutables + in: header + description: Set to false to block executable files (program code) from being + allowed in the input file. Default is false (recommended). + schema: + type: boolean + - name: allowInvalidFiles + in: header + description: Set to false to block invalid files, such as a PDF file that + is not really a valid PDF file, or a Word Document that is not a valid Word + Document. Default is false (recommended). + schema: + type: boolean + - name: allowScripts + in: header + description: Set to false to block script files, such as a PHP files, Python + scripts, and other malicious content or security threats that can be embedded + in the file. Set to true to allow these file types. Default is false (recommended). + schema: + type: boolean + - name: allowPasswordProtectedFiles + in: header + description: Set to false to block password protected and encrypted files, + such as encrypted zip and rar files, and other files that seek to circumvent + scanning through passwords. Set to true to allow these file types. Default + is false (recommended). + schema: + type: boolean + - name: allowMacros + in: header + description: Set to false to block macros and other threats embedded in document + files, such as Word, Excel and PowerPoint embedded Macros, and other files + that contain embedded content threats. Set to true to allow these file + types. Default is false (recommended). + schema: + type: boolean + - name: restrictFileTypes + in: header + description: Specify a restricted set of file formats to allow as clean as + a comma-separated list of file formats, such as .pdf,.docx,.png would allow + only PDF, PNG and Word document files. All files must pass content verification + against this list of file formats, if they do not, then the result will + be returned as CleanResult=false. Set restrictFileTypes parameter to null + or empty string to disable; default is disabled. + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + text/json: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + application/xml: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + text/xml: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + security: + - Apikey: [] + /virus/scan/cloud-storage/aws-s3/single: + post: + tags: + - ScanCloudStorage + summary: Scan an AWS S3 file for viruses + description: Scan the contents of a single AWS S3 file and its content for viruses. + Leverage continuously updated signatures for millions of threats, and advanced + high-performance scanning capabilities. Over 17 million virus and malware + signatures. Continuous cloud-based updates. Wide file format support including + Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and + other archive formats. Multi-threat scanning across viruses, malware, trojans, + ransomware, and spyware. High-speed in-memory scanning delivers subsecond + typical response time. + operationId: Scan Cloud Storage_Scan Aws S3File + parameters: + - name: accessKey + in: header + description: AWS S3 access key for the S3 bucket; you can get this from My + Security Credentials in the AWS console + required: true + schema: + type: string + - name: secretKey + in: header + description: AWS S3 secret key for the S3 bucket; you can get this from My + Security Credentials in the AWS console + required: true + schema: + type: string + - name: bucketRegion + in: header + description: Name of the region of the S3 bucket, such as 'US-East-1' + required: true + schema: + type: string + - name: bucketName + in: header + description: Name of the S3 bucket + required: true + schema: + type: string + - name: keyName + in: header + description: Key name (also called file name) of the file in S3 that you wish + to scan for viruses + required: true + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + text/json: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + application/xml: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + text/xml: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + security: + - Apikey: [] + /virus/scan/cloud-storage/aws-s3/single/advanced: + post: + tags: + - ScanCloudStorage + summary: Advanced Scan an AWS S3 file for viruses + description: Advanced Scan the contents of a single AWS S3 file and its content + for viruses and threats. Advanced Scan files with 360-degree Content Protection + across Viruses and Malware, executables, invalid files, scripts, and even + restrictions on accepted file types with complete content verification. Customize + threat rules to your needs. Leverage continuously updated signatures for millions + of threats, and advanced high-performance scanning capabilities. Over 17 + million virus and malware signatures. Continuous cloud-based updates. Block + threats beyond viruses including executables, scripts, invalid files, and + more. Optionally limit input files to a specific set of file types (e.g. + PDF and Word Documents only). Wide file format support including Office, + PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, .Tar, and other + archive formats. Multi-threat scanning across viruses, malware, trojans, + ransomware, and spyware. High-speed in-memory scanning delivers subsecond + typical response time. + operationId: Scan Cloud Storage_Scan Aws S3File Advanced + parameters: + - name: accessKey + in: header + description: AWS S3 access key for the S3 bucket; you can get this from My + Security Credentials in the AWS console + required: true + schema: + type: string + - name: secretKey + in: header + description: AWS S3 secret key for the S3 bucket; you can get this from My + Security Credentials in the AWS console + required: true + schema: + type: string + - name: bucketRegion + in: header + description: Name of the region of the S3 bucket, such as 'US-East-1' + required: true + schema: + type: string + - name: bucketName + in: header + description: Name of the S3 bucket + required: true + schema: + type: string + - name: keyName + in: header + description: Key name (also called file name) of the file in S3 that you wish + to scan for viruses + required: true + schema: + type: string + - name: allowExecutables + in: header + description: Set to false to block executable files (program code) from being + allowed in the input file. Default is false (recommended). + schema: + type: boolean + - name: allowInvalidFiles + in: header + description: Set to false to block invalid files, such as a PDF file that + is not really a valid PDF file, or a Word Document that is not a valid Word + Document. Default is false (recommended). + schema: + type: boolean + - name: allowScripts + in: header + description: Set to false to block script files, such as a PHP files, Python + scripts, and other malicious content or security threats that can be embedded + in the file. Set to true to allow these file types. Default is false (recommended). + schema: + type: boolean + - name: allowPasswordProtectedFiles + in: header + description: Set to false to block password protected and encrypted files, + such as encrypted zip and rar files, and other files that seek to circumvent + scanning through passwords. Set to true to allow these file types. Default + is false (recommended). + schema: + type: boolean + - name: allowMacros + in: header + description: Set to false to block macros and other threats embedded in document + files, such as Word, Excel and PowerPoint embedded Macros, and other files + that contain embedded content threats. Set to true to allow these file + types. Default is false (recommended). + schema: + type: boolean + - name: restrictFileTypes + in: header + description: Specify a restricted set of file formats to allow as clean as + a comma-separated list of file formats, such as .pdf,.docx,.png would allow + only PDF, PNG and Word document files. All files must pass content verification + against this list of file formats, if they do not, then the result will + be returned as CleanResult=false. Set restrictFileTypes parameter to null + or empty string to disable; default is disabled. + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + text/json: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + application/xml: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + text/xml: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + security: + - Apikey: [] + /virus/scan/cloud-storage/gcp-storage/single: + post: + tags: + - ScanCloudStorage + summary: Scan an Google Cloud Platform (GCP) Storage file for viruses + description: Scan the contents of a single Google Cloud Platform (GCP) Storage + file and its content for viruses. Leverage continuously updated signatures + for millions of threats, and advanced high-performance scanning capabilities. Over + 17 million virus and malware signatures. Continuous cloud-based updates. Wide + file format support including Office, PDF, HTML, Flash. Zip support including + .Zip, .Rar, .DMG, .Tar, and other archive formats. Multi-threat scanning + across viruses, malware, trojans, ransomware, and spyware. High-speed in-memory + scanning delivers subsecond typical response time. + operationId: Scan Cloud Storage_Scan Gcp Storage File + parameters: + - name: bucketName + in: header + description: Name of the bucket in Google Cloud Storage + required: true + schema: + type: string + - name: objectName + in: header + description: Name of the object or file in Google Cloud Storage + required: true + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + required: + - jsonCredentialFile + properties: + jsonCredentialFile: + type: string + description: Service Account credential for Google Cloud stored + in a JSON file. + format: binary + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + text/json: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + application/xml: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + text/xml: + schema: + $ref: '#/components/schemas/CloudStorageVirusScanResult' + security: + - Apikey: [] + /virus/scan/cloud-storage/gcp-storage/single/advanced: + post: + tags: + - ScanCloudStorage + summary: Advanced Scan an Google Cloud Platform (GCP) Storage file for viruses + description: Advanced Scan the contents of a single Google Cloud Platform (GCP) + Storage file and its content for viruses and threats. Advanced Scan files + with 360-degree Content Protection across Viruses and Malware, executables, + invalid files, scripts, and even restrictions on accepted file types with + complete content verification. Customize threat rules to your needs. Leverage + continuously updated signatures for millions of threats, and advanced high-performance + scanning capabilities. Over 17 million virus and malware signatures. Continuous + cloud-based updates. Block threats beyond viruses including executables, + scripts, invalid files, and more. Optionally limit input files to a specific + set of file types (e.g. PDF and Word Documents only). Wide file format support + including Office, PDF, HTML, Flash. Zip support including .Zip, .Rar, .DMG, + .Tar, and other archive formats. Multi-threat scanning across viruses, malware, + trojans, ransomware, and spyware. High-speed in-memory scanning delivers + subsecond typical response time. + operationId: Scan Cloud Storage_Scan Gcp Storage File Advanced + parameters: + - name: bucketName + in: header + description: Name of the bucket in Google Cloud Storage + required: true + schema: + type: string + - name: objectName + in: header + description: Name of the object or file in Google Cloud Storage + required: true + schema: + type: string + - name: allowExecutables + in: header + description: Set to false to block executable files (program code) from being + allowed in the input file. Default is false (recommended). + schema: + type: boolean + - name: allowInvalidFiles + in: header + description: Set to false to block invalid files, such as a PDF file that + is not really a valid PDF file, or a Word Document that is not a valid Word + Document. Default is false (recommended). + schema: + type: boolean + - name: allowScripts + in: header + description: Set to false to block script files, such as a PHP files, Python + scripts, and other malicious content or security threats that can be embedded + in the file. Set to true to allow these file types. Default is false (recommended). + schema: + type: boolean + - name: allowPasswordProtectedFiles + in: header + description: Set to false to block password protected and encrypted files, + such as encrypted zip and rar files, and other files that seek to circumvent + scanning through passwords. Set to true to allow these file types. Default + is false (recommended). + schema: + type: boolean + - name: allowMacros + in: header + description: Set to false to block macros and other threats embedded in document + files, such as Word, Excel and PowerPoint embedded Macros, and other files + that contain embedded content threats. Set to true to allow these file + types. Default is false (recommended). + schema: + type: boolean + - name: restrictFileTypes + in: header + description: Specify a restricted set of file formats to allow as clean as + a comma-separated list of file formats, such as .pdf,.docx,.png would allow + only PDF, PNG and Word document files. All files must pass content verification + against this list of file formats, if they do not, then the result will + be returned as CleanResult=false. Set restrictFileTypes parameter to null + or empty string to disable; default is disabled. + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + required: + - jsonCredentialFile + properties: + jsonCredentialFile: + type: string + description: Service Account credential for Google Cloud stored + in a JSON file. + format: binary + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + text/json: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + application/xml: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + text/xml: + schema: + $ref: '#/components/schemas/CloudStorageAdvancedVirusScanResult' + security: + - Apikey: [] +components: + schemas: + VirusScanResult: + type: object + properties: + CleanResult: + type: boolean + description: True if the scan contained no viruses, false otherwise + FoundViruses: + type: array + description: Array of viruses found, if any + items: + $ref: '#/components/schemas/VirusFound' + description: Result of running a virus scan + VirusFound: + type: object + properties: + FileName: + type: string + description: Name of the file containing the virus + VirusName: + type: string + description: Name of the virus that was found + description: Virus positively identified + VirusScanAdvancedResult: + type: object + properties: + CleanResult: + type: boolean + description: True if the scan contained no viruses, false otherwise + ContainsExecutable: + type: boolean + description: True if the scan contained an executable (application code), + which can be a significant risk factor + ContainsInvalidFile: + type: boolean + description: True if the scan contained an invalid file (such as a PDF that + is not a valid PDF, Word Document that is not a valid Word Document, etc.), + which can be a significant risk factor + ContainsScript: + type: boolean + description: True if the scan contained a script (such as a PHP script, + Python script, etc.) which can be a significant risk factor + ContainsPasswordProtectedFile: + type: boolean + description: True if the scan contained a password protected or encrypted + file, which can be a significant risk factor + ContainsRestrictedFileFormat: + type: boolean + description: True if the uploaded file is of a type that is not allowed + based on the optional restrictFileTypes parameter, false otherwise; if + restrictFileTypes is not set, this will always be false + ContainsMacros: + type: boolean + description: True if the uploaded file contains embedded Macros of other + embedded threats within the document, which can be a significant risk + factor + ContainsXmlExternalEntities: + type: boolean + description: True if the uploaded file contains embedded XML External Entity + threats of other embedded threats within the document, which can be a + significant risk factor + VerifiedFileFormat: + type: string + description: For file format verification-supported file formats, the contents-verified + file format of the file. Null indicates that the file format is not supported + for contents verification. If a Virus or Malware is found, this field + will always be set to Null. + FoundViruses: + type: array + description: Array of viruses found, if any + items: + $ref: '#/components/schemas/VirusFound' + description: Result of running an advanced virus scan + WebsiteScanRequest: + type: object + properties: + Url: + type: string + description: URL of the website to scan; should begin with http:// or https:// + description: Request to scan a website for malicious content + WebsiteScanResult: + type: object + properties: + CleanResult: + type: boolean + description: True if the scan contained no threats, false otherwise + WebsiteThreatType: + type: string + description: Type of threat returned; can be None, Malware, ForcedDownload + or Phishing + enum: + - None + - Malware + - Phishing + - ForcedDownload + - UnableToConnect + FoundViruses: + type: array + description: Array of viruses found, if any + nullable: true + items: + $ref: '#/components/schemas/VirusFound' + WebsiteHttpResponseCode: + type: integer + description: The remote server URL HTTP reasponse code; useful for debugging + issues with scanning; typically if the remote server returns a 200 or + 300-series code this means a successful response, while a 400 or 500 series + code would represent an error returned from the remote server for the + provided URL. + format: int32 + description: Result of running a website scan + CloudStorageVirusScanResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation of retrieving the file, and scanning + it were successfully completed, false if the file could not be downloaded + from cloud storage, or if the file could not be scanned. Note that successful + completion does not mean the file is clean; for the output of the virus + scanning operation itself, use the CleanResult and FoundViruses parameters. + CleanResult: + type: boolean + description: True if the scan contained no viruses, false otherwise + FoundViruses: + type: array + description: Array of viruses found, if any + items: + $ref: '#/components/schemas/CloudStorageVirusFound' + ErrorDetailedDescription: + type: string + description: Detailed error message if the operation was not successful + FileSize: + type: integer + description: Size in bytes of the file that was retrieved and scanned + format: int64 + description: Result of running a virus scan on cloud storage + CloudStorageVirusFound: + type: object + properties: + FileName: + type: string + description: Name of the file containing the virus + VirusName: + type: string + description: Name of the virus that was found + description: Virus positively identified + CloudStorageAdvancedVirusScanResult: + type: object + properties: + Successful: + type: boolean + description: True if the operation of retrieving the file, and scanning + it were successfully completed, false if the file could not be downloaded + from cloud storage, or if the file could not be scanned. Note that successful + completion does not mean the file is clean; for the output of the virus + scanning operation itself, use the CleanResult and FoundViruses parameters. + CleanResult: + type: boolean + description: True if the scan contained no viruses, false otherwise + ContainsExecutable: + type: boolean + description: True if the scan contained an executable (application code), + which can be a significant risk factor + ContainsInvalidFile: + type: boolean + description: True if the scan contained an invalid file (such as a PDF that + is not a valid PDF, Word Document that is not a valid Word Document, etc.), + which can be a significant risk factor + ContainsScript: + type: boolean + description: True if the scan contained a script (such as a PHP script, + Python script, etc.) which can be a significant risk factor + ContainsPasswordProtectedFile: + type: boolean + description: True if the scan contained a password protected or encrypted + file, which can be a significant risk factor + ContainsRestrictedFileFormat: + type: boolean + description: True if the uploaded file is of a type that is not allowed + based on the optional restrictFileTypes parameter, false otherwise; if + restrictFileTypes is not set, this will always be false + ContainsMacros: + type: boolean + description: True if the uploaded file contains embedded Macros of other + embedded threats within the document, which can be a significant risk + factor + VerifiedFileFormat: + type: string + description: For file format verification-supported file formats, the contents-verified + file format of the file. Null indicates that the file format is not supported + for contents verification. If a Virus or Malware is found, this field + will always be set to Null. + FoundViruses: + type: array + description: Array of viruses found, if any + items: + $ref: '#/components/schemas/CloudStorageVirusFound' + ErrorDetailedDescription: + type: string + description: Detailed error message if the operation was not successful + FileSize: + type: integer + description: Size in bytes of the file that was retrieved and scanned + format: int64 + description: Result of running an advanced virus scan on cloud storage + securitySchemes: + Apikey: + type: apiKey + description: API Key Authentication + name: Apikey + in: header diff --git a/openapi/cloudmersive.virusscan/types.bal b/openapi/cloudmersive.virusscan/types.bal new file mode 100644 index 000000000..783a7f1c3 --- /dev/null +++ b/openapi/cloudmersive.virusscan/types.bal @@ -0,0 +1,143 @@ +// Copyright (c) 2021 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +# Result of running a website scan +public type WebsiteScanResult record { + # True if the scan contained no threats, false otherwise + boolean CleanResult?; + # Type of threat returned; can be None, Malware, ForcedDownload or Phishing + string WebsiteThreatType?; + # Array of viruses found, if any + VirusFound[]? FoundViruses?; + # The remote server URL HTTP reasponse code; useful for debugging issues with scanning; typically if the remote server returns a 200 or 300-series code this means a successful response, while a 400 or 500 series code would represent an error returned from the remote server for the provided URL. + int WebsiteHttpResponseCode?; +}; + +# Result of running an advanced virus scan on cloud storage +public type CloudStorageAdvancedVirusScanResult record { + # True if the operation of retrieving the file, and scanning it were successfully completed, false if the file could not be downloaded from cloud storage, or if the file could not be scanned. Note that successful completion does not mean the file is clean; for the output of the virus scanning operation itself, use the CleanResult and FoundViruses parameters. + boolean Successful?; + # True if the scan contained no viruses, false otherwise + boolean CleanResult?; + # True if the scan contained an executable (application code), which can be a significant risk factor + boolean ContainsExecutable?; + # True if the scan contained an invalid file (such as a PDF that is not a valid PDF, Word Document that is not a valid Word Document, etc.), which can be a significant risk factor + boolean ContainsInvalidFile?; + # True if the scan contained a script (such as a PHP script, Python script, etc.) which can be a significant risk factor + boolean ContainsScript?; + # True if the scan contained a password protected or encrypted file, which can be a significant risk factor + boolean ContainsPasswordProtectedFile?; + # True if the uploaded file is of a type that is not allowed based on the optional restrictFileTypes parameter, false otherwise; if restrictFileTypes is not set, this will always be false + boolean ContainsRestrictedFileFormat?; + # True if the uploaded file contains embedded Macros of other embedded threats within the document, which can be a significant risk factor + boolean ContainsMacros?; + # For file format verification-supported file formats, the contents-verified file format of the file. Null indicates that the file format is not supported for contents verification. If a Virus or Malware is found, this field will always be set to Null. + string VerifiedFileFormat?; + # Array of viruses found, if any + CloudStorageVirusFound[] FoundViruses?; + # Detailed error message if the operation was not successful + string ErrorDetailedDescription?; + # Size in bytes of the file that was retrieved and scanned + int FileSize?; +}; + +public type Body2 record { + # Service Account credential for Google Cloud stored in a JSON file. + string jsonCredentialFile; +}; + +# Request to scan a website for malicious content +public type WebsiteScanRequest record { + # URL of the website to scan; should begin with http:// or https:// + string Url?; +}; + +public type Body3 record { + # Service Account credential for Google Cloud stored in a JSON file. + string jsonCredentialFile; +}; + +# Result of running an advanced virus scan +public type VirusScanAdvancedResult record { + # True if the scan contained no viruses, false otherwise + boolean CleanResult?; + # True if the scan contained an executable (application code), which can be a significant risk factor + boolean ContainsExecutable?; + # True if the scan contained an invalid file (such as a PDF that is not a valid PDF, Word Document that is not a valid Word Document, etc.), which can be a significant risk factor + boolean ContainsInvalidFile?; + # True if the scan contained a script (such as a PHP script, Python script, etc.) which can be a significant risk factor + boolean ContainsScript?; + # True if the scan contained a password protected or encrypted file, which can be a significant risk factor + boolean ContainsPasswordProtectedFile?; + # True if the uploaded file is of a type that is not allowed based on the optional restrictFileTypes parameter, false otherwise; if restrictFileTypes is not set, this will always be false + boolean ContainsRestrictedFileFormat?; + # True if the uploaded file contains embedded Macros of other embedded threats within the document, which can be a significant risk factor + boolean ContainsMacros?; + # True if the uploaded file contains embedded XML External Entity threats of other embedded threats within the document, which can be a significant risk factor + boolean ContainsXmlExternalEntities?; + # For file format verification-supported file formats, the contents-verified file format of the file. Null indicates that the file format is not supported for contents verification. If a Virus or Malware is found, this field will always be set to Null. + string VerifiedFileFormat?; + # Array of viruses found, if any + VirusFound[] FoundViruses?; +}; + +# Virus positively identified +public type CloudStorageVirusFound record { + # Name of the file containing the virus + string FileName?; + # Name of the virus that was found + string VirusName?; +}; + +public type Body1 record { + # Input file to perform the operation on. + string inputFile; +}; + +# Result of running a virus scan on cloud storage +public type CloudStorageVirusScanResult record { + # True if the operation of retrieving the file, and scanning it were successfully completed, false if the file could not be downloaded from cloud storage, or if the file could not be scanned. Note that successful completion does not mean the file is clean; for the output of the virus scanning operation itself, use the CleanResult and FoundViruses parameters. + boolean Successful?; + # True if the scan contained no viruses, false otherwise + boolean CleanResult?; + # Array of viruses found, if any + CloudStorageVirusFound[] FoundViruses?; + # Detailed error message if the operation was not successful + string ErrorDetailedDescription?; + # Size in bytes of the file that was retrieved and scanned + int FileSize?; +}; + +# Result of running a virus scan +public type VirusScanResult record { + # True if the scan contained no viruses, false otherwise + boolean CleanResult?; + # Array of viruses found, if any + VirusFound[] FoundViruses?; +}; + +# Virus positively identified +public type VirusFound record { + # Name of the file containing the virus + string FileName?; + # Name of the virus that was found + string VirusName?; +}; + +public type Body record { + # Input file to perform the operation on. + string inputFile; +};